Skip to content

feat: add Python implementation with SHA-256 integrity verification - #46

Open
key1989han wants to merge 2 commits into
javelin-anticheat:mainfrom
key1989han:python-integrity-check
Open

feat: add Python implementation with SHA-256 integrity verification#46
key1989han wants to merge 2 commits into
javelin-anticheat:mainfrom
key1989han:python-integrity-check

Conversation

@key1989han

Copy link
Copy Markdown

Summary

Added Python implementation of the Javelin AntiCheat with SHA-256 integrity verification, as requested in the issue.

Features

1. Debugger Detection

  • Platform-specific debugger detection (Windows API)
  • Python trace function detection (sys.gettrace())
  • Same exit code as C++ version (0xDEB)

2. Suspicious Process Scanning

  • Cross-platform process scanning (Windows/Linux/macOS)
  • Detects known cheating tools (Cheat Engine, x64dbg, IDA, etc.)
  • Same exit code as C++ version (0xBAD)

3. Self-Integrity Verification (SHA-256)

  • Computes SHA-256 hash of the script file
  • Compares against expected hash from environment variable
  • Non-matching hash results in guarded exit
  • Same exit code as C++ version (0xCRC)

Usage

Basic Usage

python AntiCheat.py

With Integrity Verification

# Set expected hash
export JAVELIN_EXPECTED_SHA256="your_sha256_hash_here"

# Run script
python AntiCheat.py

Exit Codes

Code Meaning
0 All checks passed
0xDEB Debugger detected
0xBAD Suspicious process detected
0xCRC Integrity check failed

Acceptance Criteria Met

  • ✅ Non-matching hash results in guarded exit (code 0xCRC)
  • ✅ Documented how to set expected values (README_PYTHON.md)
  • ✅ Cross-platform support (Windows, Linux, macOS)
  • ✅ No external dependencies (Python stdlib only)

Files Added

  • AntiCheat.py - Main Python implementation
  • README_PYTHON.md - Usage documentation

Comparison with C++ Version

Feature C++ Python
Debugger Detection
Process Scanning
Self-Integrity CRC32 SHA-256
Exit Codes 0xDEB, 0xBAD, 0xCRC 0xDEB, 0xBAD, 0xCRC

Fixes #4

…\n- Debugger detection (platform-specific + Python trace check)\n- Suspicious process scanning (cross-platform)\n- Self-integrity verification using SHA-256\n- Configurable expected hash via JAVELIN_EXPECTED_SHA256 env var\n- Same exit codes as C++ version for compatibility\n\nFixes javelin-anticheat#4
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.

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

1 participant