Anti-AIClone

Log date · Wed

Can recompilation verify decompiled code?

Matching assembly strengthens confidence in candidate code, but does not prove it is the original source. We compare three cases with Clang.

What does a recompilation match tell us?

Matching recompiled assembly gives strong evidence that a candidate corresponds to the target function, but it does not prove that the candidate is the original source. In our own sample, two different expressions produced identical function text at -O2; changing a constant or the optimization level made the text differ.

On 16 September 2026 at 14:14 UTC, Jun Bi and five co-authors submitted Echo, which uses this kind of check as feedback during search, not merely as a final acceptance test. [1] For teams protecting client logic, the practical question is which rules still ship in code delivered to users.

Our comparison
QuestionResult
Equivalent expressionsMultiply by 4 and shift left by 2 matched at -O2.
Changed valueChanging 7 to 8 produced different text.
Build configurationThe same source differed at -O0 and -O2.
Original source recovered?No: different source can produce the same code.

Verification and search in the paper

Echo (arXiv 2609.18706, v1, classified cs.CR and cs.AI) addresses matching decompilation: finding candidate source whose recompiled assembly matches the target. Its model proposes programs and compiler configurations, uses assembly similarity to guide iteration, and applies rule-based, neural and reasoning-based refinement to remaining differences. [1] The compiler supplies checkable feedback, but the search still spans source, compiler and build options.

The abstract reports an average of 2.43 times as many exact matches as the strongest baseline on function-level benchmarks. On the Mirai malware binary it reports 2.75 times as many matched functions as GPT-5.6 and 7.4 times as many as Codex. These are relative counts under the paper’s evaluation conditions, not success rates for arbitrary applications.

A function-level match does not automatically recover project structure, comments, original variable names or the complete build. Even with a credible result, check calling conventions, surrounding state and dependencies; matching one function and reconstructing an application have different acceptance scopes.

Observe the distinction on a small sample

We compiled three unsigned C functions of our own with Apple clang 21.0.0 on arm64 macOS, comparing assembly text from the function label through .cfi_endproc, including instructions and assembler directives. This is an illustration of the underlying idea with another tool, not a reproduction of Echo, its benchmarks or obfuscated artifacts. Unsigned arithmetic makes the two candidate expressions equivalent under the type’s arithmetic rules.

Functions in three separate files: target, equivalent candidate, changed candidate.
unsigned price(unsigned x) { return x * 4u + 7u; }
unsigned price(unsigned x) { return (x << 2) + 7u; }
unsigned price(unsigned x) { return x * 4u + 8u; }

Clang’s -S option emits an assembly file. [2] We held compiler and target fixed, compiled at -O2, then compiled the target source again at -O0. The results below are from our run. The comparison covers selected function text, not the whole object file or linked binary.

Comparison results from our run.
target-O2 vs equivalent: match
target-O2 vs changed: different
target-O2 vs target-O0: different

In the -O2 output, the target’s add instruction uses #7 and the changed candidate uses #8. A comparison identifies a mismatch but does not by itself explain whether source or build settings caused it. Conversely, the equivalent candidate’s match shows that machine code cannot uniquely establish whether the author wrote multiplication or a shift.

Recommendations for interpreting a match

These are engineering recommendations, not protection effects measured by our experiment. First identify the business decision and its trust boundary, then choose checks and acceptance criteria.

Recommendations by situation
SituationRecommendation
A core decision can run onlineKeep the authoritative decision on the server; validate input and permissions.
The decision must run offlineAssume client rules can be analyzed; bound offline grants and their lifetime.
Comparing release buildsFix architecture, tool version and compiler options; record differences.
Using obfuscationEvaluate readability and compatibility on real release artifacts; a failed match is not proof of protection.

Moving a decision server-side can add latency and require connectivity, and the interface needs abuse controls. An offline design needs explicit revocation delays and behavior after expiry. Retaining an unobfuscated baseline and its corresponding transformed build makes it easier to compare readability and functional regressions in the same version, rather than attributing unrelated build differences to protection.

Check your own build

To compare your own code, first generate assembly for a function you are authorized to inspect in an isolated directory and record the target architecture, compiler version and complete options. Replace the paths and options below with your project’s configuration.

Replace the path and build options.
clang --version
clang -O2 -S path/to/your-function.c -o your-function.s

Define the comparison first: text, machine instructions, one function or an entire binary. Assembly comments, labels and metadata can also create text differences; relocation, linking and target platform affect broader comparisons. Save build records and actual differences, then use functional tests on boundary inputs. A single match or mismatch is not a complete security conclusion.

Your checklist

  • Inventory client-side core decisions and assess server-side execution.
  • Record the architecture, compiler and options of release builds.
  • Keep baseline and transformed artifacts from the same version.
  • Define the comparison scope and inspect differences and boundary inputs.
  • Set expiry and revocation rules for offline grants.

Primary sources

All sources and reproduction status ↗