Skip to content

feat: add SHA-256 integrity verification for C++ and Python (#4)#14

Open
promisingcoder wants to merge 1 commit intojavelin-anticheat:mainfrom
promisingcoder:feat/integrity-verification-4
Open

feat: add SHA-256 integrity verification for C++ and Python (#4)#14
promisingcoder wants to merge 1 commit intojavelin-anticheat:mainfrom
promisingcoder:feat/integrity-verification-4

Conversation

@promisingcoder
Copy link
Copy Markdown

Description

Implements optional SHA-256 integrity verification for both C++ and Python implementations, as requested in #4.

/claim #4

Changes

C++ (AntiCheat.cpp)

  • Added SHA-256 computation using Windows-native bcrypt.h (BCryptHashData) — no external dependencies
  • Added JAVELIN_EXPECTED_SHA256 build-time constant (defaults to "" = disabled)
  • Added checkSelfIntegritySHA256() function that reads the running executable, computes SHA-256, and compares to expected hex
  • Called in main() after existing CRC32 check — exits with 0x54A on mismatch
  • Existing CRC32 check left intact

Python (anti_cheat.py) — new file

  • compute_sha256(filepath) — returns hex digest using hashlib
  • verify_integrity() — checks SHA-256 against JAVELIN_EXPECTED_SHA256 env var
  • Skips verification when env var is not set (optional verification)
  • Exits with code 1 on mismatch
  • Also includes basic anti-cheat functions (detect_suspicious_processes, is_debugger_present)

Documentation (README.md)

  • Full setup instructions for both C++ and Python SHA-256 verification
  • How to compute expected hash values (PowerShell, bash, Python methods)
  • Exit code reference table
  • API reference

Acceptance Criteria

  • Non-matching hash results in guarded exit (both C++ and Python)
  • Document how to set the expected values

fixes #4

…anticheat#4)

- C++: Add SHA-256 self-integrity check using Windows BCrypt API alongside existing CRC32
- Python: Create anti_cheat.py with SHA-256 verification, debugger detection, and suspicious process scanning
- Docs: Update README with usage instructions for both implementations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add Integrity Verification (Hash of Executable/Script)

1 participant