CORTEXA
← Browse
arxivcs.SEcs.AI2026-07-10

Practical Source Code Recovery from Binary Functions Using Anchor-Based Retrieval and LLM Reasoning

Charles Edward Gagnon, Steven H. H. Ding, Philippe Charland, Benjamin C. M. Fung

We present a practical pipeline for recovering source code from stripped binary functions by combining reverse engineering, anchor-based source code retrieval, and large language model reasoning. Our binary-to-source-code retrieval method attempts to identify the source function from a source code database, rather than generating approximate decompiled pseudocode. It extracts anchors such as strings, constants, external calls, and available function names using Ghidra, retrieves candidate files via an inverted-index search database, narrows candidates to likely function snippets, and re-ranks them with a large language model (LLM) based on disassembly, decompiled code, and source metadata. Confident matches can also serve as anchors in later passes. In an evaluation backed by our high-fidelity source code database on a stripped, optimized tcpdump binary, our proposed binary-to-source matching method achieves 95.2% assembly instruction coverage. Experiments on a GitHub-based retrieval database showed lower performance with 35.5% instruction coverage on average, mainly due to retrieval misses. These results show that source-level binary recovery excels with high-quality databases and remains a useful tool in noisy environments.

View free PDFSource page

Related papers

arxivcs.SEcs.AI2026-07-11

Mitigating LLM Sycophancy in Code Smell Detection Using Evidence-Guided Reasoning Prompts

Istiaq Ahmed Fahad, Kamruzzaman Asif, Md. Nurul Ahad Tawhid

Large Language Models (LLMs) are increasingly used for code smell detection tasks due to their ability to interpret program semantics. However, their reliability in this context remains poorly explored, particularly under varying prompt conditions where model predictions may be i…

View free PDFSource page
arxivcs.SEcs.AI2026-07-02

A Preliminary Study on Explaining Risk of Code Changes using LLM-Based Prediction Models

Yalin Liu, Kosay Jabre, Rui Abreu, Zachariah J. Carmichael, Vijayaraghavan Murali, Akshay Patel, et al.

Predictions by machine learning (ML) and artificial intelligence (AI) models are often received skeptically unless they are paired with intelligible explanations. In the context of just-in-time defect prediction, highlighting small portions of a software change (diff) -- beyond r…

View free PDFSource page
arxivcs.SEcs.AI2026-06-27

Reward-Free Code Alignment from Pretrained or Fine-Tuned LLM: Unpacking the Trade-offs for Code Generation

Sanjeepan Sivapiran, Gias Uddin

Large Language Model (LLM) alignment trains an LLM using preference data to produce outputs that better meet established quality standards. While LLM alignment techniques are studied for non-coding tasks, we know little about their usefulness for coding tasks. It is unclear wheth…

View free PDFSource page
arxivcs.SEcs.AI2026-06-27

Diff-Based Code Corruption using LLMs for Large-Scale Bugfix Benchmarking

Balázs Szalontai, Ábel Szauter, Balázs Márton, Péter Verebics, Balázs Pintér, Tibor Gregorics

There are various benchmarks to evaluate bugfixing capabilities of Large Language Models. However, most widespread benchmarks do not fully reflect real-world bugfixing practices. They are small, weakening statistical reliability, and the buggy programs are often similar to one an…

View free PDFSource page
arxivcs.AIcs.SE2026-07-02

Rethinking Complexity Metrics for LLM-Integrated Applications: Beyond Source Code

Zihao Xu, Yuekang Li, Gelei Deng, Yi Liu, Zhenchang Xing

LLM-integrated applications blend natural language prompts with program code, and much of their runtime behavior originates in the prompt layer rather than in the code itself. Existing complexity metrics, however, operate solely at the code level and therefore overlook this behav…

View free PDFSource page
arxivcs.SEcs.AI2026-07-02

An Exploratory Study on LLM-Generated Code and Comments in Code Repositories

Yongyi Ji, Jiaji Wang, Yi Zhou, Fuxiang Chen, Hongji Yang

The use of LLMs in software development has become increasingly widespread on tasks such as code generation and summarization. Reports from large technology companies showed that around 20% to 30% of their code are generated by LLMs. However, there remains skepticism about the pr…

View free PDFSource page