Skip to content

feat: add Python integrity verification with SHA-256#21

Open
Nigo-ly wants to merge 1 commit into
javelin-anticheat:mainfrom
Nigo-ly:main
Open

feat: add Python integrity verification with SHA-256#21
Nigo-ly wants to merge 1 commit into
javelin-anticheat:mainfrom
Nigo-ly:main

Conversation

@Nigo-ly

@Nigo-ly Nigo-ly commented Apr 21, 2026

Copy link
Copy Markdown

Summary

Implemented Python integrity verification for the Javelin Project.

What was added

Created with the following features:

  1. SHA-256 computation: Computes hash of the running script file using Python's

  2. Environment variable check: Compares the computed hash against env var

  3. Graceful handling:

    • If is not set → skips check (like C++ with )
    • If hash matches → passes, exits with code 0
    • If hash mismatch → fails, exits with code 1

Usage

91cf6df8bee4b9590599bc3a7386d9547cf4edcdc0b3a99c577ba1b8394579fc
[Javelin AntiCheat] Starting Python integrity check...
[Javelin AntiCheat] Integrity check FAILED!
Expected: your-hash-here
Current: 91cf6df8bee4b9590599bc3a7386d9547cf4edcdc0b3a99c577ba1b8394579fc
[Javelin AntiCheat] Integrity violation detected. Exiting.

Testing

  • ✅ No env var → skips check, exit 0
  • ✅ Wrong hash → fails, exit 1
  • ✅ Correct hash → passes, exit 0

Resolves issue #4

Implemented anti_cheat.py that:
- Computes SHA-256 of the script file
- Compares to JAVELIN_EXPECTED_SHA256 env var
- Exits with code 1 if integrity check fails
- Skips check if env var is not set

Resolves issue 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.

1 participant