flat assembler
Message board for the users of flat assembler.

Index > Main > Tool to calculate relative jump/call offsets?

Author
Thread Post new topic Reply to topic
Karl20001



Joined: 10 Nov 2005
Posts: 11
Karl20001 10 Nov 2005, 22:09
Hi Razz
Im currently trying to add functions to a program which i dont have source code off, and cant be disassembled perfectly to be changed and reassembled.
The thing is, for my asm code im partly using code caves or NOPing unused procedures. Problem here is i have to make new calls/jmp or switch old one to new locations.

I know normally a call to label is resolved by the assembler on assembling, so the offset from the call address to the label is put in hexcode.
But as here i dont assemble, i have to calculate the offsets by hand, and that is not good for many calls, considering with jmping backwards i have to think in signed offsets etc Razz
So if someone knows a tool where you can enter the call and destination address, and it gives you the offset, please tell me Razz
Post 10 Nov 2005, 22:09
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20621
Location: In your JS exploiting you and your system
revolution 11 Nov 2005, 01:45
Code:
call foo
bar:
;...
foo:    

becomes:
Code:
db 0xE8
dw/dd/dq (foo-bar) ;the calculated offset    
works for 16, 32 and 64 bit code.
Post 11 Nov 2005, 01:45
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.