arXiv:2610.29566cs.CROct 2026

Manuscript Offprint

arXiv:2610.29566

VMSpec: A Decompiler-based Approach against Virtual Machine Obfuscation

Fabian Kilger, Leonard Auer, Manuel Andreas

Abstract

Malicious actors frequently obfuscate their code to hinder investigative reverse engineering efforts. Among the most formidable techniques is virtual machine (VM) obfuscation: programs are translated into bytecode for a custom VM, often with a randomized virtual instruction set and distributed alongside a corresponding interpreter.

Manual analysis and deobfuscation scale poorly due to the complexity of VM obfuscation and the diversification techniques that render each VM and interpreter unique. Existing methods primarily focus on simplifying execution traces and identifying virtual execution boundaries. However, comparatively little attention has been given to recovering higher-level program semantics from VM-obfuscated code. To address this gap, we propose VMSpec, a novel decompiler-based approach that automates the construction of VM processor specifications, enabling existing, well-known decompilers to analyze the VM-obfuscated code.

We evaluate our prototype of VMSpec on 147 programs from an established obfuscation benchmark, comprising hash functions, standard algorithms, and randomized functions, obfuscated with different configurations of the Tigress and Code Virtualizer obfuscators. To demonstrate real-world applicability, we additionally include six domain generation algorithms stemming from real-world malware. VMSpec completely strips VM-obfuscation from nearly all obfuscated samples, producing output comparable to Ghidra's decompilation of the original code. Furthermore, it is the first method capable of reconstructing the complete program behavior of VM-obfuscated programs with infinite, input-dependent paths and recursive calls.

1 Introduction

Program authors obfuscate their software to thwart reverse engineering and other forms of program analysis. While obfuscation can serve legitimate purposes – such as protecting intellectual property or reducing fraud – it is especially attractive for malware authors seeking to evade detection and analysis. Among the various obfuscation techniques, virtualization-based obfuscation is widely considered one of the strongest techniques available [20]. Here, the original program is translated into bytecode for a custom virtual machine (VM), which is then embedded, together with a bytecode interpreter, into the obfuscated program. The meaning of individual bytecode instructions is therefore encoded solely in the interpreter, thereby forcing human analysts to first reverse-engineer the interpreter before they can reason about the behavior of the embedded bytecode. Moreover, to hinder knowledge reuse, commercial obfuscators [10, 32, 33, 50] generate distinct virtual machine architectures, instruction sets, and interpreters by employing various diversification techniques [53].

Many techniques have been proposed to deobfuscate virtualization-based obfuscated programs [20] and obfuscated software in general [39]. Current state-of-the-art methods against virtualization-based obfuscation primarily rely on instruction traces collected during execution of the obfuscated program. These methods analyze and simplify runtime traces either directly [11, 37, 47, 51, 52] or first identify VM handlers, which then serve as an anchor point for trace simplification [6, 9, 18, 23, 35]. However, dynamic tracing approaches are inherently limited to the code path taken during a given run, thereby limiting the analysis of program behavior to the specific inputs provided. While prior work [37, 47, 52] proposes overcoming this problem using path exploration algorithms, they cannot guarantee exhaustive path coverage and remain constrained by the path explosion problem, which renders them infeasible for more complex programs. Furthermore, studies [30, 31] show that attackers can craft strong and robust primitives to explode the number of paths. Consequently, dynamic tracing approaches are unable to recover the complete behavior of virtualization-based obfuscated programs.

Towards automated extraction of the complete program behavior, prior works proposed methods for identifying state variables [40], VM boundaries [51], and handler boundaries [6, 40, 51]. To extract handler behavior, symbolic execution combined with compiler optimizations [23] and program synthesis [6, 27] has been proposed. However, the extracted handler behavior is incomplete since the analysis is restricted to single handler traces and ignores control flow.

To address these shortcomings, we propose VMSpec, a novel method that automates the generation of SLEIGH processor specifications [42] for unknown VMs, thereby enabling analysts to leverage existing decompilers and analysis frameworks. As such, VMSpec can produce a semantically complete decompilation of the obfuscated program.

Given a description of the VM state, we apply dynamic symbolic execution (DSE) to recover the behavior and encoding of VM instructions. To enable complete and efficient analysis of handler behavior in the presence of symbolic addresses, we introduce a custom memory model. While DSE is susceptible to path explosion and complex constraints, bytecode handlers contain relatively little logic, making these problems simpler to mitigate.

We evaluate the semantic correctness and quality of our decompilation output against a benchmark of 147 programs consisting of hash functions, standardized algorithms, and randomized functions used in prior work [4, 20, 53]. To demonstrate VMSpec's real-world applicability, we further include six command-and-control server domain generation algorithms (DGAs) extracted from real-world malware.

Evaluating several configurations of the Tigress [10] obfuscator and Code Virtualizer [32] obfuscator, we find that VMSpec recovers decompiled code that is semantically correct and comparable to the decompilation of the unobfuscated samples. In particular, VMSpec is the first approach to demonstrate complete reconstruction of program behavior on samples with more complicated control flow, such as input-dependent loops that typically lead to path explosion.

In summary, we make the following main contributions:

• We present VMSpec, a decompiler-based approach against VM obfuscation, that applies DSE to automate the analysis of bytecode handlers and generates instruction encodings and behavior in the SLEIGH language.

• VMSpec enables existing decompilers and analysis frameworks to recover high-level program behavior from VM-obfuscated binaries.

• VMSpec is the first approach that can reconstruct the complete behavior of VM-obfuscated programs with infinite, input-dependent paths and recursive calls.

• A prototype of VMSpec, which we open-source upon publication in conference proceedings.

References (40)