Skip to content

burakacar6/cs2-entitylist-python-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Counter-Strike 2 (CS2) Entity and Bone Data Retriever

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.


Features

  • Dynamic Offset Management: Automatically downloads up-to-date client.dll structures and offsets.json from the a2x/cs2-dumper repository.
  • Memory Manipulation: Safely reads the CS2 process memory using the pymem library.
  • 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) via m_pGameSceneNode to extract the 3D (X, Y, Z) coordinates of player bones.

Installation and Requirements

Ensure Python 3.x is installed on your system before running the script.

  1. Install Required Libraries:

    pip install pymem requests
  2. Run the Game: Counter-Strike 2 must be running in the background for the script to attach to the process.


Code Structure and Architecture

The core functionality is encapsulated within the TargetPosition class and split into three main methods:

1. config(self)

  • Attaches to the cs2.exe process and locates the base address of client.dll.
  • Downloads the latest JSON dumps from the remote repository to return the parsed client classes and offsets.

2. bones(self, entitypawn)

  • Accepts the memory pointer of a specific player pawn.
  • Navigates through the m_pGameSceneNode and m_modelState pointers 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.

3. get_target_position(self)

  • Decodes the Source 2 entity list array using structural chunk sizes and bit-masks.
  • Validates active CCSPlayerController objects and references them against their respective m_hPlayerPawn handlers.
  • Groups the processed skeleton data and positions into structured returns.
image

Contributing

If you want to optimize the performance or resolve existing architectural issues:

  1. Fork this repository.
  2. Create a feature branch (git checkout -b feature-name).
  3. Commit your changes (git commit -am 'Add specific optimization').
  4. Push to the branch (git push origin feature-name).
  5. Open a Pull Request.

About

this is updated script to find entity list and bones

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages