Goal
Make it effortless for users to collect and share diagnostic data when obfuscation fails. One CLI flag or one GUI button produces a complete, copy-pasteable report ready for a GitHub issue.
The Problem
When obfuscation crashes, users currently have to manually gather:
- What error/exception occurred
- What .NET framework they're targeting
- What protections were enabled
- What their system looks like
- The full log output
This is tedious, often incomplete, and slows down issue resolution. We frequently ask reporters for more context they don't have.
Proposed Solution — Standalone Diagnostic Service
A DiagnosticCollector that wraps the logger, accumulates everything during the run, and produces a structured report on completion — including on failure.
How It Works
- Before engine run: CLI (
--dump) or GUI (always-on) creates a DiagnosticCollector that wraps the real ILogger
- During run: The collector passes all log calls through to the real logger AND captures them internally
- After run (success or failure): The collector has everything — logs, context, timing. The
ILogger.Finish() callback always fires, even on crash
- On demand: CLI writes a report file. GUI enables a "Copy Diagnostic Report" button
What The Report Contains
## System
- OS: Windows 11 Pro 10.0.26100
- .NET Runtime: 10.0.0
- ConfuserExx Version: 1.7.0-alpha.42
## Project Configuration
- Target Framework: net8.0-windows
- Modules: MyApp.dll, MyLib.dll
- Protections: rename, ctrl flow, constants, anti tamper
- Packer: (none)
- Probe Paths: ...
## Obfuscation Result: FAILED
## Log Output
[DEBUG] Discovering plugins...
[INFO] Discovered 13 protections, 1 packers.
[INFO] Loading 'MyApp.dll'...
[WARN] Failed to resolve dependency 'SomeLib 2.0.0.0'
[ERROR] Failed to resolve type: System.Something
[ERROR] Exception: dnlib.DotNet.TypeResolveException: ...
at Confuser.Protections.Constants.EncodePhase.Execute()
at Confuser.Core.ProtectionPipeline.ExecuteStage()
## Elapsed: 4.2 seconds
Integration Points
CLI: --dump or --dump=report.md flag
- Wraps the logger with the collector
- On completion, writes the report file
- Path printed to console:
Diagnostic report written to: report.md
GUI: "Copy Diagnostic Report" button (visible after any run)
- Collector is always active during obfuscation
- Button appears in the protection output panel after run completes
- Copies the report to clipboard in markdown format
- Works after both successful and failed runs
Proposed Structure
Confuser.Core/Diagnostics/
DiagnosticCollector.cs — ILogger decorator, captures all log entries + timing
DiagnosticReport.cs — Formats collected data into markdown report
Confuser.CLI/Program.cs — --dump flag integration
ConfuserEx/ViewModel/UI/ — "Copy Report" button integration
Why This Matters
- Faster issue resolution — reporters provide complete context on first report
- Less back-and-forth asking "what framework?", "what protections?", "full log?"
- Standardized format makes issues searchable and comparable
- Builds trust with the community — professional tooling experience
Caveats
- The collector holds all log entries in memory during the run. For very large projects with verbose logging this could be significant. A reasonable cap (e.g., last 1000 lines) or log level filtering on the collector would mitigate this.
- The GUI button requires a small ViewModel change in the ConfuserEx project.
- Report format should be markdown for GitHub issue paste-ability, but could also support JSON for machine consumption in the future.
Related Issues
Goal
Make it effortless for users to collect and share diagnostic data when obfuscation fails. One CLI flag or one GUI button produces a complete, copy-pasteable report ready for a GitHub issue.
The Problem
When obfuscation crashes, users currently have to manually gather:
This is tedious, often incomplete, and slows down issue resolution. We frequently ask reporters for more context they don't have.
Proposed Solution — Standalone Diagnostic Service
A
DiagnosticCollectorthat wraps the logger, accumulates everything during the run, and produces a structured report on completion — including on failure.How It Works
--dump) or GUI (always-on) creates aDiagnosticCollectorthat wraps the realILoggerILogger.Finish()callback always fires, even on crashWhat The Report Contains
Integration Points
CLI:
--dumpor--dump=report.mdflagDiagnostic report written to: report.mdGUI: "Copy Diagnostic Report" button (visible after any run)
Proposed Structure
Why This Matters
Caveats
Related Issues