简体   繁体   中英

LEA instruction - How to transform into C language?

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?

LEA指令计算一个地址,在这种情况下,该地址是指向局部变量的指针,因此您编写的内容非常匹配。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM