Skip to content

Add engineering mandate to capemon developer skill note - #175

Open
doomedraven wants to merge 2 commits into
kevoreilly:capemonfrom
doomedraven:opt/skill-mandate
Open

Add engineering mandate to capemon developer skill note#175
doomedraven wants to merge 2 commits into
kevoreilly:capemonfrom
doomedraven:opt/skill-mandate

Conversation

@doomedraven

Copy link
Copy Markdown
Contributor

Introduces a strict systems-engineering rule to .gemini/skills/capemon-developer/SKILL.md forcing all future development sessions to automatically update docs/configuration.md when new configurable options are introduced.

@doomedraven
doomedraven force-pushed the opt/skill-mandate branch 4 times, most recently from 1f2eb39 to c056cae Compare August 19, 2026 11:54
Introduces a strict systems-engineering rule to .gemini/skills/capemon-developer/SKILL.md forcing all future development sessions to automatically update docs/configuration.md when new configurable options are introduced.
Update TLS mandate to permit __declspec(thread) for caching pointers
to dynamically-allocated TLS contexts (performance optimization) while
maintaining the ban on storing actual data structures.

This resolves the conflict with PR kevoreilly#162's TLS cache optimization,
which uses __declspec(thread) to cache the pointer returned by
TlsGetValue, avoiding repeated TLS API calls on the hot path.

The pattern is defensive: if the cache is NULL/uninitialized, the
code falls back to the full TlsGetValue path, ensuring compatibility
with older MSVC versions or edge-case DLL loading scenarios.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
doomedraven added a commit to doomedraven/capemon that referenced this pull request Aug 20, 2026
…fety

Three critical fixes to the anti-debugging/VM evasion hooks:

1. NtQueryInformationProcess: Replace magic numbers with named constants
   - Added ProcessDebugPort, ProcessDebugObjectHandle, ProcessDebugFlags
   - Improves code readability and maintainability

2. EnumDisplayDevicesW: Fix type declaration
   - Changed PDISTHREAD -> PDISPLAY_DEVICEW (correct Windows SDK type)
   - Removed unnecessary cast

3. EnumDisplayDevicesW: Add defensive null-termination
   - Ensure DeviceString is null-terminated before wcsstr calls
   - Add structure size validation (pDevice->cb check)
   - Prevents potential buffer over-read

These changes comply with the PR kevoreilly#175 safety mandates while
preserving the anti-evasion functionality.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
doomedraven added a commit to doomedraven/capemon that referenced this pull request Aug 20, 2026
…review findings

Based on systematic review of PRs kevoreilly#169-180, add critical safety mandates
that were discovered as common vulnerabilities:

1. TLS Macro Safety (CRITICAL):
   - Document the fallback context pattern (prevents NULL dereferences)
   - Mandate NULL checks after calloc before TlsSetValue
   - Note pre-existing hook_tls.c violations as technical debt

2. Ban Magic Numbers:
   - Require named constants for all API values
   - Example: ProcessDebugPort instead of literal 7

3. String Buffer Safety:
   - Mandate defensive null-termination before wcsstr/wcscpy
   - Require structure size validation via cb member

4. Type Safety:
   - Require correct Windows SDK types (PDISPLAY_DEVICEW vs PVOID)
   - Prevents ABI mismatches across compiler versions

5. Code Review Checklist:
   - 5-section systematic review checklist
   - Covers TLS, types, strings, hooks, and documentation
   - Based on real issues found in production PR reviews

These patterns directly address the bugs fixed in PRs kevoreilly#169, kevoreilly#170, kevoreilly#171,
and kevoreilly#172, ensuring future PRs won't repeat the same vulnerabilities.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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