Adds debug compilation for Mingw - #809
Merged
dledda-r7 merged 3 commits intoAug 11, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enables MinGW debug-tracing builds for Meterpreter by ensuring the debug logging implementation is compiled into each DLL target and by emitting debug-suffixed output artifacts when debug tracing is enabled.
Changes:
- Adds
../../source/logging/logging.cto the source list for metsrv, plugins, and extension DLL targets soDEBUGTRACEbuilds link successfully under MinGW. - Updates the
copyoutputCMake helper to copy debug-trace builds intooutput/using a*.debug.dllnaming convention. - Extends the
c/meterpreter/Makefileto passDBGTRACE/DBGTRACE_VERBOSEthrough to CMake and docker build targets.
Impact Analysis:
- Blast radius: medium — affects all Windows Meterpreter DLL build targets produced via the CMake workspace (metsrv, extensions, plugins) and the MinGW build workflows driven by
c/meterpreter/Makefile. - Data and contract effects: build artifact naming changes when
DBGTRACE/DBGTRACE_VERBOSEis enabled (outputs copied as*.debug.dll), which can affect any downstream tooling expecting non-debug filenames fromoutput/. - Rollback and test focus: rollback is straightforward (revert CMake/Makefile changes); validation should focus on MinGW builds with
DBGTRACE=ONandDBGTRACE_VERBOSE=ON, confirming successful linking and that expected*.debug.dlloutputs are produced inc/meterpreter/output/for metsrv + key extensions (e.g., priv/dump_sam resource path expectations).
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| c/meterpreter/workspace/screenshot/CMakeLists.txt | Includes debug logging source in the screenshot plugin build. |
| c/meterpreter/workspace/metsrv/CMakeLists.txt | Includes debug logging source in the core metsrv DLL build. |
| c/meterpreter/workspace/ext_server_winpmem/CMakeLists.txt | Includes debug logging source in the winpmem extension build. |
| c/meterpreter/workspace/ext_server_unhook/CMakeLists.txt | Includes debug logging source in the unhook extension build. |
| c/meterpreter/workspace/ext_server_stdapi/CMakeLists.txt | Includes debug logging source in the stdapi umbrella extension build. |
| c/meterpreter/workspace/ext_server_stdapi_webcam/CMakeLists.txt | Includes debug logging source in the stdapi_webcam extension build. |
| c/meterpreter/workspace/ext_server_stdapi_ui/CMakeLists.txt | Includes debug logging source in the stdapi_ui extension build. |
| c/meterpreter/workspace/ext_server_stdapi_sys/CMakeLists.txt | Includes debug logging source in the stdapi_sys extension build. |
| c/meterpreter/workspace/ext_server_stdapi_railgun/CMakeLists.txt | Includes debug logging source in the stdapi_railgun extension build. |
| c/meterpreter/workspace/ext_server_stdapi_net/CMakeLists.txt | Includes debug logging source in the stdapi_net extension build. |
| c/meterpreter/workspace/ext_server_stdapi_fs/CMakeLists.txt | Includes debug logging source in the stdapi_fs extension build. |
| c/meterpreter/workspace/ext_server_stdapi_audio/CMakeLists.txt | Includes debug logging source in the stdapi_audio extension build. |
| c/meterpreter/workspace/ext_server_sniffer/CMakeLists.txt | Includes debug logging source in the sniffer extension build. |
| c/meterpreter/workspace/ext_server_python/CMakeLists.txt | Includes debug logging source in the python extension build. |
| c/meterpreter/workspace/ext_server_priv/CMakeLists.txt | Includes debug logging source in the priv extension build (supports dump_sam debug resource expectations). |
| c/meterpreter/workspace/ext_server_powershell/CMakeLists.txt | Includes debug logging source in the powershell extension build. |
| c/meterpreter/workspace/ext_server_peinjector/CMakeLists.txt | Includes debug logging source in the peinjector extension build. |
| c/meterpreter/workspace/ext_server_lanattacks/CMakeLists.txt | Includes debug logging source in the lanattacks extension build. |
| c/meterpreter/workspace/ext_server_kiwi/CMakeLists.txt | Includes debug logging source in the kiwi extension build. |
| c/meterpreter/workspace/ext_server_incognito/CMakeLists.txt | Includes debug logging source in the incognito extension build. |
| c/meterpreter/workspace/ext_server_extapi/CMakeLists.txt | Includes debug logging source in the extapi extension build. |
| c/meterpreter/workspace/ext_server_espia/CMakeLists.txt | Includes debug logging source in the espia extension build. |
| c/meterpreter/workspace/ext_server_bofloader/CMakeLists.txt | Includes debug logging source in the bofloader extension build. |
| c/meterpreter/workspace/elevator/CMakeLists.txt | Includes debug logging source in the elevator plugin build. |
| c/meterpreter/workspace/dump_sam/CMakeLists.txt | Includes debug logging source in the dump_sam plugin build to generate debug-named DLLs. |
| c/meterpreter/workspace/CMakeListsFuncs.txt | Changes copyoutput() to emit *.debug.dll copies when debug tracing is enabled. |
| c/meterpreter/Makefile | Adds/propagates DBGTRACE and DBGTRACE_VERBOSE CMake options (including docker targets). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
msutovsky-r7
marked this pull request as ready for review
August 10, 2026 15:11
2 tasks
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
c/meterpreter/Makefile:15
- Important: Problem: these options are passed only when
DEBUGis defined, so CMake keeps themONin the reusedworkspace/build/mingw-*caches after a debug build. Impact: a subsequent ordinary build still compiles verbose tracing and emits.debug.dllartifacts until cleaned; Fix: explicitly pass both options asOFFin the non-debug branch.
ifdef DEBUG
COMMON_GEN += -DDBGTRACE=ON
COMMON_GEN += -DDBGTRACE_VERBOSE=ON
endif
Contributor
|
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.
Adds compilation variables
DBGTRACEandDBGTRACE_VERBOSEthat allow Mingw to compile debug payloads.