Skip to content

feature: symbol map reuse for consistent re-obfuscation (#26) - #96

Merged
mcpolo99 merged 2 commits into
developfrom
26-symbol-map-reuse-for-consistent-re-obfuscation-upstream-168
Jul 4, 2026
Merged

feature: symbol map reuse for consistent re-obfuscation (#26)#96
mcpolo99 merged 2 commits into
developfrom
26-symbol-map-reuse-for-consistent-re-obfuscation-upstream-168

Conversation

@mcpolo99

@mcpolo99 mcpolo99 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Implements InputSymbolMap (upstream mkaring#168 / yck1509#680) — feed a previous run's symbols.map back in so re-obfuscation produces the same obfuscated names across builds. This lets you patch already-deployed obfuscated software without replacing every assembly.

Fixes #26

How it works

The renamer already reuses a name if the original is in _originalToObfuscatedNameMap. This PR pre-populates that map from a previous symbols.map:

  • ConfuserProject gains an inputSymbolMap attribute (Save/Load/Clone + XSD schema entry — Load validates against the XSD).
  • NameService loads the map on construction (path relative to the project base dir). Missing file / parse errors log a warning and fall back to fresh names — never crash.
  • When a map is in use, names for all rename modes are recorded (not just Decodable/Sequential), so the exported symbols.map stays complete and chainable across successive builds.

Surfaces

  • CLI: --map=<file> flag.
  • GUI: an "Input Symbol Map" field in the project Advanced Settings dialog (text box with file drag-drop + browse button), bound to the project model.
  • .crproj: <project ... inputSymbolMap="previous/symbols.map">.

Backward compatible — with no map supplied, hasInputMap is false and every new path is skipped, so existing behaviour is unchanged.

Test

SymbolMapReuse.Test obfuscates the sample twice with different seeds:

  • run 2 (different seed + input map) → map equals run 1 (names reused)
  • control (different seed, no map) → map differs from run 1

This proves reuse is what causes the consistency. Existing renamer tests (MessageDeobfuscation, MethodOverloading) still green; full solution + GUI build clean.

RandomCrocodile added 2 commits July 4, 2026 16:13
Implements InputSymbolMap (upstream mkaring#168 / yck1509#680) so re-obfuscation
produces the same obfuscated names across builds — needed to patch already-deployed
obfuscated assemblies without replacing every module.

- ConfuserProject gains an inputSymbolMap attribute (Save/Load/Clone + XSD).
- NameService loads that map on construction and pre-populates the name maps, so the
  existing reuse path in ObfuscateName returns the previous obfuscated name for any
  original that appears in the map. Missing files / parse errors log a warning and
  fall back to fresh names.
- When an input map is in use, names for all rename modes are recorded (not just
  Decodable/Sequential), so the exported symbols.map stays complete and chainable.
- CLI --map flag sets InputSymbolMap for non-project runs.

Behaviour is unchanged when no map is supplied (hasInputMap gates all new paths).

Test: obfuscate twice with DIFFERENT seeds — with the input map the names match, and
a no-map control with the same second seed produces different names, proving reuse is
what causes the consistency. Existing renamer tests unaffected.
Completes the #26 GUI follow-up. The project's Advanced Settings dialog now has an
'Input Symbol Map' field (text box with file drag-drop + a browse button) bound to
ProjectVM.InputSymbolMap, so users can select a previous symbols.map from the GUI
for consistent re-obfuscation. Round-trips through the existing project save/load.
@mcpolo99
mcpolo99 merged commit 495ee4c into develop Jul 4, 2026
3 checks passed
@mcpolo99
mcpolo99 deleted the 26-symbol-map-reuse-for-consistent-re-obfuscation-upstream-168 branch July 4, 2026 14:32
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