sashs / Ropper

Display information about files in different file formats and find gadgets to build rop chains for different architectures (x86/x86_64, ARM/ARM64, MIPS, PowerPC, SPARC64). For disassembly ropper uses the awesome Capstone Framework.
https://scoding.de/ropper
BSD 3-Clause "New" or "Revised" License
1.88k stars 206 forks source link

Cannot get ropper working with multiple files #150

Closed nickylimjj closed 2 years ago

nickylimjj commented 3 years ago

According to the help page, ropper can be used with several files

ropper -h
    [...snip...]
    -f <file> [<file> ...], --file <file> [<file> ...]
    [...snip...]

However, using it with multiple files fail. Ie,

ropper -f a.txt b.txt --search "inc eax"

Is this a bug?

sashs commented 3 years ago

Hi. I do not know. What happens when you execute ropper with that command? Does it crash? If yes, could you please provide the stacktrace?

nickylimjj commented 3 years ago

Hi. I do not know. What happens when you execute ropper with that command? Does it crash? If yes, could you please provide the stacktrace?

Hi, below.

ropper -f a.txt b.txt --search "inc eax"
[INFO] File 'a.txt' selected.
[INFO] Load gadgets from cache
[LOAD] loading... 100%
[LOAD] removing double gadgets... 100%
[INFO] Searching for gadgets: inc eax

[INFO] File: a.txt
0x1024de4a: inc eax; adc byte ptr [edi + 0x4f], bl; ret; 
0x1034dded: inc eax; xor eax, eax; ret 4; 

[ERROR] Please report this error on https://github.com/sashs/ropper
[ERROR] Traceback (most recent call last):
  File "/home/user/.local/lib/python3.9/site-packages/ropper/console.py", line 62, in cmd
    func(self, text)
  File "/home/user/.local/lib/python3.9/site-packages/ropper/console.py", line 573, in __handleOptions
    self.__search(options.search, options.quality)
  File "/home/user/.local/lib/python3.9/site-packages/ropper/console.py", line 339, in __search
    for fc, gadget in self.__rs.search(filter, quality):
  File "/home/user/.local/lib/python3.9/site-packages/ropper/service.py", line 710, in search
    for gadget in s.search(fc.gadgets, search, quality):
  File "/home/user/.local/lib/python3.9/site-packages/ropper/search.py", line 188, in search
    max_count = len(gadgets)
TypeError: object of type 'NoneType' has no len()
sashs commented 3 years ago

Could you please search only in the second binary for that gadget?

sashs commented 2 years ago

Fixed the bug today. Will push it later