binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Aggressive return value optimization

Open op2786 opened this issue 3 years ago • 0 comments

Version and Platform (required):

  • Binary Ninja Version: 3.1.3469
  • OS: Windows
  • OS Version: 10
  • CPU Architecture: x64

Steps To Reproduce:

  1. Open attached executable in BN
  2. Wait for analysis
  3. Goto sub_18003eb30
  4. See that sub_1800315b0's return value does not used.
  5. Also see that memset at 0x18003ebfc is ignored at HLIL & Pseudo-C. It is visible in < HLIL.

Capture

I think it is notable that before analysis, sub_1800315b0's return value is used in HLIL & Pseudo-C. Maybe it is because sub_1800315b0 always returns data_1805c6d28 and sub_18003eb30 always uses data_1805c6d28 + 8 which is data_1805c6d30. So, decompiler simplifies it, but I guess it is a bit aggressive.

file.zip

op2786 avatar Aug 03 '22 08:08 op2786