joxeankoret / diaphora

Diaphora, the most advanced Free and Open Source program diffing tool.
http://diaphora.re
GNU Affero General Public License v3.0
3.51k stars 370 forks source link

Diaphora directory naming can conflict with IDA API #261

Closed crimsonskylark closed 1 year ago

crimsonskylark commented 1 year ago

The following lines can cause issue with some IDA Pro setups (I'm on 7.7) because the IDA Pro also has a python module named database at %APPDATA%\Hex-Rays\IDA Pro\base\database.py

https://github.com/joxeankoret/diaphora/blob/94a224fa2ce1c379a37b71ba02fa3954d922e89e/diaphora.py#L55-L58

This is the error message returned when attempting to load the file:

diaphora\diaphora.py: cannot import name 'schema' from 'database' (AppData\Roaming\Hex-Rays\IDA Pro\base\database.py)
Traceback (most recent call last):
  File "python\3\ida_idaapi.py", line 580, in IDAPython_ExecScript
    exec(code, g)
  File "diaphora/diaphora.py", line 58, in <module>
    from database import schema
ImportError: cannot import name 'schema' from 'database' (\AppData\Roaming\Hex-Rays\IDA Pro\base\database.py)

Renaming diaphora/database to diaphora/diaphora_database and making the necessary changes to diaphora.py completely resolves the issue.

joxeankoret commented 1 year ago

Thank you for reporting!