This project is a Python-based external tool that accesses the memory space of Counter-Strike 2 (cs2.exe) using the Source 2 engine architecture. It scans the entity list and retrieves the real-time 3D coordinates of player positions and bone structures.
The script fetches the latest memory offsets and client class structures directly from online JSON repositories. This dynamic fetching ensures the tool adapts to game updates with minimal manual code modification.
Disclaimer: This project is developed strictly for educational purposes and for analyzing the Source 2 engine architecture. Using memory manipulation tools on official online servers may result in a Valve Anti-Cheat (VAC) ban. The author assumes no responsibility for any misuse or consequences.
- Dynamic Offset Management: Automatically downloads up-to-date
client.dllstructures andoffsets.jsonfrom thea2x/cs2-dumperrepository. - Memory Manipulation: Safely reads the CS2 process memory using the
pymemlibrary. - Advanced Entity Loop: Parses the 64-player entity list using bit-shifting operations and chunk-index routing native to the Source 2 engine.
- Bone Position Extraction: Accesses the skeleton system (
CSkeletonInstance) viam_pGameSceneNodeto extract the 3D (X, Y, Z) coordinates of player bones.
Ensure Python 3.x is installed on your system before running the script.
-
Install Required Libraries:
pip install pymem requests
-
Run the Game: Counter-Strike 2 must be running in the background for the script to attach to the process.
The core functionality is encapsulated within the TargetPosition class and split into three main methods:
- Attaches to the
cs2.exeprocess and locates the base address ofclient.dll. - Downloads the latest JSON dumps from the remote repository to return the parsed client classes and offsets.
- Accepts the memory pointer of a specific player pawn.
- Navigates through the
m_pGameSceneNodeandm_modelStatepointers to access the character skeleton structure. - Loops through the memory to read and compile the
(X, Y, Z)floating-point coordinates for 30 distinct joint positions.
- Decodes the Source 2 entity list array using structural chunk sizes and bit-masks.
- Validates active
CCSPlayerControllerobjects and references them against their respectivem_hPlayerPawnhandlers. - Groups the processed skeleton data and positions into structured returns.
If you want to optimize the performance or resolve existing architectural issues:
- Fork this repository.
- Create a feature branch (
git checkout -b feature-name). - Commit your changes (
git commit -am 'Add specific optimization'). - Push to the branch (
git push origin feature-name). - Open a Pull Request.