arXiv:2608.26408cs.SEAug 2026

Manuscript Offprint

arXiv:2608.26408

STILL: Recovering Lowered STL Semantics for LLM-assisted C++ Decompilation

Xiaohan Wang, Kevin Leach

Abstract

LLM-assisted decompilation improves readability and re-executability, but still underperforms on stripped C++ functions that use the Standard Template Library (STL). Compilation, optimization, and symbol stripping remove or obscure source-level semantics such as container types and library-call structure, while traditional decompiler output often fails to recover them. We present STILL, a structured semantic interface that predicts function-level STL container semantics from stripped control-flow graphs and renders them as compact hints for LLM refinement. On STL-BENCH, STILL predicts common container-level STL semantics, with the strongest cross-dataset results for stable string and vector slices. On stripped HumanEval decompilation, these hints enable DeepSeek-chat refinement to reach 28.4% executability, compared with 17.4% for no-hint refinement and 8.9% for raw Ghidra decompilation; hint utility is downstream-backbone-dependent, with decompilation-specialized models requiring lightweight adaptation to benefit from the same interface.

1 Introduction

Decompilation is a widely employed technique for recovering source code from stripped binaries (Cifuentes, 1994; Schwartz et al., 2013; Yakdan et al., 2015). Typically, decompilation focuses on recovering C source code to improve readability over raw assembly or machine code, thereby facilitating reverse engineering, malware analysis, and forensic investigations. However, C++ functions that use container types such as vector<int> expose rich source-level semantics that are lost during compilation, optimization, and stripping; after decompilation, these functions are often reduced to complex and unreadable pointer arithmetic, opaque

(a) Ground-truth C++

int func0( vector<int> arr) { int max = -1; for (int i=0; i<arr.size(); i++) if (arr[i] <= i) max = i; return max; }

(c) w/o STL semantics

int func0( vector<int_t *v) { int max = -1; for (int i=0; i< FUN_00101894(v) ; i++) { if ( FUN_001018bc(v, i)->value <= i ) { max = i; } } return max; }

(b) Decompiled code

int FUN_00101249( undefined8 v) { int *p; ulong n; int ans = -1; int i = 0; while (true) { n = FUN_00101894(v); if (n <= (ulong)i) break; p = (int *) FUN_001018bc(v, i); if (*p <= i) ans = i; i = i + 1; } return ans; }

(d) w/ STL semantics

int func0(const vector<int>& a) { int ans = -1; for (int i=0; i<a.size() ; ++i) { if (a[i] <= i) ans = i; } return ans; }

Figure 1: Motivating example. A HumanEval C++ function exposes source-level STL semantics through a vector<int> interface in (a). After compilation, optimization, and stripping, the raw Ghidra decompilation in (b) fails to recover this abstraction and instead exposes low-level artifacts. A baseline LLM refiner in (c) preserves these artifacts and fails execution, while hint-guided refinement in (d) recovers a container-level interface and passes execution tests.

data types, and unclear function calls. Figure 1 shows an example function from the HumanEval dataset: rich semantics such as vector<int> and size() are lost during decompilation and replaced with low-level artifacts such as undefined8 and FUN_xxx calls.

In addition to the loss of semantics, decompiled code is much less likely to be recompiled and even less likely to be re-executable. This adds complexity in reverse engineering and forensics pipelines where a user may want to edit the de-

∗^{*}Corresponding author:

kevin.leach@vanderbilt.edu.

compiled source and still produce an executable binary. This issue is further amplified when focusing on C++ programs that include container types from the Standard Template Library. For example, on stripped HumanEval-Deccompile binaries, executability falls from 51.9% on STL-free functions to 6.2% on STL-bearing functions, an 8.4× gap. Compilation, optimization, and stripping all remove two pieces of information that programmers frequently use: signature information like vector<string>, and container identity like whether an object is a vector, string, or map. Because this information is removed from code when lowered during compilation, decompilers struggle to recover this information, even when assisted with or augmented by LLMs.

A key insight in this paper is that residual container-level STL semantics can remain partially visible within a given binary. Semantic residue refers to implementation traces that remain in machine code or the control-flow graph after names and template syntax disappear, including field offsets, access widths, capacity branches, scaled indexing, tree traversals, and low-level library calls that can all serve as hints that an STL container type is being used. For example, vector names disappear, but begin/end/capacity layout and reallocation branches can remain; string names disappear, but character-buffer accesses and length/capacity checks can remain. This residual information cannot guarantee fully-reconstructed source types, but they can indicate which STL abstractions a function likely uses. The challenge is to condense this scattered low-level evidence into an interface that an LLM refiner can use.

Existing work addresses adjacent parts of this pipeline: LLM-based decompilation improves source generation or repair (Armengol-Estapé et al., 2024; Tan et al., 2024; Armengol-Estapé et al., 2022; Shypula et al., 2026; Wang et al., 2026a), while binary analysis recovers names, types, and class structure (Lacomis et al., 2019; Chen et al., 2022; Xie et al., 2024; Lee et al., 2011; Noonan et al., 2016; Zhu et al., 2024; Wang et al., 2025; Schwartz et al., 2018). These approaches do not directly recover STL container identities or expose them as compact semantic hints for downstream LLM refinement.

We present STILL, a structured semantic interface for predicting function-level STL container semantics from stripped binaries: given a stripped control-flow graph, STILL predicts whether the function uses supported STL containers and which containers are present, then renders these predictions as compact hints prepended to the Ghidra decompilation before LLM refinement. We also present STLBENCH, a 14,884-record controlled corpus built from stripped CodeContests binaries for training and evaluating STILL. First, stripped binaries retain enough semantic residue to predict function-level STL container semantics: STILL reaches 80.4% macro-F1 on held-out CodeContests and 89.0% macro-F1 on the stable HumanEval-C++ string/vector transfer slice. Second, predicted semantic hints improve downstream decompilation: DeepSeek-chat reaches 28.4% stripped HumanEval RexecR_{exec} with predicted semantic hints, compared with 17.4% for no-hint refinement and 8.9% for raw Ghidra decompilation. Third, hint utility depends on the downstream backbone: an oracle hint is nearly inert for LLM4DECOMPILE-REF-6.7B-V2 (Tan et al., 2024) at inference time, but lightweight LoRA adaptation (Hu et al., 2021) enables the model to benefit from the same interface and raises STL-slice RexecR_{exec} from 1.1% to 26.9%.

Our contributions are: (1) We identify STL semantic loss during compilation, optimization, and stripping as a specific failure channel in stripped C++ LLM-assisted decompilation, separating signature loss and container identity loss from generic refinement errors. (2) We introduce STILL, which predicts function-level STL container semantics from stripped CFGs and exposes them as compact semantic hints. STLBENCH provides supervision and evaluation for this interface. (3) We show that predicted semantic hints improve executable decompilation under a fixed chat model, while specialized decompilation backbones may require adaptation to consume the same interface. (4) We release the artifact.

References (22)