I've started learning how to work with Ghidra and I've stumbled upon a problem that I don't know how to solve.

The program that I am disassembling calls a function argc_check, which returns a result in the register rax. The function always returns the integer 100. After that, the program moves the value from the register rax to the stack at the location local_14. I renamed the stack variable local_14 to hundred.

I checked the decompiler, but the variable hundred is only declared and never used. Instead, Ghidra saves the result of the function argc_check in another variable iVar1. The variable iVar1 never appears in the disassembled code surprisingly.

Why is this happening? Why is the variable hundred ignored? Can I make the decompiler use the variable hundred instead of iVar1?

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.