← Latest papers
🤖 AI

LLM4CodeRE: Generative AI for Code Decompilation Analysis and Reverse Engineering

The paper proposes LLM4CodeRE, a domain-adaptive large language model framework that employs multi-adapter and task-conditioned prefix fine-tuning strategies to achieve robust bidirectional code reverse engineering, outperforming existing tools in decompiling obfuscated malware and translating source code to assembly.

Original authors: Hamed Jelodar, Samita Bai, Tochukwu Emmanuel Nwankwo, Parisa Hamedi, Mohammad Meymani, Roozbeh Razavi-Far, Ali A. Ghorbani

Published 2026-04-08
📖 5 min read🧠 Deep dive

Original authors: Hamed Jelodar, Samita Bai, Tochukwu Emmanuel Nwankwo, Parisa Hamedi, Mohammad Meymani, Roozbeh Razavi-Far, Ali A. Ghorbani

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a detective trying to solve a crime, but the only evidence you have is a shredded, scrambled, and encrypted diary written in a secret code. This is essentially what cybersecurity experts face when they try to analyze malware (harmful computer programs).

The original code of a virus is often hidden, stripped of labels, or deliberately scrambled (a process called "obfuscation") to hide its true purpose. To understand what the virus is doing, experts must perform Reverse Engineering: they have to take the machine's low-level language (Assembly code) and translate it back into human-readable source code.

This is incredibly hard, like trying to rebuild a complex Lego castle just by looking at a pile of loose, mixed-up bricks.

The Problem: The "Generic" Translator

Recently, powerful AI models (called LLMs) have become great at translating languages and writing code. However, most of these AIs were trained on "good" code—like open-source software or apps you download from an app store. They are like translators who only speak "Polite English."

When you ask them to translate "Malware Russian" (scrambled, malicious code), they get confused. They don't understand the slang, the hidden tricks, or the specific ways criminals hide their tracks. They try to force the malicious code into a "polite" shape, which often leads to wrong answers.

The Solution: LLM4CodeRE

The authors of this paper created a new AI system called LLM4CodeRE. Think of this as hiring a specialized detective translator who has spent years studying criminal diaries, not just polite novels.

Here is how they built it, using simple analogies:

1. The "Specialized Training" (Domain-Adaptive Pretraining)

Instead of just giving the AI a generic book of code, the researchers fed it a massive library of real-world malware. They showed the AI millions of examples of how viruses are scrambled and unscrambled.

  • Analogy: Imagine a language student who only studied Shakespeare. If you ask them to translate a gangster's slang, they will fail. But if you send them to live in a gangster neighborhood for a year (training on malware), they learn the specific slang, the hidden meanings, and the tricks. That is what LLM4CodeRE does.

2. The "Two-Way Street" (Bidirectional Translation)

Most tools only go one way: Machine Code \to Human Code. But LLM4CodeRE is a two-way translator.

  • Decompilation (Assembly \to Source): Taking the scrambled machine code and turning it back into readable code.
  • Recompilation (Source \to Assembly): Taking readable code and turning it back into machine code.
  • Analogy: It's like a bilingual translator who can not only translate a speech from English to French, but also take a French speech and translate it back into English perfectly, ensuring the meaning hasn't changed. This helps verify if the translation is actually correct.

3. The "Smart Attachments" (Multi-Adapter & Seq2Seq)

The researchers didn't want to rebuild the entire AI brain for every new task. Instead, they used a clever strategy:

  • Multi-Adapter: Imagine the AI is a Swiss Army Knife. The main handle is the same, but they attach different "blades" (adapters) for different jobs. One blade is for translating Assembly to Source, another for Source to Assembly. This keeps the AI fast and efficient.
  • Seq2Seq Unified: Alternatively, they used "magic tags" (prefixes). You tell the AI, "Here is a job: Translate this," and the AI knows exactly how to handle it without needing a new blade.

4. The "Real-World Test" (Re-executability)

This is the most important part. Many AI tools produce code that looks right but doesn't work.

  • The Analogy: Imagine an AI writes a recipe for a cake. It looks perfect on paper, but if you bake it, it turns into a brick.
  • The Innovation: The researchers didn't just check if the code looked similar to the original. They actually compiled and ran the code in a safe, isolated sandbox (a digital "playpen"). If the code ran successfully without crashing, they gave it a high score. If it failed, they knew the AI was lying.

The Results

When they tested their new detective translator (LLM4CodeRE) against existing tools:

  • It understood the "criminal slang" (malware patterns) much better.
  • It produced code that was not only readable but actually worked when run.
  • It was better at both translating malware into human code and turning human code back into machine code.

Why This Matters

In the world of cybersecurity, speed is everything. If a new virus appears, experts need to understand it in minutes, not days. By using this specialized AI, we can automate the boring, difficult work of decoding viruses, allowing human experts to focus on stopping the threat rather than deciphering the code.

In short: They built an AI that speaks "Virus" fluently, can translate it back and forth, and actually checks if the translation works before handing it to the police.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →