Open fjqisba opened 1 year ago
FWIW, the emulator returns EAX = 0x501000 with the bytes
68 07 67 9D 2F 68 9B B1 15 D9 68 27 10 40 00 8B 4C 24 06 C7 84 0C EB 26 F8 98 00 10 50 00 58 C3
At the mov dword ptr ss:[esp + ecx - 0x6707D915], 0x501000
instruction, ecx=0x6707D915
. The instruction thus behaves like `mov dword ptr ss:[esp], 0x501000``which the decompiler misses
In fact, I already understand the cause of the problem.This is an article I wrote in Chinese. https://bbs.kanxue.com/thread-278727.htm You may need to read it through a translator. I just want to report some issues.....so developers may notice more when writing decompilers
Describe the bug Unable to output correct decompilation results.
To Reproduce Use ghidra to decompile a simple code:
Expected behavior After executing the code,EAX should be 0x501000. However, the output result of ghidra is 0x401027
Additional context I think the reason for the error is ghidra performed constant propagation prematurely before performing stack variable detection.