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

Missing variable declaration in hlil

Open yrp604 opened this issue 3 years ago • 2 comments

Version and Platform (required):

  • Binary Ninja Version: 3338-dev
  • OS: Windows
  • OS Version: 11

Bug Description: A variable seemingly comes out of nowhere

Steps To Reproduce: Please provide all steps required to reproduce the behavior:

  1. Open KernelBase.dll
  2. Load the pdb
  3. Navigate to GetModuleHandleW
  4. Look at the usage of arg_8 -- this variable should show up in the function signature, and as is just appears at it's use site without a corresponding def site in the function

Expected Behavior: Every variable that is used has a definition.

Screenshots: image image

Additional Information: KernelBase.dll.txt

yrp604 avatar Apr 10 '22 19:04 yrp604

User reports this still repros on latest dev and the container fix from last week doesn't affect it.

fuzyll avatar Apr 18 '22 17:04 fuzyll

This seems to be due to the calling convention allowing for the use of the register spill area as scratch space, documented here: https://devblogs.microsoft.com/oldnewthing/20110302-00/?p=11333

yrp604 avatar May 25 '24 01:05 yrp604

as of 4.2 the code looks like this now which seems almost perfect. image

plafosse avatar Dec 04 '24 16:12 plafosse

This isn’t fixed? Where is the declaration for result in your screenshot?

yrp604 avatar Dec 05 '24 01:12 yrp604

🤦‍♂️ Yeah IDK what I was thinking

plafosse avatar Dec 05 '24 13:12 plafosse

Fixed in 5.0.7156

D0ntPanic avatar Apr 03 '25 18:04 D0ntPanic