Skip to content

fix: fold a control-flow object that hides the decoder under --unsafe when its escapes all sit in branches - #464

Merged
Sorte1 merged 6 commits into
mainfrom
fix/ox2-d3
Nov 20, 2026
Merged

Sorte1 merged 6 commits into
mainfrom
fix/ox2-d3

Conversation

@Sorte1

@Sorte1 Sorte1 commented Nov 20, 2026

Copy link
Copy Markdown
Owner

OX2-D3: --unsafe decoding when the decoder is hidden behind a control-flow object.

In multi-layer obfuscator.io output, the string decoder is often passed to the control-flow object's call proxies (f.qPqCs(decoder, "0x37")). The object could not be folded: dead-code injection had copied in a branch where it escapes (h[...](e, f)), and only the decoded strings show that branch is dead. Those strings could not be decoded while the decoder was still used as a value. So each blocked the other.

Change (unsafe lane only, inside the existing escape speculation):

  • A control-flow object can now be folded even when its writes and escapes are not inside a statically dead branch. This needs three things: every write and escape sits in a branch, the object has reads, and the program passes a decoder to some member call. The object's binding span and all its write and escape spans are deferred.
  • At the end of the deobfuscate stage, the run counts as verified only if none of those spans is still present as a symbol, an identifier reference, a binding identifier or a call. Otherwise the input is rerun with speculation off, giving main's output. The span check is new. Without it, a fold that substituted every read could drop the declaration and leave the escape behind.
  • The default lane is unchanged.

Rows: cfo-escape-in-branch (pw011-n2--functions) decodes fully and prints the source's output. cfo-live-escape has a live escape: the object is kept and the program prints what node prints.

Full sweep, main @d50bd48c 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 96.7% (73 fail) 97.1% (63 fail) 10 0

Gained under unsafe: pw011-n2--functions, pw011-n2--control, pw011-n3--strings, pw024-m3--empty-log, pw024-m3--greeting, pw024-m3--functions, rnd001-m3--functions, rnd001-m3--objects, rnd001-m3--strings, rnd001-m3--console-test.

Gates:

Still open (unsafe): rnd031-n3--strings and the rnd031-n2/n3 group. An outer unit's rotator that has already been decoded but is still kept now comes before the inner rotator, so the inner unit hits "code precedes the rotator". The stateful-decoder group (pw022-m3 x4: the string-array states class in statement form behind a compactness guard; pw011-m3, pw023-m3, rnd031-m2/m3--control). pw011-n3 and pw024-m3 classes/control/strings: decoders used as values inside other decoders' dead-injected bodies, or uses that only a later stage removes. pw023-m3/rnd031-m3: code before the rotator.

…tes all sit in branches, and rerun without it unless those uses are gone at the end

This branch was successfully deployed

1 active deployment
preview — d6de4e1c Deployed Nov 20, 2026 by Sorte1 via deploy #1348
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