ReF Decompile is an end-to-end decompilation framework that uses Relabeling and Function Call strategies to preserve control-flow and accurately recover literal data.
It employs symbolic relabeling to replace concrete addresses with abstract labels, ensuring precise reconstruction of the binary's control-flow graph.
Empirical evaluations show that ReF Decompile improves re-executability by over 8 percentage points compared to prior LLM-based decompilers, demonstrating its practical impact.
ReF Decompile is an end-to-end decompilation framework designed to convert binary executables into high-level language code while maintaining control-flow fidelity and correctly recovering literal data such as strings and floating-point values. By addressing critical information loss inherent in prior LLM-based decompilers, ReF Decompile achieves state-of-the-art re-executability on standard benchmarks, reinforcing its utility in reverse engineering, vulnerability discovery, malware analysis, and legacy software migration (Feng et al., 17 Feb 2025).
1. Core Innovations: Relabeling and Function Call Strategies
ReF Decompile fundamentally augments LLM-based decompilation by introducing two key innovationsāthe Relabeling strategy and the Function Call strategy.
Relabeling Strategy:
Raw disassemblies from tools like objdump or Capstone provide instructions annotated with concrete addresses. Such addresses often encode jump targets (branch destinations) and static data references, but are contextually opaque to machine learning models. The Relabeling step abstracts away all concrete addresses, replacing:
Jump targets with symbolic labels (ĻJā: JāL, with L={L1ā,L2ā,ā¦}), ensuring that every control-flow edge in the original binary is preserved exactly in the symbolic assembly.
Data addresses in memory loads/stores with symbolic data labels (ĻDā: DāM, with M={D1ā,D2ā,ā¦}), enabling later recovery of concrete literals.
The result is a sequence Sā² where explicit āLiāā and āDjāā replace all address references, dramatically improving reproducibility of the control-flow graph (CFG). Just before the instruction at the original address a, a directive āLiā:āisinserted,whichpreservespreciseCFGstructureintherelabeledassembly.</p><p><strong>FunctionCallStrategy:</strong></p><p>Absentaddressdataintheprompt,LLMscannotrecoveraccuratefloatingāpoint,integer,orstringliteralsfrom.rodataorotherstaticsegments.ReFDecompileembedsstructuredtoolācallrequestsinthedecodingprocess.WhenthemodelrequiresthevaluecorrespondingtoalabelD_iandinfersatype\tau,itemits:!!!!0!!!!Anexternalruntimeinterceptsthisrequest,looksupD_iusing\phi_D,readstheappropriaterawbytes,decodesthemaccordingto\tau,andreturns!!!!1!!!!totheprompt.Thistightintegrationenablespreciseliteralandconstantrecovery,supportingsemanticallyfaithfulreconstruction(<ahref="/papers/2502.12221"title=""rel="nofollow"dataāturbo="false"class="assistantālink"xādataxātooltip.raw="">Fengetal.,17Feb2025</a>).</p><h2class=ā²paperāheadingā²id=ā²formalāworkflowāandātransformationārulesā²>2.FormalWorkflowandTransformationRules</h2><p>TheReFDecompilepipelineconsistsofthefollowingstages:</p><ol><li><strong>Disassembly:</strong>ExtractthesequenceS = \langle s_1, s_2, \ldots, s_n \rangleofrawinstructions,eachwithaddressa_i.</li><li><strong>Relabeling(R):</strong>Applythemappings\phi_Jand\phi_DtoreplacetargetaddressesandstaticdatareferencesinS,resultinginS'withsymboliclabels.Foranys_icontainingajumporbranchtoa \in J,replacewithjmp\, \phi_J(a),and,fora \in D,replacewith\phi_D(a)(\%rip).</li><li><strong>PromptConstructionandLLMDecoding:</strong>PresentS'totheLLM.WhenthemodelneedsthevalueforaD_jlabel,itissuesTOOLCāALL,receivesVALUE(D_j)=vintothegenerationcontext.</li><li><strong>SourceEmission:</strong>TheLLMproducesthefinalhighālevelCcode,fullyannotatedwiththecorrectlyresolvedcontrolflowanddata.</li></ol><p>Thesetransformationsaredesignedtobeinvertible;givenS'andthemappingtables,itispossibletoreconstructtheoriginalbinarystructureprecisely(<ahref="/papers/2502.12221"title=""rel="nofollow"dataāturbo="false"class="assistantālink"xādataxātooltip.raw="">Fengetal.,17Feb2025</a>).</p><h2class=ā²paperāheadingā²id=ā²empiricalāevaluationāandāsotaāperformanceā²>3.EmpiricalEvaluationandSOTAPerformance</h2><p>ReFDecompilewasvalidatedonthe<ahref="https://www.emergentmind.com/topics/decompileāeval"title=""rel="nofollow"dataāturbo="false"class="assistantālink"xādataxātooltip.raw="">DecompileāEval</a>(adaptedHumanEval)benchmark,encompassing164Ctasksacrossfouroptimizationlevels(O0āO3),usinga6.7BāparameterLLM4DecompileāEndbackbonefineātunedvia<ahref="https://www.emergentmind.com/topics/parameterāefficientāadaptationālora"title=""rel="nofollow"dataāturbo="false"class="assistantālink"xādataxātooltip.raw="">LoRA</a>(rank32,\alpha=64$). Resultsāaveraged over all compiler optimizationsādemonstrate:
ReF Decompile delivers a +8.69 percentage point improvement over the next best refinement-based LLM system and a substantial readability increment. All experiments use the re-executability metric: the percentage of decompiled outputs that not only recompile, but also pass the original functional test suite (Feng et al., 17 Feb 2025).
Ablation confirms both Relabeling and Function Call components contribute, individually and synergistically:
Relabeling only: +3pp in re-exec.
Function Call only: +7pp in re-exec.
Combined: +8.08pp in re-exec, +0.19 in readability.
4. Comparison with Prior Techniques and Complementarity
Early LLM-based decompilers (e.g., LLM4Decompile-End/Ref, FAE Decompile) omit sources of information preserved by ReF Decompileānamely, symbolic CFG edge and data segment recoveryāthus exhibiting lower re-executability and more hallucinated code structure (Tan et al., 2024). Refinement-focused methods that leverage Ghidra output as additional context can partially improve execution correctness, but cannot systematically recover lost literal values or enforce control-flow integrity (Feng et al., 17 Feb 2025, Tan et al., 2024).
Rule-based commercial decompilers (Ghidra, Hex-Rays) generate correct high-level structures in simple cases, but fail both at type/literal recovery and under code obfuscation, and typically achieve lower than 25% re-executability in controlled benchmarks (Feng et al., 17 Feb 2025).
5. Design Philosophy and Theoretical Guarantees
The architecture of ReF Decompile aligns with principles articulated in the literature on transparent transformations (Arranz-Olmos et al., 7 Jan 2025). While not constructed using transparency-preserving simulations or explicit ReF-transformer machinery, its staged pipelineāespecially through Relabelingāpreserves all control-flow information, supporting subsequent formal analysis. The explicit, invertible mapping from binary addresses to symbolic labels serves as a form of semantic round-trip guarantee: source-level CFG is a lossless abstraction of the binary CFG; literal recovery via Function Call is sound provided the underlying lookup is correct.
A plausible implication is that the ReF Decompile framework could be further extended or formally analyzed for "ReF-transparency" in the sense of (Arranz-Olmos et al., 7 Jan 2025), although such formal properties are not claimed in the original source.
6. Limitations, Integration, and Future Directions
ReF Decompile is evaluated principally on disassembled C functions with an emphasis on executable recovery using standard benchmarks. Its reliance on the LLM's ability to accurately infer the type for each data label (Ļ) introduces error modes if type inference fails or assembly is highly obfuscated. The current toolchain assumes availability of the raw binary and correct symbol-to-data region mapping, conditions which may not always apply in heavily packed or encrypted binaries.
Integration with other advanced pipelines is facilitated by the modularity of the relabeling and function call preprocessing, making it complementary to more complex refinement strategies and post-decompilation repair frameworks (such as D-LiFT (Zou et al., 11 Jun 2025), FidelityGPT (Zhou et al., 22 Oct 2025), or hybrid LLM-symbolic tools (Wong et al., 2023)). In contexts where end-to-end decompilation is infeasible due to severe obfuscation or non-x86 architectures, incorporating formal abstraction of control flow (e.g., via SALT trees (Wang et al., 18 Sep 2025)) or transparency-preserving transformations may increase robustness.
Potential future research directions include:
Extension to multi-architecture binaries and obfuscated control-flows.
Theoretical validation under formal semantic frameworks for transparent decompilation.
Automatic downstream integration with static analyzers, symbolic execution backends, or security policy checkers.
7. Summary
ReF Decompile demonstrates that two lightweight preprocessing stepsāRelabeling for control-flow integrity and Function Call for literal/constant recoveryāsubstantially advance the state of end-to-end LLM-based decompilation. Its empirical superiority in both re-executability and human readability marks it as a foundational advancement, enabling higher-fidelity binary analysis workflows with minimal manual effort or reliance on fragile heuristic rules (Feng et al., 17 Feb 2025).
“Emergent Mind helps me see which AI papers have caught fire online.”
Philip
Creator, AI Explained on YouTube
Sign up for free to explore the frontiers of research
Discover trending papers, chat with arXiv, and track the latest research shaping the future of science and technology.Discover trending papers, chat with arXiv, and more.