Expert capability for navigating, modifying, and extending the capemon malware monitoring codebase. Includes deep knowledge of Windows API hooking, PE structures, and the CAPEv2 sandbox architecture.
capemon is a sophisticated monitoring and instrumentation engine designed for malware analysis, configuration extraction, and payload recovery. It acts as the core injection component for the CAPEv2 sandbox.
capemon implements an extensive hooking engine derived from cuckoomon-modified, providing deep visibility into application behavior across multiple subsystems:
capemon implements a powerful in-process debugger independent of Windows debugging interfaces, but harnessing the capabilities of the processor:
'capemon' implements a powerful unpacking engine using a combination of techniques
Automated Static & Dynamic malware configuration extraction relies on 'capemon' capabilities
Integration of YARA for in-memory scanning
distorm for instruction decoding.libyara for pattern matching.Scylla for PE reconstruction.bson for data serialization.@docs/configuration.md: Whenever a new configurable option is introduced to the engine (such as log-format, sleep-skip-seconds, etc.), you must immediately append its documentation details to the appropriate table inside the configuration reference document to ensure the user and the system documentation are fully up-to-date.On a standard Windows development machine, MSBuild may not be present in the global PATH. You can locate it using PowerShell by running a query over the standard Microsoft Visual Studio or Build Tools installation directories:
Get-ChildItem -Path "C:\Program Files", "C:\Program Files (x86)" -Filter "MSBuild.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName
Typical installation paths include:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exeC:\Program Files (x86)\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exeThe capemon solution specifies the legacy Visual Studio 2017 (v141) platform toolset. If your local build system only has Visual Studio 2022 (v143) installed, you can compile successfully by dynamically overriding the platform toolset and disabling Whole Program Optimization (LTCG / Link-Time Code Generation) to prevent linker mismatches against precompiled static .lib dependencies (like libyara).
$msbuild = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe"
& $msbuild /m /p:Configuration=Release /p:Platform=Win32 /p:PlatformToolset=v143 /p:WholeProgramOptimization=false capemon.sln
$msbuild = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe"
& $msbuild /m /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /p:WholeProgramOptimization=false capemon.sln
When developing or integrating C++ components (such as the .NET profiler) into the capemon C codebase, adhere to these guidelines to prevent compiler/linker errors:
WinSock2.h before windows.h inside C++ files or headers to prevent legacy definitions from being pulled in by default:
#ifdef _MSC_VER
#include <WinSock2.h>
#endif
#include <windows.h>
corprof.h relies on definitions from cor.h and corhdr.h. To avoid compilation/syntax errors, use this exact order:
#include <unknwn.h>
#include <cor.h>
#include <corhdr.h>
#include <corprof.h>
Additionally, add #pragma comment(lib, "corguids.lib") in your source files to link the standard GUID definitions for COM callbacks and profiler interfaces.hooks.h): Never include hooks.h inside C++ files. hooks.h contains parameter declarations using this (which is a C++ keyword) and tentative global variable declarations (which cause LNK2005 duplicate symbol errors in C++). If you need to access monitor/dump functions like SetCapeMetaData and DumpMemoryRaw, declare them manually as extern "C" rather than including hooks.h or CAPE/CAPE.h.alloc.h): Since C++ does not support implicit conversion from void*, any allocation calls from alloc.h inline functions (e.g., cm_alloc, cm_calloc, cm_strdup) inside C++ compilation contexts must be explicitly cast to (char*) or the appropriate pointer type.Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer