Beyond the Edge of Function: Unraveling the Patterns of Type Recovery in Binary Code
Open Access
- 18 November 2026
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (12) , 1-38
Abstract
Type recovery is a crucial step in binary code analysis, holding significant importance for reverse engineering and various security applications. Existing works typically simply target type identifiers within binary code and achieve type recovery by analyzing variable characteristics within functions. However, we find that the types in real-world binary programs are more complex and often follow specific distribution patterns. In this article, to gain a profound understanding of the variable type recovery problem in binary code, we first conduct a comprehensive empirical study. We utilize the TYDA dataset, which includes 163,643 binary programs across four architectures and four compiler optimization options, fully reflecting the complexity and diversity of real-world programs. We carefully study the unique patterns that characterize types and variables in binary code and also investigate the impact of compiler optimizations, yielding many valuable insights. Based on our empirical findings, we propose ByteTR , a framework for recovering variable types in binary code. We map the infinite set of target types to a finite, predictable set to obtain a balanced type dataset and perform static program analysis to tackle the impact of compiler optimizations on variable storage. In light of the ubiquity of variable propagation across functions observed in our study, ByteTR conducts inter-procedural analysis to trace variable propagation and employs a gated graph neural network to capture long-range dataflow dependencies for variable type recovery. We conduct extensive experiments to evaluate the performance of ByteTR. The results demonstrate that ByteTR outperforms state-of-the-art works in both effectiveness and efficiency. Moreover, in real-world Capture-the-Flag (CTF) vulnerability analysis case, the pseudo code optimized by ByteTR significantly improves readability, surpassing leading tools IDA Pro and Ghidra as well as methods DIRTY and StateFormer, demonstrating the substantial practical applicability.Keywords
All Related Versions
Funding Information
- Natural Science Foundation of China (U20B2047, 62072421, 62002334, 62102386, and 62121002)
- Postdoctoral Fellowship Program of CPSF (GZC20252180)
- Anhui Provincial Natural Science Foundation (2508085QF213)
This publication has 45 references indexed in Scilit:
- Vul-LMGNNs: Fusing language models and online-distilled graph neural networks for code vulnerability detectionInformation Fusion, 2024
- Towards Practical Binary Code Similarity Detection: Vulnerability Verification via Patch Semantic AnalysisACM Transactions on Software Engineering and Methodology, 2023
- VulHawk: Cross-architecture Vulnerability Detection with Entropy-based Binary Code Search2023
- BBDetector: A Precise and Scalable Third-Party Library Detection in Binary Executables with Fine-Grained Function-Level FeaturesApplied Sciences, 2022
- BinVulDet: Detecting vulnerability in binary program via decompiled pseudo code and BiLSTM-attentionComputers & Security, 2022
- TypeMiner: Recovering Types in Binary Programs Using Machine LearningLecture Notes in Computer Science, 2019
- Recovery of Class Hierarchies and Composition Relationships from Machine CodeLecture Notes in Computer Science, 2014
- Zipf's Law and Heaps' Law Can Predict the Size of Potential WordsProgress of Theoretical Physics Supplement, 2012
- Discovering power laws in computer programsInformation Processing & Management, 2009
- The locality principleCommunications of the ACM, 2005