Skip to main content

Dynarmic

A dynamic recompiler for ARM.

Instrumentation caveat

An adversarial guest program can determine if it is running under Dynarmic. Preventing this is not a goal of this project.

Dynarmic supports these guest and host architecture targets:

TargetArchitectures
GuestARM A32 and A64
Hostx86-64, AArch64, RISC-V 64-bit, LoongArch 64-bit

The A32 interface defaults to ARMv8; its ArchVersion enum exposes earlier versions as well. The build includes RISC-V and LoongArch backends, though CMake marks both frontends as incomplete.

See an example usage.

Design documentation can be found at Design.

Alternatives to Dynarmic​

Here are some projects with the same goals as Dynarmic:

  • Unicorn - Recompiling multi-architecture CPU emulator, based on QEMU
  • SkyEye - Cached interpreter for ARM

More general alternatives​

  • tARMac - Tarmac's use of armlets was initial inspiration for us to use an intermediate representation
  • QEMU - Recompiling multi-architecture system emulator
  • VisUAL - Visual ARM UAL emulator intended for education
  • A wide variety of other recompilers, interpreters and emulators can be found embedded in other projects, here are some we would recommend looking at:

Disadvantages of Dynarmic​

In the pursuit of speed, some behavior not commonly depended upon is elided. Hence this emulator doesn't match spec. Note that this would mean that a guest application can easily determine if it's being ran under instrumentation.

Known examples:

  • Only user-mode is emulated, there is no emulation of any other privilege levels.
  • FPSR state is approximate.
  • Misaligned loads/stores are not appropriately trapped in certain cases.
  • Exclusive monitor behavior may not match any known physical processor.

No formal verification has been done, and no security assessment has been made. Use this code base at your own risk.

The vendored Dynarmic build files and many project files are marked GPL-3.0-or-later; some upstream files have their own license headers (for example, 0BSD). Check individual file headers for applicable terms.

Dynarmic also uses open-source libraries; consult their respective license terms.