Closed norey closed 4 years ago
Hey. This is a problem of filebytes not of ropper. I will check that.
Just tried it on macOS, running version 1.13.3 (latest on pip3)
$ ropper -v
Version: Ropper 1.13.3
Author: Sascha Schirra
Website: http://scoding.de/ropper
$ ropper --file dbghelp.dll --chain virtualprotect
[INFO] Load gadgets for section: .text
[LOAD] loading... 100%
[LOAD] removing double gadgets... 100%
[INFO] Ropchain Generator for VirtualProtect:
[INFO] eax 0x90909090
ecx old protection (writable addr)
edx 0x40 (RWE)
ebx size
esp address
ebp return address (jmp esp)
esi pointer to VirtualProtect
edi ret (rop nop)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/ropper/console.py", line 360, in __generateChain
chain = self.__rs.createRopChain(generator, str(self.currentFile.arch) ,options)
File "/usr/local/lib/python3.7/site-packages/ropper/service.py", line 775, in createRopChain
return generator.create(options)
File "/usr/local/lib/python3.7/site-packages/ropper/ropchain/arch/ropchainx86.py", line 947, in create
jmp_esp = self._createJmp()
File "/usr/local/lib/python3.7/site-packages/ropper/ropchain/arch/ropchainx86.py", line 888, in _createJmp
self._updateUsedBinaries(gadget[0])
NameError: name 'gadget' is not defined
[ERROR] Please report this error on https://github.com/sashs/ropper
[ERROR] Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/ropper/console.py", line 62, in cmd
func(self, text)
File "/usr/local/lib/python3.7/site-packages/ropper/console.py", line 499, in __handleOptions
self.__generateChain(options.chain)
File "/usr/local/lib/python3.7/site-packages/ropper/console.py", line 377, in __generateChain
raise e
File "/usr/local/lib/python3.7/site-packages/ropper/console.py", line 360, in __generateChain
chain = self.__rs.createRopChain(generator, str(self.currentFile.arch) ,options)
File "/usr/local/lib/python3.7/site-packages/ropper/service.py", line 775, in createRopChain
return generator.create(options)
File "/usr/local/lib/python3.7/site-packages/ropper/ropchain/arch/ropchainx86.py", line 947, in create
jmp_esp = self._createJmp()
File "/usr/local/lib/python3.7/site-packages/ropper/ropchain/arch/ropchainx86.py", line 888, in _createJmp
self._updateUsedBinaries(gadget[0])
NameError: name 'gadget' is not defined
gadget means gadgets ,look the source file
Yes, that bug is already fixed. What do you mean?
I'm somehow still getting this issue:
ropper --file ~/Downloads/ntoskrnl.exe --console
Traceback (most recent call last):
File "/usr/local/bin/ropper", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/ropper/__main__.py", line 36, in main
ropper.start(sys.argv[1:])
File "/usr/local/lib/python3.10/site-packages/ropper/__init__.py", line 52, in start
Console(app_options).start()
File "/usr/local/lib/python3.10/site-packages/ropper/console.py", line 184, in start
self.__loadFile(file)
File "/usr/local/lib/python3.10/site-packages/ropper/console.py", line 202, in __loadFile
self.__rs.addFile(file, raw=self.__options.raw,
File "/usr/local/lib/python3.10/site-packages/ropper/service.py", line 526, in addFile
loader = Loader.open(name, bytes=bytes, raw=raw, arch=arch)
File "/usr/local/lib/python3.10/site-packages/ropper/loaders/loader.py", line 182, in open
return subclass(fileName, bytes)
File "/usr/local/lib/python3.10/site-packages/ropper/loaders/pe.py", line 49, in __init__
super(PE, self).__init__(filename, bytes, arch)
File "/usr/local/lib/python3.10/site-packages/ropper/loaders/loader.py", line 82, in __init__
self.__binary = self._loadFile(filename, bytes)
File "/usr/local/lib/python3.10/site-packages/ropper/loaders/pe.py", line 123, in _loadFile
return pe.PE(fileName, bytes)
File "/usr/local/lib/python3.10/site-packages/filebytes/pe.py", line 451, in __init__
self.__dataDirectory = self._parseDataDirectory(self._bytes, self.sections, self.imageNtHeaders)
File "/usr/local/lib/python3.10/site-packages/filebytes/pe.py", line 580, in _parseDataDirectory
loadconfig_data = self._parseLoadConfig(loadconfig_data_directory, loadconfig_section)
File "/usr/local/lib/python3.10/site-packages/filebytes/pe.py", line 678, in _parseLoadConfig
cffEntry = GUARD_CFF_ENTRY.from_buffer(section.raw, sectionOffset)
ValueError: Buffer size too small (35840 instead of at least 35843 bytes)
This is on MacOS, with Python 3.10.7. I have this same issue on Kali with python 3.8. Installed package versions:
ropper 1.13.8 /usr/local/lib/python3.10/site-packages pip
keystone-engine 0.9.2 /usr/local/lib/python3.10/site-packages pip
capstone 4.0.2 /usr/local/lib/python3.10/site-packages pip
filebytes 0.10.2 /usr/local/lib/python3.10/site-packages pip
Hi. This is a different error and, as mentioned before, an error in die lib filetytes not ropper. Could you provide the binary? Then I can check it.