flat assembler
Message board for the users of flat assembler.

Index > Main > mov rax,[rip-7] means what?

Author
Thread Post new topic Reply to topic
system error



Joined: 01 Sep 2013
Posts: 671
system error
The instruction size itself is 7 bytes. So does that mean that RAX contains its own encoding or am I getting this wrong? I am a bit confused.
Post 16 Jun 2015, 00:35
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
RIP points to the beginning of the next instruction. So your code will load RAX with the highest byte (the MSB) being the first byte of the next instruction, and the lower seven bytes being that instruction.
Post 16 Jun 2015, 01:33
View user's profile Send private message Visit poster's website Reply with quote
system error



Joined: 01 Sep 2013
Posts: 671
system error
ok got it. kinda self-pointing instruction. Any chance I can use variable instead of constant? Like manipulating $, $$? It threw me an error, that $ thingy.
Post 16 Jun 2015, 04:10
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
Code:
mov rax,[$]    
Post 16 Jun 2015, 05:17
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.