So basically, as the names already suggest, "mov" copies the value of the source operand (right operand) to the target operand (left operand). If the source is a register (like the first code snippet) then the target operand equals the source operand.
If the source operand is a memory location (either static or referenced via registers) then "mov" will copy the memory value stored at that specific location (like code snippet 2).
"lea" stands for "load effective address" and only loads the address of a memory location into the target operand (which I think is mandatory to be a register).
So as you see, code snippet 1 and code snippet 4 have the exact same effect, but it is not possible to get the value "0x500" stored at [ebx] into eax when using "lea" ...
Mov eax, [edx+1234] means "read what is at address edx+1234 and put it in eax".
lea eax, [edx+1234], means "eax=edx+1234", it would be the equivalent of "mov eax, edx+1234" if were a valid asm instruction.
Lea is often used to perform multiple basic math operations in one instruction (like lea eax,[ebx+edx*4+123] instead of one mov, one imul and two add) _________________
DO NOT PM me if you want help on making/fixing/using a hack.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum