Missing variable declaration in hlil
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:
- Open KernelBase.dll
- Load the pdb
- Navigate to GetModuleHandleW
- 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:

Additional Information: KernelBase.dll.txt
User reports this still repros on latest dev and the container fix from last week doesn't affect it.
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
as of 4.2 the code looks like this now which seems almost perfect.
This isn’t fixed? Where is the declaration for result in your screenshot?
🤦♂️ Yeah IDK what I was thinking
Fixed in 5.0.7156