Skip to content

Add .NET Profiling API fallback and anti-profiling mitigations - #192

Open
doomedraven wants to merge 2 commits into
kevoreilly:capemonfrom
doomedraven:opt/dotnet-profiler
Open

Add .NET Profiling API fallback and anti-profiling mitigations#192
doomedraven wants to merge 2 commits into
kevoreilly:capemonfrom
doomedraven:opt/dotnet-profiler

Conversation

@doomedraven

Copy link
Copy Markdown
Contributor

Implements the .NET Profiling API as a lab/debug fallback mode.

  • Adds profiler.h and profiler.cpp implementing ICorProfilerCallback2 for JIT monitoring and IL bytecode dumping.
  • Merges the DllGetClassObject COM export alongside AmsiDumper.
  • Proactively zeroes out COR_PROFILER, COR_ENABLE_PROFILING, and CORECLR_PROFILER from PEB->ProcessParameters->Environment.
  • Adds inline hooks for GetEnvironmentVariableA/W to return ERROR_ENVVAR_NOT_FOUND to mitigate higher-level C# anti-profiling checks (like ConfuserEx).

- Implemented ICorProfilerCallback2 in C++ (profiler.cpp/h) for JIT monitoring

- Integrated Profiler COM export directly into Capemon alongside AmsiDumper

- Scrubbed COR_PROFILER, COR_ENABLE_PROFILING, CORECLR_PROFILER from PEB block

- Hooked GetEnvironmentVariableW/A to return ERROR_ENVVAR_NOT_FOUND for profiler checks

- Updated MSVC build files to include the new profiler source
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