Skip to content

fix: drop protection runners a later layer puts in decoders and wrappers under --unsafe - #469

Merged
Sorte1 merged 3 commits into
mainfrom
fix/ox2-d6
Nov 21, 2026
Merged

Sorte1 merged 3 commits into
mainfrom
fix/ox2-d6

Conversation

@Sorte1

@Sorte1 Sorte1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

OX2-D6: --unsafe decoding when a later layer puts protection code inside an earlier layer's decoder machinery.

A later obfuscation layer inserts its call-controller runners (self-defending, console and debug-protection blocks) into the first function scope its own code calls. In layered output that is often an earlier layer's wrapper (function W(a, b) { <runners>; return D(a - 319, b); }), a decoder, or a call controller. The wrapper then has no wrapper shape, its forwarded call counts as a stateful-decoder escape, and the decoder reads outer bindings.

Changes:

  • Unsafe lane only: before the string array search, runner statements at the head of a function are dropped when the rest is a forwarded call, a decoder index shift, or a call-controller body. A runner is a call-controller declaration, x = C(this, fn) followed by x(), C(this, fn)(), or the (function () { C(this, fn)(); })() shell, where C has the call-controller shape. The head's own bindings and the function's parameters must not be used across the cut. If the function the wrapper forwards to (or the decoder itself) survives the run, the input is run once more without the strip.
  • Escape names the speculation carries (fix: fold a control-flow object that hides the decoder under --unsafe when its escapes all sit in branches #464, fix: decode an inner unit behind a decoded outer rotator or a debug timer under --unsafe #470) are checked once more after the protections and cleanup stages, so an escape that only a later stage removes no longer forces the rerun.
  • Call controllers whose runner function declares unread bare vars are recognised (both lanes).
  • A protection shell IIFE that self-defending removal leaves empty is removed with it (both lanes).

Full sweep, main @1d93a3ca vs this branch (3,465 cases, 2,189 run):

lane main this branch gained regressions
default 99.4% (13 fail) 99.4% (13 fail) 0 0
unsafe 98.1% (41 fail) 98.8% (27 fail) 14 0

Gained under unsafe: pw011-n3--objects, pw022-m3--console-test, pw022-m3--empty-log, pw022-m3--functions, pw022-m3--greeting, pw023-m3--classes, pw023-m3--control, pw024-m3--classes, pw024-m3--console-test, rnd011-n3--greeting, rnd031-m2--control, rnd031-m2--functions, rnd031-m3--control, rnd031-n3--strings. Default-lane verdicts are identical on every case.

Gates: obfuscator-io, -versions and -relayer BASELINEs 0 failed, 0 unexpected-pass. Krunker byte-identical in both lanes on all five versions; instruction counts within 1.4% of main (2.6.9 --unsafe +1.35%, others under 1%). Local untwist-ci --web green before the rebase over #459/#470 (three firefox UI tests failed under load and pass alone); after it the untwist and untwist-deobfuscate tests pass (one load-sensitive scaling test passes alone). Rows: runners-in-wrapper (pw022-m3--empty-log) decodes fully and prints the source's output; runner-in-decoder decodes under --unsafe and keeps the runner by default.

Still open in this cluster: pw011-n3 empty-log/greeting/console-test and pw011-m3 functions/objects/classes/control/mixed (wrapper aliases read before their declaration, and a decoder passed as a value to control-flow proxies whose object escapes outside branches), pw023-m3--greeting, rnd022-m3--control (a self-defending source reader survives, so the input is passed through unchanged).

…r --unsafe

A later obfuscation layer can put its call-controller runners (self-defending,
console and debug-protection blocks) at the top of an earlier layer's decoder
or wrapper. The wrapper then no longer has the wrapper shape and its forwarded
call counts as a decoder escape, or the decoder reads outer bindings. Under
--unsafe these runners are protections and are dropped before the string array
search, but only when the rest of the function is a forwarded call, a decoder
index shift or a call-controller body, and only while escape speculation is
open. If the forwarded decoder survives the run, the input is run again
without the strip.

Escapes a control-flow speculation deferred are now checked after the
protections and cleanup stages instead of at the end of the deobfuscate stage,
so escapes that only a later stage removes no longer force a rerun.

The call-controller shape allows unread bare var declarations in its runner.
@Sorte1
Sorte1 merged commit 5840f18 into main Nov 21, 2026
9 checks passed
@Sorte1
Sorte1 deleted the fix/ox2-d6 branch November 21, 2026 01:44

This branch was successfully deployed

1 active deployment
preview — 335f218a Deployed Nov 21, 2026 by Sorte1 via deploy #1372
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant