Vector35 / dwarf_import

This loads DWARF info from an open binary and propagates function names, arguments, and type info
MIT License
24 stars 7 forks source link

TypeError: BinaryReader.seek() takes 2 positional arguments but 3 were given #18

Closed SWW13 closed 2 years ago

SWW13 commented 2 years ago
Traceback (most recent call last):
  File "/opt/binaryninja/plugins/../python/binaryninja/plugin.py", line 229, in _default_is_valid
    return is_valid(view_obj)
  File "/home/user/.binaryninja/repositories/official/plugins/Vector35_dwarf_import/__init__.py", line 86, in is_valid
    return raw and elf and ELFFile(bn.binaryview.BinaryReader(bv.file.raw)).has_dwarf_info()
  File "/home/user/.binaryninja/python310/site-packages/elftools/elf/elffile.py", line 81, in __init__
    self.stream.seek(0, io.SEEK_END)
TypeError: BinaryReader.seek() takes 2 positional arguments but 3 were given

Binary Ninja Version: 3.1.3469 Personal, 93650e26 Platform: Arch Linux

ElykDeer commented 2 years ago

Could you please tell me what version of pyelftools you have installed?

SWW13 commented 2 years ago

extra/python-pyelftools 0.28-1

Mrmaxmeier commented 2 years ago

The relevant pyelftools code was added in this commit and binaryview.BinaryReader is missing both support for seek's whence argument as well as tell. There's a few other functions in Python's IOBase that are not implemented by BinaryReader, but not implementing those is probably fine ^^

SWW13 commented 2 years ago

Turns out BinaryNinja installs it's own Python packages with out any versioning in .binaryninja/python310/site-packages/ and was using 0.29. Removing the package allows the usage of the system package, then I run into #14.

Is this "official" plugin even maintained?

ElykDeer commented 2 years ago

This should be resolved in v1.1.2, which you can now get from the plugin manager.