flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 13 Feb 2008, 15:08
AFAIK, there's no shorter way.
|
|||
![]() |
|
revolution 13 Feb 2008, 15:28
kandamun: You mean to suggest that you have so much memory that you need to use a 64bit jump and yet you still need to save a few bytes because you are running out of memory?
![]() |
|||
![]() |
|
f0dder 13 Feb 2008, 15:44
revolution wrote: kandamun: You mean to suggest that you have so much memory that you need to use a 64bit jump and yet you still need to save a few bytes because you are running out of memory? It can be useful if you're building (a lot of) trampolines... _________________ ![]() |
|||
![]() |
|
kandamun 13 Feb 2008, 15:54
Actually I'm not sure , if that is possible in win64, that is some chunks of code (DLLs or I don't know what else) to be so far they cannot address each other with 32bit address.
OK, then. You can use data from memory too ![]() I will try now to calculate the final jump with single 64bit memory cell and 8/16 bit offsets. |
|||
![]() |
|
bitRAKE 13 Feb 2008, 16:03
ret
![]() |
|||
![]() |
|
MHajduk 13 Feb 2008, 16:12
bitRAKE
do you mean something like this: Code: push rax retn ![]() |
|||
![]() |
|
bitRAKE 13 Feb 2008, 17:05
Could calculate address on the stack or in a register - all depends on the situation. Maybe, it's easier to change the RSP register (i.e. BIOS code, thread). Anyhow RET is the smallest instruction to change RIP in a flexible, usable manner, imho. (INT3 and such are not as flexible.
![]() Code: mov rsp,Table jmp SomeTest Table: dq OptionA dq OptionB dq OptionC SomeTest: and rax,1 jne .0 retn 8 .0: retn OptionA: retn OptionB: retn OptionC: ; end up here |
|||
![]() |
|
bitRAKE 25 Feb 2008, 16:48
Another example:
Code: call MutiBranch MutiBranch: mov rbp,COMMON ; branch to multiple .0: call rbp ;... retn .1: call rbp ;... retn COMMON: pop rbp ; common code call rbp ; common code retn |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.