Program-Scale Neural Decompilation with Deterministic Data Reconstruction
Loading...
Date
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
DOI
Abstract
Decompilation, the process of recovering source code from binary executables, is crucial for software analysis when original sources are unavailable. However, rule-based decompilers are costly to develop, hard to scale, and often yield unreadable output. While neural decompilers have shown promise in reducing manual engineering effort and improving code readability, their real-world applicability remains limited. Existing methods handle isolated functions or small code snippets, struggling with inter-function dependencies and data recovery.
This thesis introduces an end-to-end neural decompilation approach for reconstructing human-readable C code from binaries at program scale. Input size is minimized by feeding only the .text section to the neural network and by bypassing disassembly, while deterministic tasks, such as literal decoding and address resolution, are offloaded to a subsequent reconstruction phase that leverages the remaining binary sections. This hybrid design is enabled by a semantics-preserving standardization pipeline that normalizes C source code and a reversible transformation that aligns source and machine code at the byte level. To enable the model to distinguish instruction opcodes from their operands, tokenization is performed byte-wise using an opcode-aware vocabulary.
A proof-of-concept implementation using a lightweight encoder-decoder transformer shows that the target representation can be learned sufficiently to enable exact deterministic recovery of literals and symbols. While robust full-program structure recovery requires larger datasets and more capable models, the results indicate that separating probabilistic structure inference from deterministic data reconstruction is a promising path toward program-scale neural decompilation.
