LLM4CodeRE: Generative AI for Code Decompilation Analysis and Reverse Engineering
Organizations: Faculty of Computer Science, University of New Brunswick, Canada
Abstract
Code decompilation analysis is a fundamental yet challenging task in malware reverse engineering, particularly due to the pervasive use of sophisticated obfuscation techniques. Although recent large language models (LLMs) have shown promise in translating low-level representations into high-level source code, most existing approaches rely on generic code pretraining and lack adaptation to malicious software. We propose LLM4CodeRE, a domain-adaptive LLM framework for bidirectional code reverse engineering that supports both assembly-to-source decompilation and source-to-assembly translation within a unified model. To enable effective task adaptation, we introduce two complementary fine-tuning strategies: (i) a Multi-Adapter approach for task-specific syntactic and semantic alignment, and (ii) a Seq2Seq Unified approach using task-conditioned prefixes to enforce end-to-end generation constraints. Experimental results demonstrate that LLM4CodeRE outperforms existing decompilation tools and general-purpose code models, achieving robust bidirectional generalization.
Figures & tables
| Dataset | Source | NLD | Assembly | Binary |
|---|---|---|---|---|
| 1. BODMAS | 93711 | 93711 | 92317 | 88605 |
| 2. MalwareBazaar | 14746 | 14746 | 14051 | 13973 |
| 3. Sorel20m | 81584 | 81584 | 81177 | 79166 |
| 4. Dike | 17431 | 17431 | 12138 | 11726 |
| 5. XLangKode | 468679 | 468679 | 5974 | 13299 |
| Total | 676151 | 676151 | 205657 | 206769 |
Software Reverse Engineering
Software reverse engineering recovers program structure, behavior, and intent from binaries when source code is missing, optimized, or obfuscated.
See all 34 papers