Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to IDA <= 7.3 and Python 2 #197

Open
HongThatCong opened this issue Jul 28, 2020 · 10 comments
Open

Port to IDA <= 7.3 and Python 2 #197

HongThatCong opened this issue Jul 28, 2020 · 10 comments

Comments

@HongThatCong
Copy link

HongThatCong commented Jul 28, 2020

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
Copy link
Owner

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

@HongThatCong
Copy link
Author

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
Copy link

r0ny123 commented Jul 30, 2020

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
Copy link
Owner

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

@HongThatCong
Copy link
Author

HongThatCong commented Jul 30, 2020

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
Copy link

r0ny123 commented Jul 30, 2020

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
Copy link
Author

Thanks @r0ny123

@joxeankoret
Copy link
Owner

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
Copy link
Author

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

@HongThatCong
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants