eg. ROPgadget --binary /bin/ls --dump --all --depth 6
============================================================
Traceback (most recent call last):
File "/usr/local/bin/ROPgadget", line 4, in <module>
__import__('pkg_resources').run_script('ROPGadget==5.7', 'ROPgadget')
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python3.7/site-packages/ROPGadget-5.7-py3.7.egg/EGG-INFO/scripts/ROPgadget", line 12, in <module>
File "/usr/local/lib/python3.7/site-packages/ROPGadget-5.7-py3.7.egg/ropgadget/__init__.py", line 24, in main
File "/usr/local/lib/python3.7/site-packages/ROPGadget-5.7-py3.7.egg/ropgadget/core.py", line 206, in analyze
File "/usr/local/lib/python3.7/site-packages/ROPGadget-5.7-py3.7.egg/ropgadget/core.py", line 111, in __lookingForGadgets
AttributeError: 'bytes' object has no attribute 'encode'
Opcodes can contains hexadecimal values whose associated ASCII characters corresponds
to special characters interpreted as part of a regular expression (typically 0x5B='[').
Calling re.escape before using the opcodes, will escape all these characters, leaving
others unchanged.
- small bugix, removed "\x5C" from 'blr reg'
- Changed regex for Rn by adding 0x03 to allow for X[24-31]
- Changed 'br reg' to include 'ret reg'
- current only allows for 'ret lr'
- difference between RET (\x5f) and JMP (\x1f) is a subroutine hint
Changes pop, synonym for LDMIA sp! {reglist}, to include more variations of LDM {,pc}.
This regex matches: always condition, any addressing mode, either S-bit, any Rn except pc, and pc in reglist.