uxmal / reko

Reko is a binary decompiler.
https://uxmal.github.io/reko
GNU General Public License v2.0
2.09k stars 250 forks source link

Problems with type inference around `printf` #1341

Open uxmal opened 2 months ago

uxmal commented 2 months ago

(See #1337 opened by @yangzao for the binary in question, program 4) Original code:

char *str = "global string";
printf("%s", str);

Decompile code:

word64 str = 0x006007A8;
printf("%s", *str);

str is a char * in the original code. But in the decompiled code, it is defined as a word64 (I assume it's int64_t). And printf tries to access it with deferencing.