Dereferencing memory

31 views
Skip to first unread message

carlo cannarsa

unread,
Aug 23, 2022, 12:38:12 PM8/23/22
to DynamoRIO Users
Hi, I need an inline assembly instruction to dereference some memory location using square brackets, like
mov eax, [ebx]
I searched into the documentation and I tried drutil_insert_get_mem_addr but in the logs it just adds a lea and not what I want. Is there a DR macro that can solve my problem?

Thanks in advance,
Carlo

sharma...@google.com

unread,
Aug 24, 2022, 12:35:46 PM8/24/22
to DynamoRIO Users
Hi Carlo,
There are various XINST_create_load macros available at https://dynamorio.org/dr__ir__macros__x86_8h.html#aad24f4f2a447e6556931d254afb87e06. Do they help?

Abhinav

carlo cannarsa

unread,
Aug 24, 2022, 2:11:26 PM8/24/22
to DynamoRIO Users
Hi Abhinav ,
thank you for your reply. I tried also the macros you proposed, but I didn't manage to create a dereference correctly. Can you suggest me an example for my case?

Carlo

sharma...@google.com

unread,
Aug 25, 2022, 9:54:44 AM8/25/22
to DynamoRIO Users
Hi Carlo,
Can you provide more details of your use-case, what you tried and the result of your attempts?


Abhinav

carlo cannarsa

unread,
Aug 26, 2022, 4:58:39 AM8/26/22
to DynamoRIO Users
Hi Abhinav,
I wanted to load the content of memory at addr 0xA, so [0xA]. I think I solved the problem using OPND_CREATE_MEM32. Thank you anyway for your help.

Carlo

Reply all
Reply to author
Forward
0 new messages