angr.analyses.decompiler.known_patterns.layouts¶
Runtime-specific struct layout offsets for the STL container patterns.
Where a field offset is simply the n-th pointer word it is ctx.word(n)
(scales with the architecture). Where a runtime differs in a less regular way, the conditional lives here:
the MSVC std::string keeps its size behind a fixed 16-byte SSO buffer union
while libstdc++ keeps it one word past the data pointer.
- angr.analyses.decompiler.known_patterns.layouts.string_data_offset(_ctx)¶
Offset of the character data pointer (_M_p / _Bx). 0 in both runtimes.
- Return type:
- Parameters:
_ctx (PatternContext)
- angr.analyses.decompiler.known_patterns.layouts.string_size_offset(ctx)¶
Offset of the length field (_M_string_length / _Mysize).
- Return type:
- Parameters:
ctx (PatternContext)
- angr.analyses.decompiler.known_patterns.layouts.string_capacity_offset(ctx)¶
libstdc++: offset of the
{ _M_local_buf[16] | _M_allocated_capacity }union, immediately after _M_p and _M_string_length. Only libstdc++ needs it: the MSVC STL keeps _Myres in a plain field and itscapacity()is a bare load, so no pattern here asks for the MSVC offset.- Return type:
- Parameters:
ctx (PatternContext)
- angr.analyses.decompiler.known_patterns.layouts.vector_begin_offset(ctx)¶
- Return type:
- Parameters:
ctx (PatternContext)
- angr.analyses.decompiler.known_patterns.layouts.vector_end_offset(ctx)¶
- Return type:
- Parameters:
ctx (PatternContext)
- angr.analyses.decompiler.known_patterns.layouts.vector_cap_offset(ctx)¶
- Return type:
- Parameters:
ctx (PatternContext)
- angr.analyses.decompiler.known_patterns.layouts.list_next_offset(ctx)¶
- Return type:
- Parameters:
ctx (PatternContext)
- angr.analyses.decompiler.known_patterns.layouts.list_prev_offset(ctx)¶
- Return type:
- Parameters:
ctx (PatternContext)