Skip to content

Instantly share code, notes, and snippets.

@yrp604
Last active December 27, 2017 19:49
Show Gist options
  • Save yrp604/1d38ae60ab39d442b40e499f6ba2af40 to your computer and use it in GitHub Desktop.
Save yrp604/1d38ae60ab39d442b40e499f6ba2af40 to your computer and use it in GitHub Desktop.
IDA 6.95 SDK on macOS 10.12

Instructions for compiling the IDA 6.95 SDK on macOS 10.12 with Xcode 8

I have no idea if this is the best way to do this (is it really required to compile QT?) but it works for me. This is also reconstructed from the history of a few terminal windows, so it's entirely possible I'm forgetting something.

Start by following the install_linux.txt instructions. You'll need to copy libida.dylib and libida64.dylib into bin in the SDK root. Additionally, that bin directory should be in you PATH. Finally make bin/idamake.pl executable. All of these is covered in the SDK docs.

The first hurdle you'll run into: the IDA SDK build cannot find the macOS SDK. You can easily fix this with MACSDK=`xcrun --sdk macosx --show-sdk-path` .

For example:

$ __MAC__=1 __EA64__=1 MACSDK=`xcrun --sdk macosx --show-sdk-path` bin/idamake.pl

The second hurdle you'll come across is a missing file named qcp.sh. If we look in allmake.unx you'll see a reference to it on macOS. I just replaced this with rsync -u, which someone on StackOverflow said would work. It seems to. Other people here have described using gnu coreutils from a package manager alternatively.

Now you get to build QT. As described here, you need to download and patch QT. However, you also need to apply this patch as well to build on 10.12. Finally, you need to replace code in mkspecs/features/mac/default_pre.prf and configure. Specifically:

/usr/bin/xcrun -find xcrun 2>/dev/null

needs to be patched to:

/usr/bin/xcrun -find xcodebuild 2>/dev/null

Otherwise it incorrectly complains about a lack of valid Xcode license.

Once QT is built (which takes forever), you need to move some files into the appropriate location. The following works, but I'm there must be a better way to do this, as this is really ugly.

The IDA SDK build requires these four libs:

QtCore.framework    QtGui.framework     QtWidgets.framework QtXml.framework

these three include directories:

QtCore      QtGui       QtWidgets

and bin from your QT build.

The libs come from your IDA install and can just be linked. However, the headers I ended up copying from my QT install: lib/Qt{Core,Gui,Widgets}.framework/Versions/5/Headers.

IDA expects these files in /Users/Shared/Qt/5.6.0/{bin,include,lib}.

Lastly, qwindow.pmc64 will fail to compile. This is just missing "$(PREF)QtWidgets.framework/QtWidgets" entry in ADDITIONAL_LIBS around line 35 (in the __MAC__ ifdef).

With all this done, you should now be able to compile IDA modules. I hope this saves someone some time. If you run into problems, I doubt I'll be much help unless it's something I did and forgot about when writing this up, however you're still welcome to hit me up on twitter or irc (@yrp604, yrp).

Resources:

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