05 Mar

Qt 4.8.4 on Windows for IDA Pro C/C++ plug-in development – Part 1 of 3

(Note this an advanced article.  It assumes you know advanced C++, IDA Pro and it’s plug-in environment, etc).

Now that IDA Pro has completely moved to Qt for it’s user interface you can really expand on it to make your own custom Qt user interfaces in IDA.  You’re not locked in to using just IDA’s varied but basic UI system.

If you want to use Python for IDA there is already a featured setup using PySide but then maybe you want to use Qt from IDA’s C/C++ plug-in SDK (for speed and resource control, etc.)

The development environment for IDA Qt is version 4.8.4 and Visual Studio 2010.
You can clearly see this looking at the DLLs in the IDA Pro folder:DLL image showing Qt 4.8.4

DLL image showing Visual Studio 2010

But then who wants to use 2010 when you already have VS2013 or later (2015 is in beta as I write this)?
You can have both installed of course, but the right way is to install the oldest one you need first, then on to the latest .
If you don’t do it this way you will probably get stuck with environment variables from the old or end up with something else messed up.

You can actually use VS2013 to make Qt UI’s just fine as I do.
After all the Qt import libraries are already there for us in the IDA SDK folder “\lib\x86_win_qt”.
We are mainly going to use a Qt 4.8.4 install for the needed “\4.8.4\include” includes,  and a few executables like the “Qt designer”, some of the build tools, and maybe the Qt resource compiler all located in the “\4.8.4\bin” folder.

You don’t have too and you probably won’t want to build Qt to VS2013 (if even possible), you just won’t be able to build full-on Qt 4.8.4 applications with this setup.

1) First go get the binary build of Qt 4.8.4 here (234mb):
http://download.qt.io/archive/qt/4.8/4.8.4/qt-win-opensource-4.8.4-vs2010.exe

2) Install it. Typically it will go to “C:\Qt”.
Do not build, just install it.

3) Bring up your start menu down to “Qt by Digia v4.8.4..” and open a “Qt 4.8.4 Command Prompt”.

4) In the IDA setup the QT namespace environment is used to avoid a few conflicts in the IDA SDK with colliding functions like qstrlen(), etc.
Run in this console:
configure -debug-and-release -platform win32-msvc2010 -no-qt3support -qtnamespace QT
Choose the ‘o’ open source option and ‘y’ to the license agreement to complete the process.

That’s all you need to do now.  You could run “nmake” to build but you don’t need and probably don’t want to.
It would take several hours to rebuild the whole thing and the folder would grow to several gigabytes in size.  Just close the console and your done for now.

Go to part 2

On topic:
Hex Blog: IDA Pro, Python and Qt
Hex Blog: IDA & Qt: Under the hood
https://wiki.python.org/moin/PyQt

3 thoughts on “Qt 4.8.4 on Windows for IDA Pro C/C++ plug-in development – Part 1 of 3

  1. Good point, I’m sure it would build faster.
    The thing is you don’t need to build it at all since it’s just using
    the import libraries for the Qt DLLs from your IDA Pro folder.
    And if even if you do build it, the 4.8.4 Visual Studio extension still won’t work in VS2013.

    Note another downside with this setup, you can’t make stand alone 4.8.4 Qt applications with this setup since the 2010 “qtmain.lib” is incompatible with 2013.

    Ideally you would use VS2010 to build your plug-ins so it would all be compatible.
    Also you should be able to have both installed if you install 2010 first then 2013 after.
    But might take some kind of environment variable switching to make it work right.

    Why I’m making this guide, to show people an easy way to make Qt UI plug-ins with a minimal amount of fuss.

  2. Pingback: Private: Qt 5.4 User Interfaces for IDA Pro C/C++ plug-in development – Part 2 of 2 | Macromonkey

Leave a Reply