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

Fix addr for relative jumps #141

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

STKFLT
Copy link

@STKFLT STKFLT commented Feb 27, 2021

targets of instructions like 'bl' were wrong because the proper image base was not being taken into account when disassembling. This applies the same solution used to calculate the address of each gadget in gadget.py:209 by adding the image base to the start address when disassembling.

This is presumably caused by:

# rop.py:371
# TODO: Another solution should be used here. This is a hack for compatibility reasons. to resolve the gadget address calculation of segments of elf files have a different base address if calculated segment.virtualAddress - segment.offset 

I just don't know enough to understand what the fix would look like so this is more of a workaround of a workaround

@STKFLT STKFLT marked this pull request as draft February 27, 2021 20:29
@sashs
Copy link
Owner

sashs commented Apr 25, 2021

targets of instructions like 'bl' were wrong

I am not sure if I understand what do you mean. Do you think the target is shown wrong in the gadget?

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

Successfully merging this pull request may close these issues.

None yet

2 participants