timestee
timestee

Reputation: 1096

How to programmatically get the exact address in the memory space according to the assembly statement

Hummm,hope i will express my question clearly.

Now i have an assembly statement string like:

movss ****,xmm0; (intel style)

After this assembly statement being executed, a piece of the process's memory changed. So **** must be the memory address, it could be something like:

DWORD PTR [eax],
DWORD PTR [eax + 0x4],
DWORD PTR [ebp - 0x4]
...Some style i have not seen, if you know that, please do tell me.

My problem is how to programmatically get the memory address through analyzing the assembly statement string.

For example: if **** to be :

DWORD PTR [eax]

Perhaps I could search the string, and find EAX register, then get the data from EAX register, maybe it is the memory address, maybe not, it depends on the Addressing System, am i right? Finally,how could i get the exact address?

Upvotes: 0

Views: 237

Answers (1)

zje
zje

Reputation: 3912

Is it possible for you to use the LEA "Load Effective Address" instruction ? I'm sorry, I'm not too familiar with Intel assembly, but that's what I would try.

This may help: http://en.wikibooks.org/wiki/X86_Assembly/Data_Transfer#Load_Effective_Address

Hope this helps!

Upvotes: 1

Related Questions