joxeankoret / diaphora

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

Port to IDA <= 7.3 and Python 2 #197

Open HongThatCong opened 4 years ago

HongThatCong commented 4 years ago

My friend and I have successfully ported and checked carefully with your version of Diaphora v2.04. It runs fine. Can we public on our github? Thank you for good work !

joxeankoret commented 4 years ago

Of course you can! Go ahead, and then please send me the URL so I can link to it somewhere.

HongThatCong commented 4 years ago

I uploaded at: https://github.com/HongThatCong/diaphora_py2 If you have time, you can check it out and give us advice. Thank and best regards, HTC

r0ny123 commented 4 years ago

My friend and I have successfully ported and checked carefully with your version of Diaphora v2.04. It runs fine. Can we public on our github? Thank you for good work !

You mean Diaphora v2.02, right? And I tested this https://github.com/HongThatCong/diaphora_py2 on IDA 7.0 but it failed to export the databases correctly, then I cross checked, and exported using @joxeankoret's old fork for diaphora, it worked fine.

Thanks for the hard work, attaching the logged error below:

[Thu Jul 30 11:52:34 2020] Loading project specific Python script...
[Thu Jul 30 11:52:34 2020] Creating crash file C:\Users\Rony\Desktop\7dc58ff4389301a6eccc37098682742b96e5171d908acdeb62aeaa787496c80a.sqlite-crash...
Traceback (most recent call last):
  File "C:/Users/Rony/Desktop/diaphora_py2-master\diaphora_ida.py", line 878, in export
    self.do_export(crashed_before)
  File "C:/Users/Rony/Desktop/diaphora_py2-master\diaphora_ida.py", line 832, in do_export
    props = self.read_function(func)
  File "C:/Users/Rony/Desktop/diaphora_py2-master\diaphora_ida.py", line 1700, in read_function
    str_constant = get_strlit_contents(dref, -1, -1)
  File "C:\Program Files\IDA 7.0\python\ida_bytes.py", line 2087, in get_strlit_contents
    return _ida_bytes.get_strlit_contents(*args)
OverflowError: in method 'get_strlit_contents', argument 2 of type 'size_t'
[Thu Jul 30 11:52:35 2020] Removing crash file C:\Users\Rony\Desktop\7dc58ff4389301a6eccc37098682742b96e5171d908acdeb62aeaa787496c80a.sqlite-crash...
[Thu Jul 30 11:52:35 2020] Database exported. Took 2.1779999733 seconds.
joxeankoret commented 4 years ago

@HongThatCong You should probably specify the exact versions you tested it with.

HongThatCong commented 4 years ago

Sorry Joxean Koret, the exact version is VERSION_VALUE = "2.0.4", in your source code, diaphora.py. We have tested with IDA 7.0, 7.2 and 7.3. To r0ny123: you can replace: str_constant = get_strlit_contents(dref, -1, -1) To: str_constant = idc.get_strlit_contents(dref) And retest it Thanks and best regards

r0ny123 commented 4 years ago

Ah now I understood, @joxeankoret never released a version with 2.0.4 on releases page :D and @HongThatCong thanks for the patch, it worked! Maybe you can push an update on that repo.

HongThatCong commented 4 years ago

Thanks @r0ny123

joxeankoret commented 3 years ago

You might want to take a look to the changes I have made with the latest release, which is mostly bug fixes. Actually, if you're maintaining that port, I will link to it in README.md.

HongThatCong commented 3 years ago

Yes, @joxeankoret I will update with your new code Thanks

HongThatCong commented 3 years ago

Hi @joxeankoret I have updated my port with your new code v2.0.5. If you have time, can you test it Thanks and best regards HTC