Open op2786 opened 2 years ago
This is a subset of the functionality that would be required for #2185, so we're leaving this issue to track automatically resolving standard library calls that get inlined. The other issue tracks being able to make any HLIL code into an inlined function.
Currently we have partial support for this feature. It is currently limited to "Constant Data" i.e. When a string or data is "usually" written to sequential stack locations. We recover these and display them as one of:
__builtin_strcpy
__builtin_strncpy
__builtin_memcpy
__builtin_wcscpy
__builtin_memset
TODO:
__builtin_ memcmp
__builtin_ strcmp
__builtin_ strcat
Recovery of non-"Constant Data" functions:
strlen
strcpy
strncpy
memcpy
memcmp
wcscpy
strcmp
Specific strcat
related issue here:
And a (potentially more complicated) issue for C++ things like std::string
:
Compilers sometimes makes standard functions (strlen, memcpy, strcat, memset, strcmp, memcmp etc) inline. I guess their code pattern can be recognized and replaced with pseudo call to function.
Example disassembly:
Output in HLIL:
Which can be replaced
memset(Dst, 0, 0x10c)
. It may be related to #2185.