Skip to content

Decode to assembler. Relative addressing. #144

@odzhan

Description

@odzhan

Not sure if this is a bug or if I've misunderstood something.
Take the following assembly stub as an example:

00000000  31C0              xor eax,eax
00000002  29C0              sub eax,eax
00000004  EBFA              jmp short 0x0
00000006  EB04              jmp short 0xc
00000008  31C0              xor eax,eax
0000000A  29C0              sub eax,eax
0000000C  C3                ret

Using the decode to assembler example, a NOP is added for each instruction and then reassembled using the serializer with relocations enabled.

00000000  90                nop
00000001  31C0              xor eax,eax
00000003  90                nop
00000004  29C0              sub eax,eax
00000006  90                nop
00000007  EBF7              jmp short 0x0
00000009  90                nop
0000000A  EB00              jmp short 0xc
0000000C  90                nop
0000000D  31C0              xor eax,eax
0000000F  90                nop
00000010  29C0              sub eax,eax
00000012  90                nop
00000013  C3                ret

The immediate values for both JMP instructions have been modified to account for additional instructions added.
Shouldn't the second JMP point to 0x13?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions