Go to the middle of the instruction

I am trying to test some anti-parsing methods. One of them jumps to the middle of the instruction, like in this image:

D1iRP.png

When using code

mov     ax, 05EBh
xor     eax, eax
jz      -7
db      0xE8

      

in a small program with NASM I get the following error:

": Win32 COFF does not correctly support relative references to absolute addresses"

Any idea how to fix this or which tool to use instead of NASM?

+3


source to share


1 answer


If you want to go to the address where the instruction starts jz

, minus 7 bytes, you can do so with:

jz $-7

      

In NASM Guide :



$

evaluates the assembly position at the beginning of the line containing the expression

Note that there are commands mov

and xor

only 6 bytes, so you have to jump 1 byte before starting mov

. To jump according to your pattern, you must usejz $-4

+3


source







All Articles