flat assembler
Message board for the users of flat assembler.
Index
> Main > Byte calculation problem |
Author |
|
Tomasz Grysztar 25 Nov 2017, 12:08
I quickly patched up an example of how to modify "jmp there" so that it becomes "jmp here":
Code: mov byte [__jump+1], here - __after_jump __jump: jmp short there __after_jump: |
|||
25 Nov 2017, 12:08 |
|
DarkLordTed 25 Nov 2017, 12:28
not exactly but is similar:
mov byte [_jump+1], (00h - (_jump - _jump_to)) _jump_to: ..... .... _jmp_old: .... ... _jump: jne _jmp_old |
|||
25 Nov 2017, 12:28 |
|
Tomasz Grysztar 25 Nov 2017, 12:38
The jump offset is relative to the instruction pointer AFTER the jump instruction, not before. So this should be either:
Code: mov byte [_jump+1], _jump_to - _after_jump Code: mov byte [_jump+1], _jump_to - (_jump+2) |
|||
25 Nov 2017, 12:38 |
|
DarkLordTed 25 Nov 2017, 12:49
Thank you! But the result is absolutely the same. I do not understand what happens. Is this possible to be OllyDbg problem? When code execution comes to that line, it can not continue - it does not hang, but repeatedly stays in this row. The code segment is readable, writable and executable, the error state is SUCCESS but ....
|
|||
25 Nov 2017, 12:49 |
|
revolution 25 Nov 2017, 14:07
What are the bytes of the jmp? Is your jmp going back to itself with the distance encoded to 0xfe?
|
|||
25 Nov 2017, 14:07 |
|
DarkLordTed 26 Nov 2017, 18:14
Thank you, everybody! My mistake! The calculation is correct!
|
|||
26 Nov 2017, 18:14 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.