For testing purposes I have written some x86 assembly code:
lea ebx, [esi]
I changed the line and wrote:
mov ebx, esi
and the program does exactly the same. Why?
In esi , there is stored the address of a string. In the first line, I stored the address of the address of the string, right? And in 2 line, it should store only the address of the string.
Here, Amit Singh Tomar wrote that
mov eax ,var == lea eax [var]
and when I read and applied that to my case, then I was a little bit confused.
edit: I also try to translate that two lines above into pseudo-C code and it looks like this (I assume that ebx and esi are pointers):
(1st line with lea):
unknownType *ebx = &(*esi) // since the brackets mean dereferencing,
// I use the dereferencing operator *
// and since lea is equal to the
// address of operator, I came to this result
(2nd line with mov):
unknownType *ebx;
ebx = esi ; // in the second case, ebx would point also
// to the address of the string
But this would not be the same, right?