JonathanSalwan/ROPgadget

x86 Gadgets Not Recognized

Closed this issue · 2 comments

Your regexes are missing a few instruction styles. Specifically, these:

~/pwntools ❯❯❯ asm 'JMP DWORD PTR [ESP]'
ff2424
~/pwntools ❯❯❯ asm 'JMP DWORD PTR [ESP+1234]'
ffa424d2040000
~/pwntools ❯❯❯ asm 'JMP DWORD PTR [EBP]'
ff2505000000
~/pwntools ❯❯❯ asm 'JMP DWORD PTR [EBP+1234]'
ff25d7040000
~/pwntools ❯❯❯ asm 'CALL DWORD PTR [ESP]'
ff1424
~/pwntools ❯❯❯ asm 'CALL DWORD PTR [ESP+1]'
ff542401
~/pwntools ❯❯❯ asm 'CALL DWORD PTR [EBP]'
ff1505000000
~/pwntools ❯❯❯ asm 'CALL DWORD PTR [EBP+1]'
ff1506000000

Additionally, you use the set [\x00-\xff] in several places. This could be replaced with ..

The problem with using "." instead of "[\x00-\xff]" is that the dot will not match \x0a which is a newline (\n).

On Jan 12, 2015, at 1:05 AM, Zach Riggle notifications@github.com wrote:

Your regexes are missing a few instruction styles. Specifically, these:

~/pwntools ❯❯❯ asm 'JMP DWORD PTR [ESP]'
ff2424
~/pwntools ❯❯❯ asm 'JMP DWORD PTR [ESP+1234]'
ffa424d2040000
~/pwntools ❯❯❯ asm 'JMP DWORD PTR [EBP]'
ff2505000000
~/pwntools ❯❯❯ asm 'JMP DWORD PTR [EBP+1234]'
ff25d7040000
~/pwntools ❯❯❯ asm 'CALL DWORD PTR [ESP]'
ff1424
~/pwntools ❯❯❯ asm 'CALL DWORD PTR [ESP+1]'
ff542401
~/pwntools ❯❯❯ asm 'CALL DWORD PTR [EBP]'
ff1505000000
~/pwntools ❯❯❯ asm 'CALL DWORD PTR [EBP+1]'
ff1506000000
Additionally, you use the set [\x00-0xff] in several places. This could be replaced with ..


Reply to this email directly or view it on GitHub.

re.DOTALL fixes this for you