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: 670
system error 16 Jun 2015, 00:35
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: 20451
Location: In your JS exploiting you and your system
revolution 16 Jun 2015, 01:33
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: 670
system error 16 Jun 2015, 04:10
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: 20451
Location: In your JS exploiting you and your system
revolution 16 Jun 2015, 05:17
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.