FernandoDoming / r2diaphora

Port of the binary diffing library, diaphora, for radare2 and mariadb
GNU Affero General Public License v3.0
46 stars 1 forks source link

RCore' object has no attribute '_r_core_free' #6

Closed Ret2c7 closed 9 months ago

Ret2c7 commented 9 months ago

when i try r2diaphora /bin/ls

Has there been a change in r2pipe, while the corresponding part in the project has not been updated yet?

2024-01-10 06:54:26,142 [INFO] - Generating database 1e39354a6e481dac48375bfebb126fd96aed4e23bab3c53ed6ecf1c5e4d5736d for file /bin/ls
Traceback (most recent call last):
  File "/usr/local/bin/r2diaphora", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/r2diaphora/diaphora_r2.py", line 1140, in main
    generate_db_for_file(
  File "/usr/local/lib/python3.8/dist-packages/r2diaphora/diaphora_r2.py", line 1037, in generate_db_for_file
    _gen_diaphora_db(
  File "/usr/local/lib/python3.8/dist-packages/r2diaphora/diaphora_r2.py", line 1015, in _gen_diaphora_db
    r2_open(input_path)
  File "/usr/local/lib/python3.8/dist-packages/r2diaphora/idaapi/idaapi_to_r2.py", line 640, in r2_open
    r2.cmd("e log.level=0")
  File "/usr/local/lib/python3.8/dist-packages/r2pipe/open_base.py", line 252, in cmd
    res = self._cmd(cmd, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/r2pipe/open_base.py", line 202, in _cmd_native
    self.native.cmd_str("o " + self.uri)
  File "/usr/local/lib/python3.8/dist-packages/r2pipe/native.py", line 129, in cmd_str
    return self._r_core_cmd_str(self._o, cmd)
AttributeError: 'RCore' object has no attribute '_r_core_cmd_str'
Exception ignored in: <function RCore.__del__ at 0x7fdb4de8b040>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/r2pipe/native.py", line 127, in __del__
AttributeError: 'RCore' object has no attribute '_r_core_free'
FernandoDoming commented 9 months ago

The trace indicates that the exception is being produced when executing the command e log.level=0 (the first r2 command executed in r2diaphora) because it can not find the symbol _r_core_cmd_str in RCore. I doubt this has anything to do with r2diaphora and as such I can not do much from my end. My guess is that the bug is either in the radare's core .so or in r2pipe.