Lune

USENIX Security2025Top-tier venue

TRex: Practical Type Reconstruction for Binary Code

Jay Bosamiya, Maverick Woo, Bryan Parno

Abstract

A lack of high-quality source-level types plagues decompiled code despite decades of advancement in the science and art of decompilation. Accurate type information is crucial in understanding program behavior, and existing decompilers rely heavily on manual input from human experts to improve decompiled output. We propose TRex, a tool that performs automated deductive type reconstruction, using a new perspective that accounts for the inherent impossibility of recovering lost source types. Compared with Ghidra, a state-of-the-art decompiler used by practitioners, TRex shows a noticeable improvement in the quality of output types on 124 of 125 binaries. By shifting focus away from recovering lost source types and towards constructing accurate behavior-capturing types, TRex broadens the possibilities for simpler and more elegant decompilation tools, and ultimately reduces the manual effort needed to analyze and understand binary code. 1 Indeed for one paper [25] , other employees at the same company attempting to reproduce the work stated that "[i]t is a powerful system but difficult to understand" and the "presentation is very dense and subtle" [12]. 2 https://github.com/secure-foundations/ trex,trex-usenix25 (archived at https://doi.org/10.5281/zenodo.15611994 ) 3 Capitalized to distinguish from prior informal usage ( §2) 4 TRex: Type Reconstruction for executables

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • OSPREY: Recovery of Variable and Data Structure via Probabilistic Analysis for Stripped Binary cites Superset Disassembly: Statically Rewriting x86 Binaries Without Heuristics
  • StateFormer: fine-grained type recovery from binaries using generative state modeling cites Egalito: Layout-Agnostic Binary Recompilation
  • RecStruct: Recovering Nested Struct Types from Stripped Binaries via Stack-Driven Unification cites OSPREY: Recovery of Variable and Data Structure via Probabilistic Analysis for Stripped Binary
  • RecStruct: Recovering Nested Struct Types from Stripped Binaries via Stack-Driven Unification cites StateFormer: fine-grained type recovery from binaries using generative state modeling
  • Idioms: A Simple and Effective Framework for Turbo-Charging Local Neural Decompilation with Well-Defined Types cites OSPREY: Recovery of Variable and Data Structure via Probabilistic Analysis for Stripped Binary
  • Towards Generality: Task-Adaptive Binary Analysis via Semantic Retrieval and Verifiable Reasoning cites OSPREY: Recovery of Variable and Data Structure via Probabilistic Analysis for Stripped Binary
  • Egalito: Layout-Agnostic Binary Recompilation cites Superset Disassembly: Statically Rewriting x86 Binaries Without Heuristics
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Idioms: A Simple and Effective Framework for Turbo-Charging Local Neural Decompilation with Well-Defined TypesLuke Dramko, Claire Le Goues, Edward J. SchwartzNDSS 2026 · 7 citations
  2. RecStruct: Recovering Nested Struct Types from Stripped Binaries via Stack-Driven UnificationYuxin Chen, Zhiyang Fang, Shiyi Wu, Yixin Xu et al.USENIX Security 2026
  3. Towards Generality: Task-Adaptive Binary Analysis via Semantic Retrieval and Verifiable ReasoningYuzhe Liu, Zhijie Liu, Zhengmin Yu, Shu Wang et al.USENIX Security 2026

Builds on9

  1. Helping Johnny to Analyze Malware: A Usability-Optimized Decompiler and Malware Analysis User StudyKhaled Yakdan, Sergej Dechand, Elmar Gerhards-Padilla, Matthew SmithS&P 2016 · 128 citations
  2. Superset Disassembly: Statically Rewriting x86 Binaries Without HeuristicsErick Bauman, Zhiqiang Lin, Kevin W. HamlenNDSS 2018 · 112 citations
  3. OSPREY: Recovery of Variable and Data Structure via Probabilistic Analysis for Stripped BinaryZhuo Zhang, Yapeng Ye, Wei You, Guanhong Tao et al.S&P 2021 · 78 citations
  4. Egalito: Layout-Agnostic Binary RecompilationDavid Williams-King, Hidenori Kobayashi, Kent Williams-King, Graham Patterson et al.ASPLOS 2020 · 68 citations
  5. StateFormer: fine-grained type recovery from binaries using generative state modelingKexin Pei, Jonas Guan, Matthew Broughton, Zhongtian Chen et al.FSE 2021 · 53 citations

Related papers

  1. Augmenting Decompiler Output with Learned Variable Names and TypesQibin Chen, Jeremy Lacomis, Edward J. Schwartz, Claire Le Goues et al.USENIX Security 2022
  2. D-Helix: A Generic Decompiler Testing Framework Using Symbolic DifferentiationMuqi Zou, Arslan Khan, Ruoyu Wu, Han Gao et al.USENIX Security 2024 · 14 citations
  3. TypeForge: Synthesizing and Selecting Best-Fit Composite Data Types for Stripped BinariesYanzhong Wang, Ruigang Liang, Yilin Li, Peiwei Hu et al.S&P 2025
  4. HexT5: Unified Pre-Training for Stripped Binary Code Information InferenceJiaqi Xiong, Guoqiang Chen, Kejiang Chen, Han Gao et al.ASE 2023 · 8 citations
  5. "Len or index or count, anything but v1": Predicting Variable Names in Decompilation Output with Transfer LearningKuntal Kumar Pal, Ati Priya Bajaj, Pratyay Banerjee, Audrey Dutcher et al.S&P 2024 · 30 citations
Dusk over the sea between two cliffs drawn in fine vertical lines