Local Variable Addressing in Ghidra

Local Variable Addressing in Ghidra

I've been trying to solve a crackme challenge by examining it's decompiled version by Ghidra. So I figured the code where the strcmp is done as shown in the figure below. Now I need to to patch the program to make it print the password if strcmp fails.

  • The password is stored in local_40

But I don't know how to patch the instruction to print out the value at local_40

Instead of MOV dword ptr [ESP],0x4b1050 what variable in this instruction should be edited? If my understanding is correct then the above instruction is loading the ESP register with the value at 0x4b1050 so how will I get the address of local_40?

4
Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.