JonathanSalwan/ROPgadget — pull request #41 by hugsy (2014-05-02 00:38:20+00:00)
Title: * adding `--offset' option 

Hi,

This is a very simple patch for a new option "--offset" option that simply adds a specified offset to the gadget address, to have something like this:
```
$ ./ROPgadget.py --binary /bin/cat --offset=0xdeadbeef00000000
Gadgets information
============================================================
0xdeadbeef00406313 : adc al, 0x48 ; add esp, 8 ; pop rbx ; pop rbp ; ret
0xdeadbeef0040865b : adc al, 0x74 ; add dh, bl ; ret
0xdeadbeef0040865a : adc eax, 0xf3027414 ; ret
0xdeadbeef0040488e : add al, -0x77 ; ja 0x40489a ; ret
0xdeadbeef0040488d : add al, -0x77 ; ja 0x40489b ; ret
0xdeadbeef004062bb : add al, 0x5b ; ret
0xdeadbeef00402806 : add al, bpl ; ret
0xdeadbeef00402807 : add al, ch ; ret
[...]
```

This is mostly useful when finding gadgets in shared libraries.
Thanks