Skip to content

feature: add Level 1 source-identity script uniquify.sh (#69) - #109

Closed
mcpolo99 wants to merge 1 commit into
developfrom
69-level1-uniquify-script
Closed

mcpolo99 wants to merge 1 commit into
developfrom
69-level1-uniquify-script

Conversation

@mcpolo99

Copy link
Copy Markdown
Owner

Level 1 — source identity (uniquify.sh) (#69)

Adds scripts/uniquify.sh, the Level-1 setup script: run once per environment with a --seed, it rewrites ConfuserExx's own source-level fingerprints so a rebuilt tool is not recognizable as ConfuserEx. Deterministic — the same seed always yields the same identifiers.

What it rewrites (kept in sync)

Fingerprint Rewritten
Runtime namespace Confuser.Runtime seed-derived name — synced across both sides: runtime namespace declarations and every obfuscator "Confuser.Runtime.<Type>" string literal (GetRuntimeType/Find)
Watermark default attribute ConfusedByAttribute seed-derived name

The assembly file name (Confuser.Runtime.dll) and the "Confuser.Runtime" service id are left intact on purpose: RuntimeService loads the runtime by file name and then resolves each type by its (now seed-derived) full name, so both still line up. The namespace is the primary Level-1 fingerprint (per the issue's own correction: it's Confuser.Runtime, not System.Core.Internal).

Deliberately deferred (not safe as text substitution)

Runtime type/method names (Constant, Resolve, Get, Value, …) are ordinary English words that also appear in unrelated code — renaming them safely needs a semantic/Roslyn rename, not sed. The runtime DLL rename and the anti-debug process-name checks are also left as follow-ups. Documented in the script header.

Flags

--seed <phrase> · --dry-run (preview, writes nothing) · --test (build + dotnet test) · --restore (reverts every touched file via git, tracked through a manifest kept under .git/ so it never pollutes the tree).

Validation

Applied with a sample seed → 0 stray Confuser.Runtime namespace decls / obfuscator strings → built Runtime + Protections → ran the runtime-injection tests (CompressorWithResx 12/12, AntiTamper normal+anti) proving GetRuntimeType still resolves the renamed types → --restore returned the tree to HEAD cleanly. The committed tree is unchanged; only the script is added.

Remaining on #69

  • Semantic type/method rename, runtime DLL rename, process-name checks (Level 1 follow-ups).
  • JIT-specific constant fingerprints (HookHandler rotation + feedback 0x3dbb2819).

Part of #69. Related: #106, #107, #108.

Adds scripts/uniquify.sh: a seeded, one-per-environment setup script that
rewrites ConfuserExx's own source-level fingerprints so a build is not
recognizable as ConfuserEx (Level 1 of the identity work).

It rewrites, deterministically from --seed:
  - the runtime namespace Confuser.Runtime -> a seed-derived name, kept in
    sync across both sides of the coupling: the runtime `namespace`
    declarations and every obfuscator "Confuser.Runtime.<Type>" string
    literal used by GetRuntimeType/Find. The assembly file name
    (Confuser.Runtime.dll) and the runtime-service id are left intact, so
    the runtime still loads by file name and its types still resolve by
    their new full name.
  - the watermark default attribute name ConfusedByAttribute.

Runtime TYPE/METHOD names (Constant, Resolve, Get, Value, ...) are ordinary
words that also occur in unrelated code, so they need a semantic (Roslyn)
rename rather than text substitution and are left for a follow-up, together
with the runtime DLL rename and the anti-debug process-name checks.

Flags: --seed, --dry-run, --test (build + dotnet test), --restore (reverts
every touched file via git, tracked through a manifest under .git/).

Validated: applied with a sample seed, built Runtime + Protections, ran the
runtime-injection tests (CompressorWithResx 12/12, AntiTamper normal+anti)
to prove GetRuntimeType still resolves the renamed types, then --restore
returned the tree to HEAD cleanly.
@mcpolo99

Copy link
Copy Markdown
Owner Author

Closing: this is Level-1 tool-binary identity only and does not change the protected output — the renamer already gives injected helper types random names + blank namespace per build, so the runtime namespace/type names never reach a finished assembly. Output uniqueness is covered by the Level-2 constant randomization (#106/#107/#108). Not worth carrying for output security.

@mcpolo99 mcpolo99 closed this Sep 21, 2026
@mcpolo99
mcpolo99 deleted the 69-level1-uniquify-script branch September 21, 2026 20:20
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