0
votes

I try to transform some piece of assembly in C language. I know that the LEA instruction stores an address into a specified register.

For example:

LEA EAX, DWORD PTR SS:[EBP - 0x8] 

In the stack address [EBP - 0x8], I have the value 00000003D (ollydbg shows it). If I assume that eax is a pointer and regard 00000003D as 61(decimal), then I try the following:

int value = 61;

int *eax = &value

Would you agree ? Yes or not? If not, why?

1

1 Answers

3
votes

The LEA instruction computes an address which in this case is a pointer to a local variable, so what you have written matches very closely.