joxeankoret/diaphora

Port to IDA <= 7.3 and Python 2

HongThatCong opened this issue · 10 comments

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 !

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

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

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.

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

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

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.

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.

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

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