feature: diagnostic report collector for issue reporting (#65) - #88
Merged
mcpolo99 merged 4 commits intoJul 4, 2026
Conversation
added 3 commits
July 4, 2026 11:37
Core of the diagnostic report collector: a DiagnosticCollector that decorates both ILogger and IProgressReporter, capturing a full-verbosity transcript, timing and outcome during an obfuscation run, plus a DiagnosticReport formatter that renders a self-contained markdown report. - Full-verbosity capture independent of display level; bounded ring buffer (last 2000 entries) with dropped-entry accounting. - Last-wins Finish so a packer's nested run does not clobber the top-level result/elapsed. - Redaction: never emits strong-name passwords; scrubs the user-profile path from config and log lines. Dynamic code-fence prevents markdown break-out. - 19 unit tests, TDD.
Wraps the logger and progress reporter with a DiagnosticCollector when --dump is passed, and writes the markdown report after the run completes (success or failure). --dump uses a default filename; --dump=<file> writes to a custom path. The report path is printed to the console. E2E test asserts the report is written with the expected sections.
The protect tab now wraps the logger and progress reporter with a DiagnosticCollector during each run. A 'Copy Report' button (enabled once a run completes, success or failure) copies the markdown diagnostic report to the clipboard for pasting into a bug report. Clipboard failures are swallowed so a transient lock cannot crash the app.
Lint Results
|
Reads each input module's TargetFrameworkAttribute (via dnlib, from an in-memory copy so the file is never locked) and adds a 'Target Framework' line to the report's configuration section. Best-effort: silently omitted when a module is missing, not a valid assembly, or predates the attribute (net2.0-3.5). Verified end-to-end — a net8 library reports '.NETCoreApp,Version=v8.0'; a failing run on an invalid assembly still produces a clean FAILED report. 4 new tests.
mcpolo99
force-pushed
the
65-diagnostic-report-collector-capture-crash-data-for-issue-reporting
branch
from
July 4, 2026 10:35
42630a8 to
760addb
Compare
mcpolo99
deleted the
65-diagnostic-report-collector-capture-crash-data-for-issue-reporting
branch
July 4, 2026 10:44
This was referenced Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the diagnostic report collector from #65. When obfuscation fails (or succeeds), users can now produce a complete, copy-pasteable markdown report with one CLI flag or one GUI button — system info, project configuration, run result, and the full log transcript.
Fixes #65
What was added
Core —
Confuser.Core/Diagnostics/DiagnosticCollector— decorates bothILoggerandIProgressReporter. Passes every call through to the real logger/reporter while capturing a full-verbosity transcript, timing, and outcome.DiagnosticReport— renders the captured data into a self-contained markdown report (System / Project Configuration / Result / Log Output / Elapsed). Never throws.DiagnosticRedactor— scrubs the user-profile path (%USER%) from text destined for a public report.CLI —
--dump/--dump=<file>flag. Wraps the logger+reporter, writes the report after the run (success or failure), prints the path.GUI — "Copy Report" button on the Protect tab, enabled once a run completes; copies the report to the clipboard.
Design notes — caveats and how they're handled
The issue's own "Caveats" section only named memory usage; hooking the logging core and pasting output publicly raised several sharper edges, all addressed:
SNKeyPassword,SNSigKeyPassword) are never emitted; absolute paths have the user-profile prefix replaced with%USER%, applied to both the config block and captured log lines (the engine'sPrintEnvironmentInfodumps assembly locations into the log stream too).Finish()moved toIProgressReporter(in the Replace custom ILogger with Serilog + Microsoft.Extensions.Logging #64 logging migration, so the issue text is stale): the collector decorates the progress reporter as well, giving it the authoritative success flag + timing.IsEnabled → true, entries always retained), so a report from a default Information run still contains the Debug detail needed to diagnose. Display filtering is preserved by only forwarding to the inner logger when it's enabled for that level.Finishis last-wins, so the top-level run — which finishes last — determines the reported outcome/elapsed.Known limitation
The sample report in the issue shows a "Target Framework" line, but
ConfuserProjecthas no TFM field, so it's omitted for now (the log output already shows the auto-detected runtime paths and the module). Could be added later as a best-effort read of the module'sTargetFrameworkAttribute.Testing
--dumpagainst the pre-built sample and asserts the report is written with the expected sections and no secret leakage.local-ci.sh): MSBuild build across all TFMs + entire test suite — all green.Example report