You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Calling another function before the stack frame is being properly established for the current one causes Ghidra decompiler to identify this action as a local variable initialization. As a result, the very first variable on the stack is getting initialized with some garbage data (e.g. byte buffer init) or getting outright ignored (e.g. integer variable init) by the decompiler.
To Reproduce
Having a function with the stack frame init which looks like the following:
Expected behavior
Decompiler should not mess with the stack variables in cases like that, at the very least there should be an option to ignore the call to __SomeRtlProc as if this call never happened. I'm aware about the fixups but I wasn't able to make any use out of this feature, see below.
Screenshots
On the following screenshot decompiler creates a new variable (cVar1) instead of using the existing one (local_3):
Next screenshot showcases filling the end of the buffer with some nonsensical unrelated to decompilation data:
Environment (please complete the following information):
OS: Windows 10
Java Version: 21.05
Ghidra Version: 11.3
Ghidra Origin: locally built
Additional context
Here is the fixup code which I was using for the __StackCheck procedure:
I'm assuming that assigning an unused temp p-code variable to zero is considered a NOP. I also tried a few other variations which could've been considered as a no operation to the decompiler but to no avail.
The text was updated successfully, but these errors were encountered:
Describe the bug
Calling another function before the stack frame is being properly established for the current one causes Ghidra decompiler to identify this action as a local variable initialization. As a result, the very first variable on the stack is getting initialized with some garbage data (e.g. byte buffer init) or getting outright ignored (e.g. integer variable init) by the decompiler.
To Reproduce
Having a function with the stack frame init which looks like the following:
Expected behavior
Decompiler should not mess with the stack variables in cases like that, at the very least there should be an option to ignore the call to __SomeRtlProc as if this call never happened. I'm aware about the fixups but I wasn't able to make any use out of this feature, see below.
Screenshots
On the following screenshot decompiler creates a new variable (cVar1) instead of using the existing one (local_3):
Next screenshot showcases filling the end of the buffer with some nonsensical unrelated to decompilation data:
Environment (please complete the following information):
Additional context
Here is the fixup code which I was using for the __StackCheck procedure:
I'm assuming that assigning an unused temp p-code variable to zero is considered a NOP. I also tried a few other variations which could've been considered as a no operation to the decompiler but to no avail.
The text was updated successfully, but these errors were encountered: