Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python2
- import profile
- from pwn import *
- from pprint import pprint
- def ttt4():
- rop = ROP(ELF.from_assembly(
- '''
- pop eax; ret
- pop ebx; call eax
- mov ecx, ebx; ret
- xchg edx, ecx; jmp eax
- mov edi, edx; ret;
- '''
- ))
- context = {
- 'eax': 1,
- 'ebx': 2,
- 'ecx': 3,
- 'edx': 4
- }
- for r, gadgets in rop.setRegisters(context).items():
- print '<setting %s>' % r
- for g in gadgets:
- if isinstance(g, pwnlib.rop.gadgets.Gadget):
- print hex(g.address), '; '.join(g.insns)
- elif isinstance(g, int): print hex(g)
- else: print g
- if __name__ == "__main__":
- #profile.run("ttt4()", "mystats")
- profile.run("ttt4()")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement