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

idb2pat.py issue on IDA 7.5 #104

Open
KulaGGin opened this issue Apr 13, 2021 · 1 comment
Open

idb2pat.py issue on IDA 7.5 #104

KulaGGin opened this issue Apr 13, 2021 · 1 comment

Comments

@KulaGGin
Copy link
Contributor

KulaGGin commented Apr 13, 2021

If you run idb2pat.py on IDA version 7.5, you'll get this error:

 error: Traceback (most recent call last):
  File "<string>", line 478, in <module>
  File "<string>", line 455, in main
  File "<string>", line 416, in get_pat_file
NameError: global name 'askfile_c' is not defined

Which is caused by newer version of IDA and renaming of the askfile_c member to ask_file in the ida_kernwin type, as explained in this porting guide by hex-rays.

There are many more errors like this one for many members in different types.

One possible solution I see is to have 2 versions of the file now: idb2pat.py and idb2pat_74plus.py for appropriate IDA version.

After updating the file and changing names for all the members(which changed names), I was able to succesfully generate .sig file for a simple test Hello World VC++ solution for Windows from a version with .pdb loaded for the same executable without the .pdb loaded:

#include <iostream>

void PrintHelloWorld()
{
    std::cout << "Hello World!\n";
}

int main()
{
    PrintHelloWorld();
}
@mr-tz
Copy link
Contributor

mr-tz commented Apr 14, 2021

I think idaapi.ask_file works in all versions and we can just replace this API call.
Alternatively, we could check the IDA version and pick the appropriate API.

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

No branches or pull requests

2 participants