Skip to content

Instantly share code, notes, and snippets.

@you0708
Created February 20, 2018 14:38
Show Gist options
  • Save you0708/226c4d9131beae7aba85d01c6404d72f to your computer and use it in GitHub Desktop.
Save you0708/226c4d9131beae7aba85d01c6404d72f to your computer and use it in GitHub Desktop.
Bochs Debugging on IDA for macOS

IDA Debugging with Bochs on macOS

This file describes how to debug with Bochs IDB mode on IDA for macOS.

Environment

IDA 7.0 macOS version + Bochs 2.6.9

Install

  1. Install IDA
  2. Download Bochs source code "bochs-2.6.9.tar.gz" from https://sourceforge.net/projects/bochs/files/bochs/2.6.9/
  3. Install Bochs 2.6.9 as below -- You can't use brew to install Bochs due to compile options
$ tar xf bochs-2.6.9.tar.gz && cd bochs-2.6.9
$ ./configure --with-nogui --enable-sb16 --enable-disasm --disable-docbook --enable-x86-64 --enable-pci --enable-all-optimizations --enable-plugins --enable-cdrom --enable-a20-pin --enable-fpu --enable-alignment-check --enable-large-ramfile --disable-readline --enable-iodebug --enable-show-ips --enable-logging --enable-usb --enable-pci --enable-usb-ohci --enable-cpu-level=6 --enable-clgd54xx --enable-avx --enable-vmx=2 --with-term --with-all-libs --enable-debugger
$ make && make install

Note: DO NOT use "--enable-smp" option causes an error (This is a bug of IDA 7.0)

Configuration

dbg_bochs.cfg

You should specify Bochs PATHs as below.

$ diff /Applications/IDA\ Pro\ 7.0/cfg/dbg_bochs.cfg /Applications/IDA\ Pro\ 7.0/ida.app/Contents/MacOS/cfg/dbg_bochs.cfg 
4c4
< // 
---
> //
14a15,17
> BOCHSDBG = "/usr/local/bin/bochs";
> BOCHSRC = "/Applications/IDA Pro 7.0/ida.app/Contents/MacOS/cfg/bochsrc.cfg";
> 
21a25
> DEFAULT_MODE = 2 // IDB mode

bochsrc.cfg

Have to disable ne2k module.

$ diff /Applications/IDA\ Pro\ 7.0/cfg/bochsrc.cfg /Applications/IDA\ Pro\ 7.0/ida.app/Contents/MacOS/cfg/bochsrc.cfg 
28c28
< ne2k: enabled=0
---
> #ne2k: enabled=0
@evandrix
Copy link

cdrom_osx.cc:194:18: error: assigning to 'char *' from incompatible type 'const char *'
  if ((devname = strrchr(devpath, '/')) != NULL) {
                 ^~~~~~~~~~~~~~~~~~~~~

fix: const char *devname;

@evandrix
Copy link

soundosx.cc:50:10: fatal error: 'QuickTime/QuickTimeMusic.h' file not found
#include <QuickTime/QuickTimeMusic.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

fix

@zestysoft
Copy link

soundosx.cc:50:10: fatal error: 'QuickTime/QuickTimeMusic.h' file not found
#include <QuickTime/QuickTimeMusic.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

fix

Any chance you have a fresher link? That fix 404's now. Or do you remember what they did to work around this?

@alex-taffe
Copy link

Did you end up getting this @zestysoft ?

@zestysoft
Copy link

@alex-taffe Unfortunately no.

@linguanostra
Copy link

Had the same issue with macOS 10.4.3, I commented the #include <QuickTime/QuickTimeMusic.h> in the ./iodev/sound/soundosx.cc and it worked.

#include <AudioToolbox/AudioConverter.h>
#include <AudioToolbox/AUGraph.h>
//#include <QuickTime/QuickTimeMusic.h>
#endif

@wtdcode
Copy link

wtdcode commented Aug 19, 2020

Works well with IDA 7.5sp1 and 10.14.6.

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