NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
51.62k stars 5.87k forks source link

unexpected arguments for "printf" #5795

Open zijiancogito opened 1 year ago

zijiancogito commented 1 year ago

Describe the bug In the decompilation results, the parameter identification for the call statement printf is incorrect. The third parameter "1" is an unexpected parameter, and no corresponding statement can be found in the assembly code.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

1695048588930 1695048642994

Attachments There are the binary and source files. Ghidra-35.zip

Environment (please complete the following information):

Additional context The binary is compiled with Clang 14.0 -O0 -fno-inline-functions

zijiancogito commented 1 year ago

the same problem in the penultimate line "printf("BB: %d", 0xb, 0 % (long)iVar1 & 0xffffffff);"

zijiancogito commented 1 year ago

I found many errors like this, it seems to be the defect of "parameter recovery algorithm"