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.87k stars 206 forks source link

"TypeError: underlying buffer is not writable" when loading named ELF file #128

Closed ntauth closed 4 years ago

ntauth commented 4 years ago

File "ropgen.py", line 58, in main rs.addFile(MAIN_BINARY_ID, bytes=handle.read()) File "/usr/local/lib/python3.7/dist-packages/ropper/service.py", line 514, in addFile loader = Loader.open(name, bytes=bytes, raw=raw, arch=arch) File "/usr/local/lib/python3.7/dist-packages/ropper/loaders/loader.py", line 178, in open return subclass(fileName, bytes) File "/usr/local/lib/python3.7/dist-packages/ropper/loaders/elf.py", line 45, in init super(ELF, self).init(filename, bytes, arch) File "/usr/local/lib/python3.7/dist-packages/ropper/loaders/loader.py", line 82, in init self.binary = self._loadFile(filename, bytes) File "/usr/local/lib/python3.7/dist-packages/ropper/loaders/elf.py", line 131, in _loadFile return elf.ELF(fileName, bytes) File "/usr/local/lib/python3.7/dist-packages/filebytes/elf.py", line 844, in init self.elfHeader = self._parseElfHeader(self._bytes) File "/usr/local/lib/python3.7/dist-packages/filebytes/elf.py", line 900, in _parseElfHeader ehdr = self.__classes.EHDR.from_buffer(data) TypeError: underlying buffer is not writable

sashs commented 4 years ago

Hi.

Please update the filebytes dependency. This bug is fixed there.

ntauth commented 4 years ago

Thank you, that was exactly the issue.