For the complete documentation index, see llms.txt. This page is also available as Markdown.

Bochs

Bochs is an open source x86 PC emulator. It emulates the CPU, memory, and devices of a full PC, so the code runs on an emulated machine and not on your host. IDA includes a Bochs debugger that controls Bochs through its internal debugger. In PE mode, IDA loads a Windows PE file into Bochs with a minimal Windows kernel. Calls to the Windows API go to stubs, which return 0 or call a handler that you can write. The debugger also has an IDB mode, which runs code from the database, and a disk image mode, which boots a Bochs disk image. For breakpoints, watchpoints, and other limits, see the Bochs debugger FAQ.

IDA does not include Bochs itself. Usually you must download and install Bochs, and on Linux and macOS you must also supply the Windows system DLLs for PE mode, as described in Using the Bochs debugger plugin in Linux.

ida-bochs-binaries

The add-on includes the open source ida-bochs-binaries plugin, so IDA's Bochs debugger works with no more setup. The plugin is available for free in the IDA plugin repository, so you can also use it without the add-on:

hcli plugin install ida-bochs-binaries

The plugin contains a Bochs 2.8 build for each supported platform, with the BIOS ROM files. When IDA starts, the plugin sets BXSHARE so that IDA finds this build. If you already set BXSHARE, the plugin does not change it.

On Linux and macOS, the plugin also supplies stub versions of 14 Windows system DLLs, such as ntdll, kernel32, and ws2_32, for 32-bit and 64-bit PE files. The stubs contain only export tables, which is all that PE mode reads, and no Windows or Wine code. They match the DLLs that the default PE mode startup script declares as stub, as described in Bochs PE operation mode. When you open a database, the plugin sets IDABXPATHMAP to map the stubs to c:\windows\system32\ in the guest. On Windows, IDA uses the real system DLLs. The plugin does not change PATH or the IDA configuration files.

The Bochs binaries are available for Windows x86-64, Windows ARM64, Linux x86-64, Linux AArch64, and macOS on Apple silicon.

Bochs and the stub DLLs are licensed under the LGPL-2.1-or-later. The export lists for the stubs come from the Wine 9.0 .spec files. The source is at github.com/HexRaysSA/ida-bochs-binaries, with Bochs as a submodule.

How the add-on uses Bochs

Bochs is the default backend for automated unpacking. When default_debugger is bochs, the unpacker runs the sample in IDA's Bochs debugger and runs its heuristics on the emulated process.

You can also use Bochs directly. Select Debugger > Select debugger > Local Bochs debugger, and then start the process as usual. For one-click emulation with a more complete Windows environment, see isolated system emulation, which uses Sogen or Speakeasy.

Last updated

Was this helpful?