1
lea     ebp, dword_403638
lea     ebx, [ebp-4]
mov     edi, ss:[ebx]

I understand the first instruction setting ebp to the address of the byte sequence. What I don't understand is what ebx will then be set to. And since ebx is being treated as an address on the stack, will edi refer to an address as well

dword_403638    dd 0
0

I understand the first instruction setting ebp to the address of the byte sequence.

Correct.

lea ebx, [ebp - 4] will set ebx to ebp - 4. On the other hand, mov edi, ss:[ebx] will move (copy) the data stored at stack at address ebx to edi register.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.