Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86 jump table detection can break in some cases #8

Closed
cyanpencil opened this issue Mar 9, 2021 · 1 comment
Closed

x86 jump table detection can break in some cases #8

cyanpencil opened this issue Mar 9, 2021 · 1 comment

Comments

@cyanpencil
Copy link
Collaborator

cyanpencil commented Mar 9, 2021

Our x86 jump table detection works like this: for every array a accessed by the code through a rip-relative load, if &a is in .rodata, and &a + a[0] is the address of an instruction, then a is a jump table.

This needs some data flow analysis that checks that the value loaded from a is used into an indirect branch.

If possible, it would be cool to check that the code that accesses a has some upper bounds checking on the register used for a's index (which is basically a check for the 'default' case in jumptables)

An example of an array in memory that is falsely detected as a jump table is Case 1 of this issue (HexHive/retrowrite#20)

@diagprov
Copy link
Contributor

Suggest we move as an enhancement on https://github.com/HexHive/retrowrite?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants