Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Issue with offsets when consequential branches (JMP/CALL/..) exist #1

@cwaazywabbit

Description

@cwaazywabbit

Noticed an issue the other day when branching instructions follow each other, such as in a GetPC procedure like

jmp post_get_pc
get_pc:
pop EAX
jmp over_post_get_pc
post_get_pc:
call get_pc
over_post_get_pc:

then jmp over_post_get_pc do not get the offset right. A quick dirty fix is to place a dummy NOP in between consequential branches, like:

jmp post_get_pc
get_pc:
pop EAX
jmp over_post_get_pc
nop
post_get_pc:
call get_pc
over_post_get_pc:

It's probably a bug with my algorithm that notes the indexes of those branches and attempts to calculate the offset for each instruction line by line. I just don't think I have time to fix this ATM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions