Pandora VM
Pandora VM is a software protection and code virtualization project inspired by tools such as VMProtect. It is designed to help protect applications from unauthorized analysis and modification.
From source to protected execution
Annotated functions are lowered through a compiler-owned intermediate representation before they become authenticated VM images.
Three-level IR architecture
Pandora separates LLVM lowering, VM-neutral optimization, and machine-specific finalization into distinct IR layers. The compiler pipeline is intentionally closed: unsupported input fails during lowering or verification instead of falling back to an unprotected native function.
| Layer | Role | Backend contract |
|---|---|---|
| HighIR | LLVM-independent semantic IR that still preserves SSA, CFG, abstract memory, imports, and type-sensitive operations. | Not consumed directly by VM backends; it is a compiler-side normalization boundary. |
| MidIR | Verified, backend-neutral optimization IR used after semantic lowering and Pandora IR passes. | General-purpose VM backends can finalize this layer into their own instruction format and image container. |
| LowIR | Machine-level IR for lower-level execution models; it removes virtual-register opcodes and models explicit machine state. | Specialized backends can target this layer when they need a lower-level machine model. |
This makes the VM backend replaceable. A customer can add a private backend by registering a backend descriptor, choosing the IR level it consumes, implementing finalization into its image format, and providing the runtime bridge entry used by the protected wrapper. Existing backends include stack, window-register, turing, and dataflow models.
LLVM IR hardening
Pandora can also harden native code that stays outside a VM. The combined
pandora-ir-harden pipeline splits basic blocks with opaque
predicates, seals direct calls, builds an encrypted continuation dispatcher,
and lowers remaining branches through memory-backed predicates and
indirectbr target islands.
Additional standalone passes cover indirect calls and branches, constant encoding, return scattering, self-modifying native code, and light, strong, or ultra anti-debug instrumentation.
Passes and transformations
Indirect calls and branches
Before
After
Constant encoding
Before
After
Return scattering
Before
After
Self-modifying jumps
Before
After
Anti-debug instrumentation
Before
After
Real VM nesting
A backend chain creates actual nested images. Each layer keeps a separate instruction format, private state, validation policy, and key boundary.
Three execution models
The backends do not share an instruction format or execution state. Each one uses a different machine model so a single analysis strategy does not transfer directly across every protected image.
Demo binary
HMAC demo binaries are available for Linux and Windows. The Linux build is the primary demo target: hmac_demo-linux.
A Windows build is also available, but Windows support is still experimental and may be less complete than the Linux build: hmac_demo.exe.