angr.analyses.decompiler.known_patterns.std_string_length¶
Inlined std::string::length() / size() and empty().
The length field is an 8- or 4-byte load of the string’s size member. libstdc++
keeps _M_string_length one word past the data pointer; the MSVC STL keeps
_Mysize behind a fixed 16-byte SSO buffer union (see layouts). One
template covers all of {libstdc++, MSVC} x {32, 64}-bit.
Calibrated against tests/x86_64/decompiler/known_patterns_stl (g++ 12.2.0 -O2), tests/x86_64/windows/known_patterns_stl_msvc_17_x64.exe and tests/i386/windows/known_patterns_stl_msvc_17_x86.exe (VS 2022 /O2).