Reconstructing High-Level Semantics from Stripped Binaries

187 concepts141 papers3 proposals

When developers write software, they rely on high-level abstractions to manage complexity. They choose descriptive variable names (is_authenticated), define custom data structures (struct User), and organize logic using structured control flow loops. However, as noted by Aram Galstyan et al. in Towards Learning Representations of Binary Executable Files for Security Tasks, the compilation process is inherently lossy.

To optimize for execution speed and minimize file size, compilers discard these human-readable abstractions. What remains is a flat sequence of machine instructions operating on anonymous registers and memory addresses. This creates a severe source-binary semantic gap that complicates reverse engineering, malware analysis, and vulnerability detection.

The Anatomy of Information Loss

To understand how to reverse compilation-induced information loss, we must look at exactly what disappears when a binary is "stripped":

  1. Symbolic Identifiers: Variable and function names are entirely erased. In stripped binaries, meaningful labels vanish, leaving reverse engineers with generic placeholders like func_0x401000 or v1, as described by Liang Jiang et al. in Beyond Classification: Inferring Function Names in Stripped Binaries via Domain Adapted LLMs.
  2. Type Information: Complex, user-defined data structures (such as structs or object-oriented class hierarchies) are flattened into primitive numeric types or raw memory offsets. As explained by Weike Fang et al. in StackSight: Unveiling WebAssembly through Large Language Models and Neurosymbolic Chain-of-Thought Decompilation, this type erasure makes it nearly impossible to distinguish a boolean flag from a memory address based on the instruction alone.
  3. Control Flow and Intent: High-level constructs like loops, switches, and object relationships are desugared into raw conditional jumps and pointer arithmetic, obscuring the original programmer's intent (Yunlong Feng et al., Self-Constructed Context Decompilation with Fined-grained Alignment Enhancement).

Why Recovery is Possible: The Behavioral Footprint

If this information is discarded by the compiler, how can automated tools recover it? The core insight driving this research direction is that code possesses naturalness and structural predictability. Even when names and explicit types are stripped, the behavioral footprint of the code remains intact within the binary structure.

A cryptographic function will still perform specific patterns of bitwise operations; a string-copying routine will still loop until it encounters a null terminator. By analyzing data-flow dependencies, register usage, and structural context, machine learning models can infer the missing high-level intent from these low-level patterns.

Statistical and Generative Reconstruction

Modern techniques leverage this structural predictability using several key paradigms to bridge the semantic gap.

Contextual Type and Name Inference

Early approaches focused on predicting specific missing pieces using localized code context. For instance, Qibin Chen et al. developed DIRTY in Augmenting Decompiler Output with Learned Variable Names and Types, utilizing a Transformer model to predict original variable names and structure types based on how they are accessed within decompiled code. To resolve ambiguities in how values flow through registers and memory when high-level variable definitions are missing, Scott Geng proposed NeuDep in NeuDep: neural binary memory dependence analysis, utilizing dynamic execution traces to statically infer memory dependencies.

Cross-Modal Alignment

Instead of treating assembly as an isolated language, the authors of CLAP: Learning Transferable Binary Code Representations with Natural Language Supervision (Hao Wang et al.) utilized contrastive learning to align low-level assembly code directly with natural language explanations. This allows models to learn transferable representations that map machine instructions to human concepts, surviving variations in compiler optimization.

Generative Decompilation

With the advent of large language models (LLMs), researchers have shifted from predicting isolated labels to generating entire source code files from binaries. Models like LLM4Decompile, introduced by Hanzhuo Tan et al. in LLM4Decompile: Decompiling Binary Code with Large Language Models, learn to synthesize logically accurate C source code directly from assembly instructions.

To refine this process, frameworks like ProRec (Zian Su et al., Source Code Foundation Models are Transferable Binary Analysis Knowledge Bases) use frozen source code foundation models to "probe" and generate symbol-rich context, effectively reconstructing the missing human context based on functional logic.

Enforcing Soundness via Neurosymbolic Hybridization

While purely statistical models excel at predicting plausible names and structures, they can introduce logical errors or "hallucinations" that break program execution. To ensure correctness, modern techniques combine generative models with formal static analysis constraints.

For example, the neurosymbolic approach in StackSight pairs LLM chain-of-thought reasoning with the static tracking of hidden stack states. By forcing the statistical model to respect the underlying execution logic and data flow of the binary, these hybrid systems ensure that recovered semantics are both human-readable and mathematically sound.

History & citationVersion 2 · 2026-10-04

Current · Permanent link

  1. Version 2 (latest) · 2026-10-04 · 145 papers
  2. Version 1 · 2026-10-04 · 198 papers
Cite this direction

Latest version (a living page):

@misc{lacuna_semantic_information_loss_40b825ab,
  title = {semantic information loss},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/semantic-information-loss/rdr_40b825abae5f4668960e85717b6cbf6c},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-21},
}

This exact version (version 2, frozen text):

@misc{lacuna_semantic_information_loss_40b825ab_v2,
  title = {semantic information loss},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/semantic-information-loss/rdr_40b825abae5f4668960e85717b6cbf6c/v/2},
  note = {Version 2, frozen 2026-10-04. Accessed 2026-11-21},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake