I have the following piece of code, which should at the breakpoint show 123 at eax and 321 at ecx. For some reason that is not happening. Anyone cares to explain why?
push ebp;
mov ebp, esp;
sub esp, 8;
mov [ebp-4], 123;
mov [ebp-8], 321;
mov eax, [ebp-4];
mov ecx, [ebp-8];
pop ebp; <------------- breakpoint here
retn;
I guess what must be wrong is that I cannot do
mov [ebp-4], 123
?
Everything else seems fine to me.
Thanks
edit: The values are: eax 1505915; ecx 1720129;
You're storing byte values into memory.
Change to
mov dword ptr [ebp - 4], 123
mov dword ptr [ebp - 8], 321
eax = 1505915 is 0x16FA7B. The last byte is 7B in hex, which is 123 in decimal. ecx = 1720129 is 0x1A3F41. 41 in hex is the last byte of 321 (141).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With