1

Im kinda new to assembly and Im working on a little personal project just to learn. Im writing my code in C++ using Visual Studio 2019. The thing is that when I try to use the inline assembler (__asm) the dereference operator (I dont know if its called like that in assembly aswell) seems to ignore hard coded addresses. When I write say:

sub[ecx + 0x08], eax

It works as expected, it takes the value stored in eax, substracts it from the value that is in address ecx + 8 and stores it on that address.

The thing is that when I write something like

mov edi, [0x5f4fa]

And I debug my program it just reads the instruction as

mov edi, 0x5f4fa

Can someone explain my why is this happening and how to make it work as intended? (take the value in that address and store it in edi rather than storing that address in edi). Thanks a lot.

Michael Petch
  • 46,082
  • 8
  • 107
  • 198
Luke
  • 11
  • 2

0 Answers0