Skip to content

fix: decode string arrays hidden by later layers and dead-code copies - #452

Merged
Sorte1 merged 4 commits into
mainfrom
fix/ox2-d
Nov 19, 2026
Merged

Sorte1 merged 4 commits into
mainfrom
fix/ox2-d

Conversation

@Sorte1

@Sorte1 Sorte1 commented Nov 19, 2026

Copy link
Copy Markdown
Owner

OX2-D: string arrays, decoders and machinery that later layers or dead-code copies left encoded.

  • --unsafe: a decoder that is used as a value, or called with computed arguments, only inside branches (if/ternary/logical/switch) or inside function declarations nothing reads, is decoded speculatively. A wrapper that is only written again inside such branches is inlined on the same terms. If the decoder or wrapper is still in the program at the end of the deobfuscate stage, the input runs again without the speculation, so a live branch keeps its unit (row branch-escape-live).
  • The escape scan re-scanned the arguments of every nested proxy call once per ancestor, and storage templates for nested concat calls grew as options^depth. Strict scans are memoised per call, pending sites are deduplicated, and a storage template over 4096 nodes counts as unknown. pw021-m2 went from over the 768 MiB budget (and 4.8 GB at 8 GiB) to 0.3 s.
  • Default lane: new Error/Map/Set/Date/RegExp/... and bindings initialised with an object or array literal no longer count as possibly holding the global object; identifier computed keys no longer make an object literal hold it; the stage-end observation check uses the same quiet printers as the first check.
  • A one-entry latent outer array ([d(475)]) now triggers layered speculation (MIN_LATENT_ENTRIES 1), and a lone nested block (function () { { return a; } }) no longer hides the array function.
  • When the verified rerun keeps machinery because a reach obligation failed, the global-reach note is kept, so "decoder machinery kept" names its premise instead of standing bare.

Sweep (3,465 cases, base 16463ff, same inputs; 2,189 run):

  • default: fail 149 -> 59 (90 fail -> pass-kept, 3 pass-kept -> pass), 97.3% (was 93.2%)
  • unsafe: fail 248 -> 229 (19 fail -> pass), 89.5% (was 88.7%)
  • no pass -> fail and no kept -> fail in either lane.
  • u-strings cluster: 17 of 37 now pass under --unsafe (all of pw021-m2, pw012 n2/m2, pw006-n3, pw011-m2). Left: pw011 n2/n3/m3 and rnd011-n3 (15) print differently because console disabling and its call controller stay behind a control-flow object kept for a live-looking mutation (same output as main); pw012-n3 (5) has an outer decoder called from wrappers inside the inner decoder's own injected dead code.
  • d-notes cluster: 90 of 142 now pass with a premise note or decode; the 52 left are self-defending, debug-protection and console blocks, control-flow objects with a write outside the dead branch, and the rotator-not-sealed shape (pw010-m2).

Krunker samples: all 10 outputs byte-identical to main; instructions within 0.5% except 3.2.1 --unsafe at -5.4%.
Wasm 16,095,514 bytes, baseline 14,635,000 (cap 16,098,500).

…nder --unsafe and in the default lane

- --unsafe: decoders used as values or called with computed arguments only inside branches or never-called functions are decoded speculatively; if the decoder survives the stage the input runs again without that speculation
- --unsafe: a wrapper written again only inside such branches is inlined on the same terms
- the escape scan no longer doubles its work and pending sites per nested proxy call, and storage templates have a size cap
- built-in constructions, literal-initialised bindings and identifier computed keys no longer count as possibly holding the global object; observation settles with quiet printers
- a one-entry latent outer array triggers layered speculation; a lone nested block no longer hides the array function
- a failed reach obligation keeps the global-reach note in the rerun
@Sorte1
Sorte1 merged commit 2a6a584 into main Nov 19, 2026
14 of 16 checks passed
@Sorte1
Sorte1 deleted the fix/ox2-d branch November 19, 2026 06:22

This branch was successfully deployed

1 active deployment
preview — 4f2cb155 Deployed Nov 19, 2026 by Sorte1 via deploy #1297
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