Josh Stroschein
Large language models cannot reliably reverse compiled malware unless binary similarity engines first filter out benign runtime libraries, setting the stage for an adversarial shift toward anti-LLM code obfuscation.
AI-assisted summary of EP29 Binary Similarity in the LLM Era with Jonas Wagner and Endre Bangerter of ThreatRay — original source. Check the original for full context.
Source published:
Key ideas
- Academic algorithms for binary code similarity often fail to become viable production tools because effective attribution depends on massive data engineering, sandbox detonation, and labeled reference datasets rather than the comparison algorithm alone. (6:00)
- Binary code similarity delivers immense value to AI reverse-engineering pipelines by pruning thousands of benign and library functions, preventing context exhaustion and hallucinations in LLMs by isolating only the unique malicious code. (25:00)
- ThreatRay has automated OSINT indexing by crawling threat intelligence blogs, pulling referenced binary hashes, and indexing their code to allow frontline responders to match novel, obfuscated payloads directly back to public threat actor reporting. (37:47)
- Internal trials at ThreatRay demonstrated that equipping agentic AI models with precise binary similarity and reverse-engineering APIs compressed complex, multi-binary APT attribution workflows from eight hours down to just twenty minutes. (46:17)
- Security researchers project that increased AI automation in reverse engineering will trigger dedicated anti-LLM obfuscations engineered specifically to induce hallucinations and derail model tokenization logic. (52:45)
Detailed notes
## Background Published by Josh Stroschein on September 16, 2026, on the Behind the Binary podcast feed, this episode features ThreatRay co-founders Jonas Wagner and Endre Bangerter. According to the show description, the discussion explores the practical state of binary similarity in the LLM era, dispelling AI hype by detailing why raw LLMs struggle with unguided binary analysis and how combining code similarity with AI accelerates malware investigation.
## TL;DR Jonas Wagner and Endre Bangerter trace the evolution of binary similarity from traditional heuristics like BinDiff and SSDEEP to modern function embeddings and agentic workflows. They explain how the practical bottleneck in malware classification lies in data curation, sandbox detonation, and stripping runtime noise from statically linked languages like Go and Rust rather than in academic algorithm design. While adversaries could theoretically use generative AI or advanced obfuscation to defeat code-matching models, the reality is that threat actors rarely invest beyond standard packing. Ultimately, the guests showcase how combining pre-indexed code similarity with autonomous AI agents dramatically accelerates triage, goodware pruning, and retrospective threat hunting without succumbing to LLM hallucinations.
## Atmosphere & style The conversation carries an analytical, pragmatic, and refreshingly grounded tone that cuts through contemporary AI marketing hype. Josh Stroschein engages as a technically seasoned peer and sounding board, trading candid insights with the guests about the real-world operational frictions of reverse engineering. The exchange feels like a masterclass in low-level engineering realism, balancing enthusiasm for emerging agentic workflows with a clear-eyed understanding of persistent obstacles like indirect control flow and adversarial anti-LLM obfuscation.
## Bulletin - `06:00` Academic algorithms for binary code similarity often fail to become viable production tools because effective attribution depends on massive data engineering, sandbox detonation, and labeled reference datasets rather than the comparison algorithm alone. - `25:00` Binary code similarity delivers immense value to AI reverse-engineering pipelines by pruning thousands of benign and library functions, preventing context exhaustion and hallucinations in LLMs by isolating only the unique malicious code. - `37:47` ThreatRay has automated OSINT indexing by crawling threat intelligence blogs, pulling referenced binary hashes, and indexing their code to allow frontline responders to match novel, obfuscated payloads directly back to public threat actor reporting. - `46:17` Internal trials at ThreatRay demonstrated that equipping agentic AI models with precise binary similarity and reverse-engineering APIs compressed complex, multi-binary APT attribution workflows from eight hours down to just twenty minutes. - `52:45` Security researchers project that increased AI automation in reverse engineering will trigger dedicated anti-LLM obfuscations engineered specifically to induce hallucinations and derail model tokenization logic.
## Key takeaways - `00:00` Binary similarity aims to determine whether two compiled machine-code binaries originate from the same source code without having access to the original source. - `03:00` The compilation process strips critical semantic context such as variable and function names while introducing synthetic structural variation across optimization flags and CPU architectures. - `06:00` The binary similarity field has evolved from expert-crafted graph isomorphisms (like BinDiff) toward modern vector embeddings and MinHash indexing architectures (such as Ghidra's BSim and MCRIT). - `10:00` Real-world binary classification breaks down on packed malware unless samples are first detonated inside automated sandboxes to extract unmapped memory blocks. - `15:00` Syntactic instruction matching is computationally fast but highly fragile, breaking easily under simple compiler optimization flags or architectural shifts. - `20:00` Semantic similarity represents the ultimate goal of code matching, but its reliance on computationally expensive formal methods like symbolic execution forces practical systems to rely on structural graph matching as a proxy. - `20:00` Malware authors in the wild rarely deploy extreme obfuscation like control flow flattening, relying instead on traditional packing and making structural graph matching highly effective in production. - `30:00` Statically compiled languages like Go and Rust bloat binaries with thousands of runtime and library functions, necessitating function-level similarity filtering before analysis. - `25:00` Pairing binary similarity with LLMs allows defenders to filter out 90% or more of benign runtime code, directing scarce model context and reversing capacity only to novel, suspicious functions. - `31:37` Extracting semantics once via an LLM and using binary similarity engines to propagate those semantic labels across thousands of corpus binaries provides massive analytical leverage. - `43:24` Indexing compiled code into a searchable repository enables instant historical retro-hunting without the processing overhead and syntax constraints of scanning with YARA. - `50:00` Frontline SOC analysts can leverage autonomous agents coordinating disassemblers, similarity engines, and sandboxes to perform rapid binary triage without deep personal reverse-engineering expertise. - `52:45` Obfuscation techniques such as indirect jumps and fractured control flow graphs disrupt LLM reasoning just as severely as they do traditional static disassemblers like IDA Pro. - `55:00` The expansion of AI-assisted malware analysis will lead threat actors to evolve from basic evasion toward code-level structural mutations designed specifically to break LLM tokenization and inference.
## Detailed walkthrough ### `00:00` Defining Binary Similarity and the Threat Landscape
Josh Stroschein opens the episode by framing the paradox of artificial intelligence in cybersecurity: while defenders gain dramatic efficiency, attackers gain an engine for sheer scale. Jonas Wagner introduces the ultimate consequence of this dynamic, noting that code-based detection could face an existential crisis if generative tools reach full autonomy.
> “If the LLMs take over and they get even more efficient, then I mean, the attacker could craft a new malware family for every attack, right? In the extreme case. Then, to be honest, then all code-based approaches become less useful, right?” — Jonas Wagner
Josh introduces Endre Bangerter and Jonas Wagner, co-founders of ThreatRay, to discuss binary similarity (commonly abbreviated as "bin-sim"). While bin-sim can theoretically touch various intermediate languages, the primary focus of the discussion is native machine code executed directly by the CPU—the most challenging domain in reverse engineering.
Jonas defines the foundational goal of bin-sim: determining whether two compiled binary snippets originated from the same underlying source code without having access to that source code. Solving this reliably and at scale unlocks critical workflows across malware analysis, incident response, and software provenance.
```mermaid flowchart LR accTitle: Binary Similarity Process accDescr: High-level overview of comparing compiled binaries to infer shared source code heritage. subgraph Compilation["Compilation Process"] SC1["Source Code A"] -->|"Compiler & Flags"| B1["Binary Code A"] SC2["Source Code B"] -->|"Compiler & Flags"| B2["Binary Code B"] end subgraph Matching["Bin-Sim Engine"] B1 --> Engine["Similarity Analysis Engine"] B2 --> Engine Engine --> Output{"Shared Source Code?"} end ```
`03:00` The Compilation Barrier and Traditional Handcrafted Heuristics
The core hurdle of binary similarity is that the compilation process actively strips out semantic context while injecting synthetic diversity. Compilers discard developer-friendly metadata like function and variable names, and depending on optimization flags, compiler versions, or target CPU architectures, the resulting assembly instructions for the exact same source code can look radically different. Consequently, bin-sim tools are forced to reconstruct intent from whatever residual artifacts survive compilation.
Over the past two decades, practitioners relied heavily on handcrafted domain heuristics. Jonas cites BinDiff as the historical gold standard: - **BinDiff**: Acts as the "godfather" of binary code similarity by parsing function control-flow graphs (CFGs) to identify shared versus unique functions between two files. While highly precise, it relies on pairwise comparisons that do not easily scale to massive corpuses. - **SSDEEP (Context Triggered Piecewise Hashing)**: Very fast and lightweight for whole-file comparisons, but brittle and shallow because small shifts in bytes or layout break the match. - **Signature & Heuristic Matching (YARA, AV, IDA FLIRT)**: Effective for static byte patterns and library signature detection, but prone to evasion under code reordering, register renaming, or compiler variation.
Around a decade ago, research reached a turning point. Instead of building purely deterministic, expert-crafted rules, the field shifted toward data-driven machine learning models to combine the deep precision of tools like BinDiff with the speed and scale required to search across massive datasets.
`06:00` Academic Evolution, Modern Open-Source Tooling, and the Data Bottleneck
Josh questions whether the public tooling landscape has grown stagnant, noting that traditional staples like SSDEEP and IDA FLIRT still dominate everyday analyst workflows. Jonas clarifies that while practitioner mindshare may seem static, academic research has advanced rapidly through distinct eras:
| Era | Primary Paradigm | Core Characteristics & Examples | |:--- |:--- |:--- | | **Early 2000s** | Expert Domain Rules | Graph isomorphisms, instruction normalization (BinDiff, IDA FLIRT, SSDEEP). | | **Mid 2010s** | Machine & Deep Learning | Statistical feature extraction, control-flow graph embeddings (e.g., Gemini, asm2vec). | | **Present Era** | Transformers & Vector Spaces | Function embeddings, dense vector search, large language model (LLM) architectures. |
Jonas highlights two notable modern tools that have emerged in the public/open-source space: - **Ghidra's BSim**: Implements modern function-level vector embeddings, enabling fast nearest-neighbor similarity searches across large codebases—scaling far beyond the limits of one-to-one BinDiff comparisons. - **MCRIT (MinHash-based Code Relationship Identification Tool)**: An open-source framework developed by Daniel Plohmann that provides a scalable architecture to index and query binary code similarity from scratch.
Endre Bangerter intervenes to explain why powerful academic algorithms rarely become ubiquitous standalone products. While thousands of similarity algorithms exist on GitHub and in academic papers, an algorithm is essentially useless without an indexed, high-quality corpus of binary data and rich metadata. In real-world enterprise environments, the limiting factor is rarely the algorithm itself; it is the infrastructure required to ingest, normalize, and contextualize ground-truth binaries so that similarity matches provide actionable threat intelligence.
`10:00` The Reality of Data Curation and Sandbox Detonation
The conversation opens with a discussion on the gap between academic algorithm design and usable tooling: making output easily digestible for an end user is often more difficult than crafting the core similarity algorithms themselves. While the algorithms are mathematically fascinating, they are practically useless without a meticulously curated, accurately tagged reference database. Josh Stroschein points out the parallel when writing individual YARA rules: an analyst must obtain an authentic sample, assign it to a family, verify that the sample set is statistically representative, and run it across massive corpuses to validate true positives and rule out false positives. Sourcing reliable data remains a major bottleneck—whether pulling from open platforms like abuse.ch or navigating commercial datasets like VirusTotal, knowing how well a sample pool reflects the real-world malware landscape is inherently difficult.
Endre Bangerter clarifies that the operational friction goes far beyond mere data collection, using malware classification as the primary example. The theoretical model assumes that an analyst collects reference binaries across various malware families, compares an unknown binary against them, measures code overlap, and assigns the label of the closest match. In the field, this straightforward strategy collapses immediately because the vast majority of modern malware is packed, while the true family characteristics reside inside the unpacked payloads.
```mermaid flowchart TD accTitle: Pipeline for Memory-Dumped Payload Classification accDescr: Flow showing how samples pass through sandboxing to memory dumps and filtering before matching. subgraph INGEST["1. Ingestion & Detonation"] A["Packed Unknown Sample"] --> S["ThreatRay Sandbox Execution"] R["Reference Family Binaries"] --> S end
subgraph MEMORY["2. Memory Extraction"] S --> D["10–30 Memory Dumps & Files"] D --> F{"De-noising & Filtering"} end
subgraph CLASSIFY["3. Attribution"] F -->|"Strip Loaders & Statically Linked Libs"| P["True Payload Code"] P --> M["Per-Function Similarity Matching"] M --> L["Reliable Family Attribution"] end ```
To counter packing, ThreatRay detonates both reference sets and incoming unknown binaries inside an automated sandbox that monitors memory, unpacks layers, executes runtime web downloads, and dumps all unmapped or altered code blocks directly from memory. This execution step radically transforms the geometry of the problem: instead of performing a simple one-to-one binary comparison, analysts must match an incoming set of 10 to 30 extracted memory chunks against an entire database consisting of dozens of sets of binary components per reference family.
- Unpacking and detonation uncover dynamic loaders, dependencies, and OS libraries in memory, all of which will produce noisy false matches if naively compared against reference sets. - Family labels cannot be propagated directly from file hashes; labels must attach specifically to the genuine, recovered payload inside memory. - As Endre Bangerter summarizes: “And once you have them labeled, then you can reliably do this classification. But also labeling is not so easy, by the way.”
---
`15:00` De-Noising, Compilers, and the Brittleness of Syntactic Matching
Even after dumping code from memory, deep noise persists. Payloads frequently incorporate statically linked third-party libraries, intertwining distinct payload logic with generic runtime components. ThreatRay addresses this by conducting similarity matching at the individual function level rather than over entire files. This introduces algorithmic nuances: similarity engines fail on very small functions due to lack of unique entropy, and they occasionally correlate unrelated large functions that share standard patterns. Building production-grade similarity requires an entire supporting pipeline of workflows and heuristics designed to strip runtime noise, detect actual functional boundaries, and correctly label true malicious code.
Josh highlights the intensifying architectural hurdles facing binary similarity: modern languages like Go and Rust generate massive executables loaded with static runtimes and standard libraries. Simultaneously, compiler optimization levels act destructively on original source logic, while advanced obfuscation engines mutate control flows, inject opaque predicates, weave mixed Boolean arithmetic, and obliterate function boundaries. These structural modifications raise the question of whether binary similarity can endure against such extreme distortions.
Jonas Wagner structures the challenge into two broad layers: "implicit variation" arising naturally from compilers, different instruction set architectures, optimization flags, and language runtimes, alongside "explicit obfuscation" applied deliberately by threat actors to break reverse-engineering tooling. Resolving this requires choosing binary features that survive these mutations. Jonas describes the spectrum of analytical methods, beginning with direct syntactic similarity:
| Dimension | Syntactic Matching (e.g., SSDEEP / Instruction Sequences) | |:--- |:--- | | **Method** | Compares instruction sequences side-by-side between functions | | **Speed** | Extremely fast and computationally lightweight | | **Resilience** | Very brittle; fails across compiler flags, architectures, or obfuscation | | **Best Use Case** | Identical codebases built with the exact same compiler toolchain |
Jonas explains that while comparing instruction sequences yields fast detections for nearly identical builds, its operational utility degrades instantly under minor environmental changes. As Jonas Wagner observes regarding basic instruction comparison: “So it's good, it's super fast, but very brittle. It's very easy to kind of get around that, even if you just add a compiler optimization flag.”
`20:00` Structural vs. Semantic Similarity and the Real-World Habits of Malware Authors
Moving up the abstraction ladder from raw bytes, the discussion turns to structural similarity—the technique utilized by tools like BinDiff and standard disassemblers. When analyzing a binary, analysts often inspect a function's control flow graph (CFG) and visually compare it against another. The underlying assumption is intuitive: if two control flow graphs share a similar structure, the control flow is likely identical, meaning the functions themselves perform similar work. While structural similarity holds up well against minor compiler variations or light obfuscation, aggressive techniques like control flow flattening intentionally shatter this structural layer.
Beyond structure lies the semantic layer: determining whether two pieces of binary code achieve the exact same operational outcome. Jonas Wagner and Endre Bangerter characterize semantic matching as the genuine "holy grail of code similarity," as it strips away all implicitly or explicitly introduced superficial variations. However, trying to formally extract semantics—such as using symbolic execution to mathematically prove code equivalence—is computationally expensive and fails to scale in high-throughput environments. Consequently, practical industrial and academic systems rely on structural graph similarity as a viable, lightweight proxy for semantic equivalence.
Despite theoretical vulnerabilities to techniques like control flow graph flattening or minor compiler optimization tricks, Endre Bangerter points out that real-world adversaries rarely employ such sophisticated transformations:
> “And the reality is they don't do that much in most cases. I could put it like this. which is good for us, which is good for all the people who write Yara rules.”
Malware authors predominantly rely on simple packing rather than exotic in-binary obfuscation. ThreatRay's capability to track malware families across thousands of samples via CFG similarity confirms this: if malware authors routinely deployed advanced obfuscators, ThreatRay's graph signatures would break down. The reality in the wild reveals a striking delta between academic worst-case scenarios and common practice. Much like Yara rules—which are theoretically trivial to evade yet remain remarkably effective in production across the security community—graph-based code similarity continues to function reliably because the majority of attackers stick to low-friction evasion methods.
- **Similarity Approaches**: - *Structural Similarity*: Analyzes control flow graphs (e.g., BinDiff); effective against common compiler variations, but breaks under control flow flattening. - *Semantic Similarity*: Measures actual program intent and behavior; highly robust against syntactic changes, but relies on computationally prohibitive methods like symbolic execution. - **Empirical Reality**: ThreatRay tracks malware families primarily through CFG code similarity; authors rarely use deep obfuscation beyond traditional packing layers.
```mermaid flowchart TD accTitle: Binary Code Similarity Comparison Hierarchy accDescr: Hierarchy comparing syntactic byte matching, structural graph matching, and semantic matching.
subgraph Layers ["Analysis Layers"] L1["Syntactic / Byte Level<br/>(Hashes, Yara rules)"] L2["Structural Level<br/>(Control Flow Graphs, BinDiff)"] L3["Semantic Level<br/>(Symbolic execution, behavioral intent)"] end
subgraph Tradeoffs ["Operational Tradeoffs"] T1["High speed / Fragile against compiler changes"] T2["Scalable proxy / Vulnerable to CFG flattening"] T3["Robust 'Holy Grail' / Computationally prohibitive to scale"] end
L1 -.-> T1 L2 -.-> T2 L3 -.-> T3 ```
---
`25:00` The LLM Shift and Pruning Goodware to Focus AI Analysis
Josh Stroschein observes that malware ecosystem dynamics often skew perceived sophistication. Commodity infostealers typically generate raw payloads and offload obfuscation to customers via packers, artificially inflating the volume of simplistic samples. In contrast, well-resourced nation-state adversaries build bespoke compiler toolchains that weave complex obfuscation directly into the binary layout, distorting the CFG without necessarily altering core instructions. Furthermore, modern generative AI dramatically lowers the barrier to building complex tooling: Josh recounts using an LLM to port the legacy Obfuscator-LLVM (OLLVM) project to modern build toolchains in just a single evening, warning that capable offensive actors can readily achieve similar pipeline automation.
If attackers leverage LLMs to generate bespoke, structurally unique malware families for every intrusion campaign, traditional pattern-matching and graph-based similarity models will lose their diagnostic efficacy. In that extreme scenario, defenders must shift toward semantic abstractions—identifying the fundamental operational reality of attacks (such as keylogging or code injection routines, which inevitably invoke recognizable API patterns) regardless of how the binary is structured.
Yet Endre Bangerter highlights a crucial, resilient application of code similarity that actually gains value in the LLM era: goodware and library identification. Malicious binaries are routinely bloated with statically linked open-source libraries, runtime boilerplate, and benign framework code. ThreatRay indexes known goodware to filter this noise out of their detection signatures. By combining goodware indexing with decompilation fed into LLMs, ThreatRay solves a core limitation of modern AI-driven reversing:
> “So LLM is much faster because only 50 functions instead of 1000 needs to be analyzed. There's less hallucination.”
In a binary containing 1,000 functions, graph similarity can rapidly classify 950 as standard third-party libraries. Instead of flooding an LLM with the entire binary—which triggers context exhaustion, severe hallucinations, and prohibitive latency—the similarity engine weeds out the legitimate baseline and isolates the remaining 50 unknown functions for targeted LLM inspection. Even in a future where adversaries use AI to synthesize distinct malicious logic for every engagement, that newly minted code will immediately stick out against enterprise goodware baselines and internal EDR prevalence telemetry.
- **Commodity vs. Advanced Threats**: Commodity malware authors rely on external crypters/packers, whereas advanced nation-state groups integrate custom obfuscation passes directly into compiler pipelines. - **Lowering Developer Barriers**: Josh demonstrated the practical power of LLMs by porting the entire legacy OLLVM toolchain to a modern compiler environment in one evening. - **Goodware Filtering**: ThreatRay applies binary similarity symmetrically to index known goodware and common libraries, filtering boilerplate out of signatures. - **Targeted AI Decompilation Pipeline**: - *Input*: 1,000-function binary. - *Similarity Stage*: Matches and discards 950 benign/library functions. - *LLM Reversing Stage*: Feeds only the remaining 50 unknown functions to the model, drastically reducing inference cost, analysis turnaround time, and hallucination rates. - **Detection via Prevalence**: Even if fully unique code is generated per target, the complete absence of benign code matching or historical fleet prevalence flags it inside enterprise EDR systems.
`30:00` Filtering Noise in Statically Compiled Binaries and the Limits of LLM Reversing
Endre Bangerter begins by noting that while cybersecurity remains an endless cat-and-mouse game, attackers churning out brand-new binaries for every single intrusion encounter their own operational bottlenecks around uniqueness. The natural defense strategy is to isolate unique novel logic from repeated standard code so that the truly malicious additions stand out. Once isolated, that residual code can be handed off to reverse engineers or fed into AI models for deeper inspection.
```mermaid flowchart TD accTitle: Filtering and Reversing Pipeline accDescr: A binary is separated into known code and unique code before AI analysis.
subgraph Ingestion["Binary Ingestion"] A["Statically Compiled Binary<br/>(Go / Rust: 10,000+ Functions)"] end
subgraph Filtering["Code Filtering"] B["Code Similarity Engine"] C["Known Good Code<br/>(Runtimes & Libraries)"] D["Unique Unknown Code<br/>(~500 Functions)"] end
subgraph Analysis["Targeted Analysis"] E["LLM / AI Reversing"] F["Human Analyst Review"] end
A --> B B --> C B --> D D --> E D --> F ```
Jonas Wagner emphasizes that code similarity provides immense leverage when confronting modern malware written in statically compiled languages like Go and Rust. In these environments, runtime routines, dependencies, and third-party libraries are baked directly into the executable, forcing an analyst to navigate thousands of functions upon opening a sample. Jonas argues:
> “There it becomes extremely handy if you can cleanly separate out what is known good code, either from the runtime or from any third-party libraries, and as a human or as a machine, only focus on what's left beyond that.”
Josh Stroschein concurs with the necessity of reducing that surface area before turning to automation, remarking:
> “I mean, if you give me 10,000 functions or 500, I'm going to hallucinate more on the 10,000 myself. So it would make sense that our LLMs are just going to do the same thing, at least right now.”
- Statically compiled binaries (Go, Rust) routinely introduce thousands of runtime and library functions into a single file. - Filtering out established dependencies leaves only the core logic for automated LLM reversing or human review. - Reducing function volume directly prevents human cognitive overload and curbs model hallucinations.
---
`31:37` Enriching Code Matching: Dynamic Telemetry and Semantic Propagation
Josh raises the question of whether binary similarity (BIN-SIM) models can incorporate broader external and runtime clues—such as dynamic sandbox executions, outbound IP connections, WHOIS lookups, and historical telemetry—to produce better matches and automated labels. Jonas explains that ThreatRay has deliberately adhered to a pure static analysis paradigm. A purely static framework avoids the overhead, evasion risks, and unreliability of forcing suspicious code to execute. Nonetheless, Jonas acknowledges that granular dynamic execution traces could theoretically help characterize behavior much more sharply within a machine learning pipeline.
Endre agrees with Josh's line of thought, asserting that raw code matching without context is fundamentally limited. Moving forward, attributing samples to accurate malware families must be augmented by rich contextual signals, whether through observed API calls or network infrastructure. Furthermore, Endre proposes an architectural hybrid between LLMs and binary similarity: because LLM-driven reverse engineering is computationally expensive and slow, an AI agent could thoroughly reverse a single instance of a routine, extract its functional semantics, and then propagate those semantic annotations across every related binary in the database using similarity indexing. Endre asserts:
> “I personally think the more context you can add to a piece of code, the more useful this similarity will become.”
- ThreatRay currently relies on purely static binary analysis to avoid the operational bottlenecks of sandboxing and dynamic execution. - Endre points out that dynamic behavior (such as sequential API invocations) is simply another layer of program semantics. - Reversing a function once via an LLM and using code similarity to propagate those semantic labels across matching functions across the corpus can yield massive speedups.
---
`35:00` The Intermediate Representation (IR) Debate: Lifting vs. Learning
Josh pivots the conversation to semantic extraction techniques, specifically lifting native machine instructions into an Intermediate Representation (IR) to strip away syntactic differences across CPU architectures. He notes that while projects have explored this space, writing generalized rules (like YARA signatures) at an IR level seems fraught with practical hurdles, and he asks for their take on the trade-offs.
Jonas outlines two fundamental schools of thought in binary code similarity:
1. **The IR/Lifting Approach:** Machine instructions are lifted to an intermediate language to eliminate variations generated by varying compiler optimization levels and target CPU architectures. While this produces cleaner code representation, it introduces a fragile and computationally heavy compilation/decompilation step. Jonas recalls that when ThreatRay initially investigated lifting, the underlying tooling was notoriously brittle. 2. **The Machine Learning Approach:** The similarity system bypasses lifting entirely. Instead, statistical or deep learning models are trained directly on raw binaries, learning to remain invariant to compiler variations and architectural shifts on their own without needing an intermediate abstraction layer.
Jonas observes that if IR and lifter ecosystems have matured into robust, stable toolchains in recent years, an IR-centric approach represents an exceptionally clean foundation for code representation.
---
`37:47` Real-World Scale: Connecting Unknown Samples to Threat Intelligence
Josh steers the discussion back to practical operations, highlighting that only a small circle of specialized reverse engineers analyze malware function by function. He asks how binary similarity delivers practical value at scale to frontline incident responders who recover an obfuscated, unfamiliar payload during an active breach.
Endre explains that responders primarily need immediate answers: identifying the malware family or discovering relevant contextual threat intelligence. To bridge this gap, ThreatRay automated an intelligence-gathering pipeline that indexes public threat data:
```mermaid flowchart LR accTitle: ThreatRay OSINT Ingestion Pipeline accDescr: ThreatRay crawls public blog posts, extracts hashes, fetches binaries, indexes their code, and links them to incident response queries.
subgraph Ingestion["OSINT Harvesting"] A["Threat Intelligence Blogs<br/>(e.g., Mandiant, Vendors)"] --> B["Extract Hashes & Indicators"] B --> C["Acquire Binary Samples"] end
subgraph Indexing["Code Processing"] C --> D["ThreatRay Code Similarity Index"] end
subgraph Application["Incident Response"] E["Unknown Incident Payload"] --> F["Similarity Query"] F --> D D --> G["Matched Blog Posts, Actor Context & Attribution"] end ```
ThreatRay actively crawls open-source threat intelligence (OSINT)—such as technical research blogs published by Mandiant and other cybersecurity vendors—to extract reported cryptographic hashes. They retrieve the underlying binaries and index their code down to the functional level. Consequently, when an incident responder encounters a novel, heavily obfuscated sample that yields no direct hash matches or obvious family attribution, ThreatRay's engine can match small fragments of code back to historical binaries detailed in specific research publications, immediately supplying the responder with adversary context and investigation leads.
- ThreatRay regularly harvests hashes from public threat intelligence publications, pulls the corresponding binaries, and indexes their internal code. - Even if a captured file shares no direct file hash with known threats, functional similarity can associate it with past campaign analyses and adversary reporting.
`40:00` Triage, Incident Response, and the Ambiguity of Detections
Even when code reuse is minimal or binaries are partially obfuscated, matching just a few functions can be sufficient to point an incident responder toward a relevant public blog post or analysis, unlocking the rest of an investigation. While the analyst must still read the report and perform follow-up research, having that anchor is radically better than confronting an unknown binary blindly. By filtering out standard library code beforehand, AI systems can also reliably infer and output the core capabilities of an unknown sample. As Endre Bangerter emphasizes regarding front-line triage:
> “I mean, these people in the end basically either care about the family or capability for a quick triage and I think these are problems you will be able to solve with AI.”
Josh Stroschein notes that this filtering and confident identification addresses a chronic pain point across the industry. When submitting a file hash to public and private multi-engine platforms, practitioners frequently receive a mixed bag of conflicting classifications. It is often impossible to know whether a tag is derived from genuine binary code similarity, an opportunistic IDS signature, or generic network heuristics. When responding to an incident where an infection might have been active for weeks or months, identifying a specific threat like RedLine Stealer helps shape persistence checks, but responders often have to assume a worst-case scenario regardless. Stroschein ponders the split between earlier prevention and post-breach detection, questioning how much post-infection classification actually alters response workflows versus preventing the compromise altogether.
```mermaid flowchart TD accTitle: Binary Filtering and Triage Flow accDescr: Processing unknown malware through library stripping to derive classification and capabilities.
subgraph Input ["Ingestion"] Raw["Unknown Binary Sample"] end
subgraph Processing ["ThreatRay Analysis"] Strip["Strip Library Code / Dependencies"] Match["Binary Similarity & AI Evaluation"] end
subgraph Output ["Incident Response Value"] Cap["Extract Malware Capabilities"] Fam["Identify Malware Family"] Report["Link to OSINT / Public Reports"] end
Raw --> Strip Strip --> Match Match --> Cap Match --> Fam Match --> Report ```
- When querying multi-scanner platforms, detection labels often bubble up from unrelated network signals or IDS alerts rather than verified code similarities. - Understanding whether an incident involves ransomware, an information stealer, or an APT fundamentally alters the incident response playbook.
---
`43:24` Retrospective Hunting and Searchable Binary Code
Jonas Wagner clarifies that ThreatRay positions itself at the far end of the operational lifecycle, focusing on deep post-incident investigation and authoritative classification. A core capability of their architecture is treating binary code as an indexable, searchable entity over millions of samples spanning more than a decade of data. Whenever a new threat signature or malware family is extracted from open-source intelligence (OSINT), the platform can reclassify its entire historical repository. This allows analysts to immediately uncover unrecorded historical variants or discover that an APT had deployed tools years before public disclosures.
> “So we see quite a lot of overlaps between kind of older variants or tools or families that were reported years later, and that's ultimately only possible because we treat binary code as a searchable entity.”
Unlike conventional retro-hunting workflows—which require analysts to craft targeted YARA rules and wait through long, computationally heavy retroactive scans—a pre-indexed code database surfaces past variants instantly. Endre adds that while classification and capability mapping dominate mainstream incident response, binary similarity delivers massive utility to intelligence analysts who must cluster unclassified samples, identify previously unknown families, and establish code lineage for actor attribution.
- Historical code indexing eliminates the latency and syntax burdens associated with manual retro-hunting via YARA. - Code clustering enables analysts to prioritize either densely populated clusters (widespread campaigns) or completely isolated samples (stealthy bespoke tooling). - Code lineage tracking exposes structural relationships across different malware generations and rival or allied threat actor groups.
---
`46:17` Verifiability and the Rise of Agentic AI
Trust in binary similarity requires rigorous transparency. Threat analysts and reverse engineers will not accept opaque, black-box declarations that two binaries are related; they need clear provenance. ThreatRay addresses this by exposing verification trails across both the algorithmic and intelligence layers. When a match is reported, the system shows the exact reference sample, the corresponding OSINT report, and the specific functions or assembly blocks that triggered the hit.
Looking forward, Endre highlights agentic AI as the breakthrough mechanism to democratize these niche, time-intensive intelligence workflows. While reversing and attributing an APT family across hundreds of related binaries typically requires an elite analyst to dedicate six to eight hours of uninterrupted effort, ThreatRay’s early internal trials demonstrated that pairing an AI agent with binary similarity APIs compressed that exact task to 20 minutes with equivalent conclusions:
> “Binary similarity and the data behind it, etc., will become a very important tool for agents, which delivers a very unique signal and the signal is precise.”
While raw LLMs are prone to hallucinations and non-deterministic speculation, feeding them verified binary similarity data gives them an objective, highly specialized ground truth on which they can build reliable automated investigations.
`50:00` The Agentic Future: Bringing Binary Analysis to the Front Lines
Endre Bangerter sketches out his vision of where binary analysis is inevitably heading: a paradigm shift toward autonomous agents that orchestrate a suite of classical analysis technologies rather than attempting to replace them. In this emerging ecosystem, decompilers, disassemblers, sandboxes, binary similarity engines, and PE file viewers are transformed into discrete lower-level tools invoked and intelligently combined by agents. Endre emphasizes that this development will finally make binary analysis mainstream. Currently, frontline Security Operations Center (SOC) personnel face massive hurdles when handling unknown binaries; constrained by time and lacking deep reverse engineering expertise, they typically submit a file to a sandbox and either get a useful behavioral report or hit a dead end, leaving them unable to perform deeper triage. By utilizing AI agents equipped with grounded, precise binary tools, the industry can democratize low-level analysis, allowing defenders to identify and stop threats much earlier in the attack lifecycle.
```mermaid flowchart TD accTitle: Agentic Binary Analysis Workflow accDescr: Diagram illustrating how an agent coordinates lower-level binary analysis tools to triage malware for SOC analysts and reverse engineers.
subgraph Agents ["Autonomous Agent Layer"] LLM["AI Orchestration Agent"] end
subgraph Tools ["Grounded Classical Tooling"] DIS["Disassemblers & Decompilers"] SIM["Code Similarity Engines"] SBX["Sandboxes & Dynamic Traces"] PEV["PE File Viewers & Parsers"] end
subgraph Defense ["Security Outcomes"] SOC["SOC Frontline: Rapid Triage"] RE["Senior RE: Deep Investigation"] end
LLM -->|"invokes & coordinates"| DIS LLM -->|"queries patterns"| SIM LLM -->|"gathers runtime behavior"| SBX LLM -->|"inspects metadata"| PEV
DIS & SIM & SBX & PEV -->|"synthesized findings"| LLM LLM -->|"early detection"| SOC LLM -->|"unpacks routine code"| RE ```
Josh Stroschein responds enthusiastically, noting that he has long advocated for technical security practitioners to build foundational reverse engineering skills. Without understanding how a binary interacts with the operating system at a granular level, triaging an unknown sample effectively remains nearly impossible. However, the steep learning curve and time commitment of reversing have historically kept it out of reach for most defenders. Bringing contextual analysis and code pattern similarity right to the front lines would represent a profound leap forward. Jonas Wagner seconds this optimism, sharing that his own hands-on work combining agents with ThreatRay's platform and traditional tools has proven extraordinarily empowering. He points out that this architecture allows someone with only moderate reversing ability to perform meaningful binary triage, while elite reverse engineers like Josh will be liberated from tedious boilerplate tasks. As Endre puts it: “And making binary analysis mainstream through agents which use precise tools on a lower level, that will make binary analysis accessible to much more people, and that's eventually very good because you need that capability early on in the defense process, right?”
- The shift toward agentic workflows relies on agents orchestrating traditional, grounded tooling (disassemblers, decompilers, PE viewers, sandboxes, and similarity platforms) rather than relying on pure LLM inference. - Democratizing binary analysis addresses the acute bottleneck in SOC environments where analysts lack the time and specialization to conduct deep manual reverse engineering. - Freeing senior reverse engineers from routine plumbing enables them to dedicate their focus to novel techniques and truly complex malware threats.
---
`52:45` The Persistent Hurdle of Obfuscation and the Rise of Anti-LLM Techniques
Despite the promise of agentic analysis, Josh expresses lingering skepticism when it comes to heavily obfuscated malware. He walks through the concrete structural challenges of binaries with scattered control flow, opaque predicates, and indirect control flow jumps. Standard static tools like IDA Pro fail to construct a clean control flow graph because they cannot resolve indirect execution branches without dynamic execution traces, binary patching, and laborious manual restitching. Josh questions whether LLMs can genuinely overcome these fundamental roadblocks, noting that while an answer may exist somewhere within the instructions, opaque layering makes program flow profoundly difficult to trace algorithmically.
```mermaid flowchart LR accTitle: Obfuscation Roadblock to LLM Analysis accDescr: Illustrating how indirect control flow disrupts both static disassemblers and LLMs until manual or dynamic reconstruction occurs.
A["Obfuscated Binary"] --> B["Indirect Control Flow & Splattered CFG"] B --> C["Disassembler Fails (IDA Pro)"] B --> D["LLM Loses Context & Reasoning"] C & D --> E["Requires Dynamic Execution & Manual Patching"] ```
Endre acknowledges that Josh’s reservations are entirely justified, clarifying that LLMs possess no magic bullet for deobfuscation. In fact, he argues that the widespread introduction of LLMs into automated malware reversing will inevitably trigger the next chapter in the cat-and-mouse game: the emergence of dedicated anti-LLM obfuscations engineered deliberately to induce LLM hallucination and failure. Jonas and Endre reject the idea that AI will wrap up reverse engineering challenges within a couple of years. In Endre's words: “The more we are throwing LLMs into malware reversing and automating this, I'm sure we will see also malware surfacing, which has anti-LLM obfuscation in there. Right. I mean, they will make the LLMs fail. And it's for sure not the end of the story, right? It's not like LLMs will solve everything and in two years we're done.”
- Indirect control flow and scattered execution graphs disrupt static disassembly tools and prevent LLMs from following code logic without external execution or patching. - Adversaries are expected to pivot toward anti-LLM obfuscation techniques designed specifically to cause AI reasoning agents to break or produce bogus output. - Automated deobfuscation remains an iterative, adversarial cycle rather than a solved problem.
---
`55:00` Adversarial Adaptation, the Fast-Moving AI Hype Cycle, and Closing Thoughts
Expanding on Endre's remarks, Josh outlines his thesis regarding the evolution of evasion. Most malware obfuscations encountered in the wild today were designed solely to slow down human analysts and bypass rudimentary static signature scanners. However, as automated AI-driven analysis expands, sophisticated threat actors will inevitably adapt. These adversaries will not simply resort to basic prompt injections; they will deploy structural, pattern-breaking code mutations engineered to undermine the mathematical models and tokenization logic of LLMs. Because LLMs fundamentally face the exact same structural challenges as humans—struggling equally when a control flow graph is fractured into indirect jumps—they will hit the same walls, requiring external tools to reconstruct execution traces and patch binaries.
Jonas reflects on the broader AI landscape, acknowledging that the past few years of intense AI hype have made it difficult to separate substantive technical utility from marketing noise. The field is developing at an overwhelming pace, where model capabilities and techniques learned just three months earlier are rapidly eclipsed by newer architectures. Jonas anticipates that this volatility will stabilize over the next couple of years, yielding a far clearer picture of how both attackers and defenders utilize these technologies in production.
Wrapping up the episode, Josh thanks both Jonas Wagner and Endre Bangerter for sharing their perspectives on binary similarity and the pragmatic integration of machine learning into malware analysis. Jonas thanks Josh for hosting the conversation, and Josh closes the show by reminding listeners to subscribe, leave a review, stay curious, and keep exploring.
- Traditional obfuscation was built to defeat static signatures and human analysts; future evasion will target AI tokenization and control flow parsing directly. - Anti-LLM evasion will move beyond textual prompt injections into code-level structural mutations that obscure intent from machine learning models. - The AI hype cycle is expected to settle over the next few years into realistic defensive and offensive operational baselines.
## Notable quotes > `52:45` The more we are throwing LLMs into malware reversing and automating this, I'm sure we will see also malware surfacing, which has anti-LLM obfuscation in there. — Endre Bangerter
> `46:17` Binary similarity and the data behind it, etc., will become a very important tool for agents, which delivers a very unique signal and the signal is precise. — Endre Bangerter
## Mentioned ThreatRay, Josh Stroschein, Jonas Wagner, Endre Bangerter, BinDiff, SSDEEP, YARA, IDA FLIRT, Ghidra BSim, MCRIT, Daniel Plohmann, abuse.ch, VirusTotal, Go, Rust, Obfuscator-LLVM, Mandiant, RedLine Stealer, IDA Pro
## Video description "Throwing more LLM prompts at a packed binary won’t make your analysis faster. But combining code similarity with AI will." In Episode 29 of Behind the Binary, Jonas Wagner and Endre Bangerter of ThreatRay join the podcast to lay out the real-world state of binary similarity in the LLM era. They demystify the current AI hype cycle, explaining why large language models are structurally unsuited for raw, unguided binary analysis, and how traditional binary similarity techniques are finding a ma...
[Source](https://www.buzzsprout.com/2414128/episodes/19802488-ep29-binary-similarity-in-the-llm-era-with-jonas-wagner-and-endre-bangerter-of-threatray.mp3)