arXiv:2610.25071cs.CROct 2026

Manuscript Offprint

arXiv:2610.25071

Locate, Then Reason: End-to-End Patch Presence Testing in Stripped Binaries

Huaijin Wang, Tongda Wang, Zhibo Liu, Yue Zhang, Shuai Wang, Pengfei Hu, Jianzhong Liu, Fangtian Zhong, Shaohua Wang

HUAIJIN WANG ∗^{*}, Shandong University, China

TONGDA WANG, Shandong University, China

ZHIBO LIU, Nanjing University, China

YUE ZHANG, Shandong University, China

SHUAI WANG, Hong Kong University of Science and Technology, Hong Kong SAR, China

PENGFEI HU, Shandong University, China

JIANZHONG LIU, Shandong University, China

FANGTIAN ZHONG, Shandong University, China

SHAOHUA WANG, Central University of Finance and Economics, China

Binary patch presence testing (PPT) determines whether a security fix is present in a stripped binary. Prior systems often assume that patch-relevant code is known or successfully matched. Function-level matching is brittle to compilation changes, inlining, finite model context, and missing usage context; moreover, similarity suppresses the patch-sized distinction needed for the verdict. We present PatchAlign, an end-to-end binary PPT workflow, which performs large-scale localization that maximizes recall economically, then the final verdict reasons for patch-specific evidence. PatchAlign uses instruction-aligned retrieval and caller-callee context to accurately locate patch-relevant binary code pieces, then screens the shortlist and compares target binary code with vulnerable and patched references using an LLM. Our experiments indicate that PatchAlign can precisely localize patch-relevant code and determine patch status without a target-location oracle.

ACM Reference Format:

Huaijin Wang, Tongda Wang, Zhibo Liu, Yue Zhang, Shuai Wang, Pengfei Hu, Jianzhong Liu, Fangtian Zhong, and Shaohua Wang. 2026. Locate, Then Reason: End-to-End Patch Presence Testing in Stripped Binaries. 1, 1 (October 2026), 21 pages. https://doi.org/10.1145/nnnnnnn.nnnnnnn

1 INTRODUCTION

Security fixes do not reach every downstream product at the same time [15, 43]. Vendors fork upstream projects and backport selected changes [43]. Their products may be available only as stripped binaries, without corresponding source releases or reliable patching information [15, 24]. Binary patch presence testing (PPT) asks whether a particular security patch is present in such a

∗^{*}Corresponding author

Authors' addresses: Huaijin Wang, Shandong University, China, huaijinwang@sdu.edu.cn; Tongda Wang, Shandong University, China, wangtongda@mail.sdu.edu.cn; Zhibo Liu, Nanjing University, China, zhiboliu@nju.edu.cn; Yue Zhang, Shandong University, China, zyueinfosec@gmail.com; Shuai Wang, Hong Kong University of Science and Technology, Hong Kong SAR, China, shuaiw@cse.ust.hk; Pengfei Hu, Shandong University, China, phu@sdu.edu.cn; Jianzhong Liu, Shandong University, China, liujianzhong@sdu.edu.cn; Fangtian Zhong, Shandong University, China, fzhong@sdu.edu.cn; Shaohua Wang, Central University of Finance and Economics, China, davidshwang@ieee.org.

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.

© 2026 Copyright held by the owner/author(s). Publication rights licensed to ACM.

ACM XXXX-XXXX/2026/10-ART

https://doi.org/10.1145/nnnnnnn.nnnnnnn

Huaijin Wang, Tongda Wang, Zhibo Liu, Yue Zhang, Shuai Wang, Pengfei Hu, Jianzhong Liu, Fangtian Zhong, and Shaohua Wang

binary and is therefore a basic capability for vulnerability assessment and patch management [15, 29, 38–40, 42].

Binary PPT is difficult because its signal is both small and unstable. A patch may change only a few source lines and compile into a handful of instructions, while the rest of the vulnerable and patched programs remains nearly identical [18, 38, 42]. At the same time, compiler choice and optimization can rewrite those instructions [16], reshape control flow [8, 34], and move a callee's code into its callers [2, 13]. An operational system must consequently solve two coupled problems: it must locate the code that implements the patch-related behavior and then decide whether that code implements the vulnerable or patched semantics [20, 38, 42].

End-to-End Binary PPT. Given a public source patch, source-mapped vulnerable and patched reference builds, and a stripped target binary, locate the patch-relevant code in the target—without an oracle for its function or address—and decide whether the target exhibits the vulnerable or patched behavior.

Several binary PPT systems perform patch verification on an affected target function that is supplied or identified beforehand [40–42]. Some take an affected function or entry address directly [40, 42]; others use a matching front end but cannot test a candidate that was never recovered [38, 39]. This condition is particularly restrictive under inlining: the affected source function can disappear as a standalone binary function even though its behavior remains inside a caller [15].

Binary code similarity analysis (BCSA) is a natural localization front end since it has been frequently applied to vulnerable function detection [5, 8, 20, 21, 33, 34, 44]. However, conventional function-level similarity does not directly solve end-to-end patch presence testing. Consider the tcpdump fix for CVE-2018-14461, which increases two bounds checks from 8 to 12 bytes [17]. In the optimized target binary, the affected function is inclined into a larger caller, so localization must recover its behavior within that caller [13]. Even after finding the correct code, coarse function-level similarity cannot establish whether both corrected checks protect the relevant accesses [27, 36]. This example motivates locating the relevant behavior first and then checking the patch-specific conditions.

Our Approach. We present PatchAlign, an end-to-end workflow that separates recall-oriented localization from patch-conditioned reasoning. Reference Patch Analysis derives patch-relevant functions and caller-callee contexts from known vulnerable and patched builds, and generates a reusable plan for distinguishing each pair's vulnerable and patched behavior. Semantic Localization searches CFG windows covering recovered functions and refines candidate rankings using instruction similarity and caller-callee context. Relevance Screening rejects incidental matches. Patch-Status Reasoning reuses the corresponding plan with both reference functions and the accepted target code, in assembly or decompiled code. The final binary verdict aggregates votes from all analyzed functions. The analysis pipeline requires neither symbols, source mappings, nor a location oracle of the target binary being analyzed.

We evaluate PatchAlign on a rebuilt, balanced version of the PS 3^{3} benchmark [40]. The evaluation compares prior systems, separates abstention coverage from decided-case accuracy, and examines localization, challenging patches, robustness, component contributions, and cost.

This paper makes the following contributions:

  • We identify limitations overlooked when binary PPT is treated only as function comparison: prior systems assume patch-relevant code is available, while function-level matching is brittle under compilation changes such as inlining; high similarity alone does not establish whether the security fix is present.

• We construct PatchAlign, an end-to-end binary PPT workflow that needs no target function or address. It combines recall-oriented, context-aware, and lightweighted semantic localization to locate patch-relevant binary code in the target binary; then it invokes relatively expensive reasoning model to patch presence reasoning.

• We perform a comprehensive evaluation for PatchAlign on a balanced benchmark with real-world CVEs against prior systems, covering end-to-end PPT, localization accuracy, and overhead measurement, demonstrating the essence of end-to-end PPT for binaries and the effectiveness of our new workflow.

References (13)