ajkhoury / SigMaker-x64

IDA Pro 7 compatible SigMaker plugin
535 stars 88 forks source link

How to build plugins for Win32 platform? #34

Closed RyderFL closed 2 years ago

RyderFL commented 2 years ago

First of all, i am very sorry. it's actually not an issus about this plugin.

I am using this ida sdk on Windows with VS2019. And writed a simple plugin. I can build for x64 platform. and it works.

But for x86 platform, the compiler tells "error LNK2001: unresolved external symbol _qgetenv@8". The compiler added a "_" and "@8" to the function qgetenv. I checked that there is an export "qgetenv" in \x64_win_vc_32\ida.lib.

the declare of function in idasdk is: extern "C" bool __stdcall qgetenv(const char varname, DEFARG(qstring buf,NULL));

i googled, it means "_" and "@" is added by stdcall. I tried cdecl, but the external symbol changed to "_qgetenv".

Could you help me about this ? Thanks a lot

ajkhoury commented 2 years ago

x86 plugins are not supported by IDA Pro since version 7.0. You're trying to link an 64-bit library in an 32-bit binary, which symbol mangling is different between the two target architectures, that's why you're getting that error.

RyderFL commented 2 years ago

Thanks. It's means x64_win_vc_32 is also for x64 platform but 32bit visual studio. That right? If so, how to support ida.exe(not ida64.exe)? I found many plugins for ida.exe under plugins folder.

RyderFL commented 2 years ago

Thanks again. I found the answer. Just build a x64 plugin link with x64_win_vc_32\ida.lib.