TL;DR
Large Language Models (LLMs) like DeepSeek and Qwen significantly outperform traditional tools at deobfuscating Java code, particularly in renaming meaningless identifiers. However, the study reveals a "context paradox": while agentic retrieval is best for spotting obfuscated names, providing too much static code context can actually degrade detection performance for some models.
What Problem Does This Paper Address?
Reverse engineers often face "alphabet soup" code—source code where meaningful names (like userPassword) have been replaced by meaningless ones (like a, b, or var1) to protect intellectual property or hide malware. This process, called identifier renaming, makes code nearly impossible for humans to read.
While traditional deobfuscators exist, they rely on rigid signatures or statistical patterns that often fail to capture the intent of the code. LLMs seem like a natural fit for this task, but until now, we haven't had a rigorous comparison of how different models, obfuscation tools, and context-retrieval strategies (like RAG or Agentic loops) affect the quality of the recovered code.
Methods
The researchers broke the deobfuscation process into two distinct tasks:
- Identifier Detection: Identifying which tokens in a code snippet are obfuscated vs. which are standard library calls or clear text.
- Semantic Recovery: Proposing meaningful names for the identified targets.
They evaluated three state-of-the-art open-weight models—Qwen3-30B-A3B, OLMo 3.1-32B, and DeepSeek-V4-Flash—against four traditional baselines (including DeGuard and DOBF).
Crucially, they tested six different context settings:
- L0–L3: Increasing levels of static context, from just the method body (L0) to the full class plus one-hop callers and callees (L3).
- Repository Retrieval (R): A RAG-based approach using BM25 and dense vector search to find relevant snippets across the whole project.
- Agentic Retrieval (A): A "thinking" loop where the model uses a tool to selectively inspect specific definitions or callers it deems necessary.
Datasets
The authors built a fresh benchmark to avoid "data contamination" (where models might have already seen the code during training):
- 51 Java Projects: Sourced from GitHub with commits post-dating the models' training cutoffs.
- Three Obfuscators: Code was processed using industry standards: Allatori, ProGuard, and yGuard.
- Scale: The final dataset included 175,864 focal methods and over 300,000 unique obfuscated targets.
Key Insights and Ideas
- The Context Paradox: You might assume more code context always helps. It doesn't. For DeepSeek, adding static context (L1–L3) actually lowered detection $F_1$ scores by up to 20 points compared to the method-only (L0) view. The extra code acted as "noise" that distracted the model.
- Agentic Efficiency: The Agentic (A) setting was the clear winner for detection, reaching 91.56% $F_1$. It used significantly fewer tokens than the L3 setting but was smarter about which tokens it looked at.
- The "Class" Struggle: Class names are the hardest to recover. While field names (like
balance) are often used locally and are easier to guess, class names represent high-level abstractions that require a broader understanding of the entire system architecture. - Spaghetti Code vs. Secret Strings: The study found that control-flow obfuscation (scrambling the logic of the code) hinders LLM deobfuscation much more than string encryption. If the model can't follow the logic, it can't name the variables.
Key Results
- LLMs vs. Baselines: LLMs crushed traditional tools. Traditional baselines averaged a measly 1.86% exact-match recovery, while LLMs reached up to 16.42% overall.
- Semantic Similarity: While "Exact Match" scores seem low (peaking at ~33% for fields), the BERTScore (which measures semantic meaning) was often above 60%. This means even when the LLM didn't guess the exact original name, it chose a name that was functionally equivalent (e.g.,
isMouseOverinstead ofisOver). - Model Performance: DeepSeek generally provided the highest detection and recovery scores, though OLMo proved to be a robust contender, especially when static context was provided.
Limitations and Future Work
The authors acknowledge that Exact Match is a harsh metric; a name can be "wrong" but still highly helpful to a human engineer. Future work should involve human-in-the-loop studies to see if these LLM suggestions actually speed up real-world reverse engineering tasks.
Additionally, the study focused on "short-generated" names (a, b, c). The authors suggest testing LLMs against more aggressive strategies, such as dictionary-based renaming (where variables are renamed to misleading but real words like apple or orange), which might trick the models' semantic reasoning.
Summary updated