I logged some data from GDB to a file, gdb.txt, which looks like this:
0x00fca0ab: pop ebp
0x00fca0ac: dec edx
0x00fca0ad: xlat BYTE PTR ds:[ebx]
0x00fca0ae: jmp 0xb31bbe76
0x00fca0b3: mov bl,0x8a
0x00fca0b5: fmul DWORD PTR [edi+0x21828f9b]
0x00fca0bb: mov BYTE PTR [ebp+0x45],ah
0x00fca0be: adc BYTE PTR ds:0x66e7d2ad,ch
0x00fca0c4: xchg edx,eax
I want to search for specific ROP gadgets, so I would be looking for something like:
[address]: xchg esi,eax
[address]: ret
How would I go about searching for such text? I would have to look in specific columns so what would be the best way to do so? BTW this is Ubuntu 11.10.
try this:
then you can look for needed data by using grep. In total: