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 wrong gadget selection in setRegisters() (#1118) #1156

Merged
merged 4 commits into from
May 30, 2018

Conversation

bruce30262
Copy link
Contributor

For issue #1118

@zachriggle
Copy link
Member

I don't think the detection for int instructions works correctly:

>>> context.arch='amd64'
>>> r=ROP(ELF.from_assembly('syscall; pop rdx; int 0x80; pop rsi; ret'))
...
>>> r.gadgets
{268435456L: Gadget(0x10000000, [u'syscall', u'pop rdx', u'int 0x80'], [u'rdx'], 0x8),
 268435458L: Gadget(0x10000002, [u'pop rdx', u'int 0x80'], [u'rdx'], 0x8),
 268435459L: Gadget(0x10000003, [u'int 0x80'], [], 0x0),
 268435461L: Gadget(0x10000005, [u'pop rsi', u'ret'], [u'rsi'], 0x10),
 268435462L: Gadget(0x10000006, [u'ret'], [], 0x8)}

Would you also mind adding a few tests for that routine, to test those edge cases?

Thanks!

@bruce30262
Copy link
Contributor Author

@zachriggle I've add the test cases, please take a look

@zachriggle zachriggle merged commit 146348f into Gallopsled:stable May 30, 2018
@bruce30262 bruce30262 deleted the fix_rop_stable branch June 1, 2018 04:32
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.

2 participants