[Paper Review] In Nomine Function: Naming Functions in Stripped Binaries with Neural Networks
This paper proposes a neural network approach to automatically name functions in stripped binary executables using deep learning. It introduces a large public dataset of 8.8 million functions from diverse software, demonstrates state-of-the-art performance with Transformers (F1-score: 0.230), and shows fine-tuning significantly improves accuracy—especially for domain-specific binaries like system utilities.
In this paper we investigate the problem of automatically naming pieces of assembly code. Where by naming we mean assigning to an assembly function a string of words that would likely be assigned by a human reverse engineer. We formally and precisely define the framework in which our investigation takes place. That is we define the problem, we provide reasonable justifications for the choices that we made for the design of training and the tests. We performed an analysis on a large real-world corpora constituted by nearly 9 millions of functions taken from more than 22k softwares. In such framework we test baselines coming from the field of Natural Language Processing (e.g., Seq2Seq networks and Transformer). Interestingly, our evaluation shows promising results beating the state-of-the-art and reaching good performance. We investigate the applicability of tine-tuning (i.e., taking a model already trained on a large generic corpora and retraining it for a specific task). Such technique is popular and well-known in the NLP field. Our results confirm that fine-tuning is effective even when neural networks are applied to binaries. We show that a model, pre-trained on the aforementioned corpora, when fine-tuned has higher performances on specific domains (such as predicting names in system utilites, malware, etc).
Motivation & Objective
- Address the challenge of reverse engineering stripped binaries where function names are absent, impeding malware analysis and software maintenance.
- Overcome limitations of prior work that rely on restrictive assumptions, such as presence of dynamic library calls or closed-vocabulary naming.
- Create a large-scale, publicly available dataset of real-world binaries to enable reproducible evaluation and benchmarking in binary function naming.
- Evaluate the effectiveness of deep neural networks—specifically Seq2Seq and Transformer architectures—on the task of function name prediction.
- Investigate the impact of fine-tuning pre-trained models on domain-specific binary datasets to improve prediction accuracy.
Proposed method
- Construct a large-scale dataset, UbuntuDataset, comprising 8.8 million functions from 22,000 diverse software binaries across domains like system utilities, databases, and games.
- Train and evaluate two deep neural network architectures: Sequence-to-Sequence (Seq2Seq) and Transformer models, using source code function names as ground truth labels.
- Apply transfer learning by fine-tuning a model pre-trained on the full UbuntuDataset on smaller, domain-specific subsets (e.g., busybox for system utilities).
- Use BLEU and F1-score as evaluation metrics, with F1-score computed using exact and partial word overlap between predicted and reference names.
- Leverage contextual embeddings and attention mechanisms in the Transformer model to better capture semantic and syntactic patterns in assembly-level function behavior.
- Perform ablation studies and qualitative analysis on predictions to assess semantic fidelity and alignment with actual function behavior.
Experimental results
Research questions
- RQ1Can deep neural networks effectively learn to predict meaningful, human-like function names from stripped binary code without symbolic information?
- RQ2How does model performance vary across diverse software domains such as system utilities, malware, and application libraries?
- RQ3To what extent does fine-tuning a pre-trained model on a domain-specific subset improve function naming accuracy compared to using a general-purpose model?
- RQ4How do the proposed models compare to existing state-of-the-art approaches in terms of F1-score and semantic relevance of predictions?
- RQ5Can a multi-reference naming approach improve evaluation robustness by accounting for multiple valid naming conventions?
Key findings
- The Transformer model achieves an F1-score of 0.230 on the full test set, significantly outperforming the Seq2Seq baseline (F1-score: 0.122).
- Fine-tuning a model pre-trained on the UbuntuDataset on a domain-specific subset (e.g., busybox) results in a 22% relative improvement in F1-score when tested on coreutils.
- On the malware sample gonnacry, the Transformer model achieves an F1-score of 0.260, outperforming DEBIN (F1-score: 0.0825), with predictions often capturing functional semantics despite not matching ground truth exactly.
- Predictions such as 'copy file' for encryption/decryption functions and 'random' for key generation demonstrate semantic alignment with actual behavior, even when names differ from canonical ones.
- The study confirms that fine-tuning is effective in binary code analysis, extending its success from NLP to low-level binary function naming.
- The creation and release of the UbuntuDataset (8.8M functions from 22k software) enables reproducible benchmarking and future research in binary function naming.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.