| Name | cinagu JSON |
| Version |
0.1.4
JSON |
| download |
| home_page | https://github.com/James7688/cinagu |
| Summary | A Python package for detecting cheats and hacks in various games. |
| upload_time | 2024-08-04 06:58:54 |
| maintainer | None |
| docs_url | None |
| author | Quy Anh Nguyen |
| requires_python | >=3.6 |
| license | None |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# Cinagu
Cinagu is a Python package designed to detect cheats and hacks in various games such as chess and shooting games. It provides tools to identify aimbots, wallhacks, and unauthorized scripts, as well as abnormal moves in chess games.
## Features
- **Chess Cheat Detection**:
- Detects abnormal moves and cheating patterns in chess games.
- **Shooting Game Cheat Detection**:
- Detects aimbots based on mouse movement patterns.
- Detects wallhacks by analyzing player visibility through walls.
- Detects unauthorized scripts and macros.
- **Game Integration**:
- Can be integrated with various game engines such as Ursina, Panda3D, Pygame, etc.
## Installation
You can install Cinagu using pip:
```bash
pip install cinagu
```
## Usage
### Chess Cheat Detection
**Detecting Abnormal Moves**
To detect abnormal moves in a chess game, use the`detect_abnormal_moves` function from the cinagu.chess_detection module. This function analyzes the moves from a PGN game object.
```python
from cinagu.chess_detection import detect_abnormal_moves
import chess.pgn
from io import StringIO
# Example PGN data
pgn_data = """
[Event "Test"]
[Site "Test"]
[Date "2024.08.04"]
[Round "1"]
[White "Player1"]
[Black "Player2"]
[Result "*"]
1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7
"""
# Create a PGN game object
pgn = StringIO(pgn_data)
game = chess.pgn.read_game(pgn)
# Detect abnormal moves
abnormal_moves = detect_abnormal_moves(game)
print(f'Abnormal Moves Detected: {abnormal_moves}')
```
**Detecting Cheating Patterns**
To detect cheating patterns in a chess game, use the `detect_cheating_pattern` function. This function analyzes the PGN game object for cheating patterns.
```python
from cinagu.chess_detection import detect_cheating_pattern
import chess.pgn
from io import StringIO
# Example PGN data
pgn_data = """
[Event "Test"]
[Site "Test"]
[Date "2024.08.04"]
[Round "1"]
[White "Player1"]
[Black "Player2"]
[Result "*"]
1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7
"""
# Create a PGN game object
pgn = StringIO(pgn_data)
game = chess.pgn.read_game(pgn)
# Detect cheating patterns
is_cheating = detect_cheating_pattern(game)
print(f'Cheating Pattern Detected: {is_cheating}')
```
### Shooting Game Cheat Detection
**Detecting Aimbots**
To detect aimbots in a shooting game, use the detect_aimbot function from the `cinagu.shooting_detection` module. This function analyzes the mouse movements.
```python
from cinagu.shooting_detection import detect_aimbot
# Example list of mouse movements with their speeds
mouse_movements = [
{'speed': 1200},
{'speed': 500},
{'speed': 1300},
{'speed': 100},
{'speed': 2000}
]
# Detect aimbot
is_aimbot = detect_aimbot(mouse_movements)
print(f'Aimbot Detected: {is_aimbot}')
```
**Detecting Wallhacks**
To detect wallhacks in a shooting game, use the `detect_wallhack` function. This function analyzes the player's position and visibility.
```python
from cinagu.shooting_detection import detect_wallhack
# Example player position and visible players
player_position = (0, 0)
visible_players = [{'position': (1, 1)}]
game_map = MockGameMap() # Replace with actual game map object
# Detect wallhack
is_wallhack = detect_wallhack(player_position, visible_players, game_map)
print(f'Wallhack Detected: {is_wallhack}')
```
**Detecting Unauthorized Scripts**
To detect unauthorized scripts in a shooting game, use the `detect_script` function. This function analyzes the player's actions.
```python
from cinagu.shooting_detection import detect_script
# Example list of player actions
player_actions = [{'pattern': 'auto-fire'}]
# Detect unauthorized scripts
is_script = detect_script(player_actions)
print(f'Script Detected: {is_script}')
```
### Integrating with a Game Engine
To integrate Cinagu with a game engine, use the integrate_with_game function from the cinagu.game_integration module. This function sets up the cheat detection to run within the game loop.
Example with a Mock Game Engine:
Here’s an example of how to integrate the detection functions with a mock game engine. Replace MockGameEngine, MockPlayer, and MockGameMap with your actual game engine components.
```python
from cinagu.game_integration import integrate_with_game
from cinagu.shooting_detection import detect_aimbot, detect_wallhack, detect_script
# Mock game engine (replace with Ursina, Panda3D, Pygame, etc.)
class MockGameEngine:
def __init__(self):
self.players = []
def get_players(self):
return self.players
def get_map(self):
return MockGameMap()
def set_update_callback(self, update_func):
self.update_func = update_func
def run(self):
# Simulate game loop
for _ in range(10): # Run for 10 frames
self.update_func()
class MockPlayer:
def __init__(self):
self.mouse_movements = [
{'speed': 1200},
{'speed': 500},
{'speed': 1300},
{'speed': 100},
{'speed': 2000}
]
self.position = (0, 0)
self.visible_players = [{'position': (1, 1)}]
self.actions = [{'pattern': 'auto-fire'}]
def get_mouse_movements(self):
return self.mouse_movements
def get_position(self):
return self.position
def get_visible_players(self):
return self.visible_players
def get_actions(self):
return self.actions
class MockGameMap:
def is_wall_between(self, pos1, pos2):
return pos1 == (0, 0) and pos2 == (1, 1)
# Set up the mock game engine
game_engine = MockGameEngine()
player = MockPlayer()
game_engine.players.append(player)
# Integrate cheat detection with the game engine
detection_functions = {
'aimbot': detect_aimbot,
'wallhack': detect_wallhack,
'script': detect_script
}
integrate_with_game(game_engine, detection_functions)
# Run the mock game
game_engine.run()
```
### Contact
Quy Anh Nguyen - quyanh082013@gmail.com
Raw data
{
"_id": null,
"home_page": "https://github.com/James7688/cinagu",
"name": "cinagu",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Quy Anh Nguyen",
"author_email": "quyanh082013@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c4/c9/f3e9dc656dea8182465ceb260be17be78a829b99fc7ab0288b21d7bf3707/cinagu-0.1.4.tar.gz",
"platform": null,
"description": "# Cinagu\r\n\r\nCinagu is a Python package designed to detect cheats and hacks in various games such as chess and shooting games. It provides tools to identify aimbots, wallhacks, and unauthorized scripts, as well as abnormal moves in chess games.\r\n\r\n## Features\r\n\r\n- **Chess Cheat Detection**:\r\n - Detects abnormal moves and cheating patterns in chess games.\r\n\r\n- **Shooting Game Cheat Detection**:\r\n - Detects aimbots based on mouse movement patterns.\r\n - Detects wallhacks by analyzing player visibility through walls.\r\n - Detects unauthorized scripts and macros.\r\n\r\n- **Game Integration**:\r\n - Can be integrated with various game engines such as Ursina, Panda3D, Pygame, etc.\r\n\r\n## Installation\r\n\r\nYou can install Cinagu using pip:\r\n\r\n```bash\r\npip install cinagu\r\n```\r\n\r\n## Usage\r\n\r\n### Chess Cheat Detection\r\n\r\n**Detecting Abnormal Moves**\r\n\r\nTo detect abnormal moves in a chess game, use the`detect_abnormal_moves` function from the cinagu.chess_detection module. This function analyzes the moves from a PGN game object.\r\n\r\n```python\r\nfrom cinagu.chess_detection import detect_abnormal_moves\r\nimport chess.pgn\r\nfrom io import StringIO\r\n\r\n# Example PGN data\r\npgn_data = \"\"\"\r\n[Event \"Test\"]\r\n[Site \"Test\"]\r\n[Date \"2024.08.04\"]\r\n[Round \"1\"]\r\n[White \"Player1\"]\r\n[Black \"Player2\"]\r\n[Result \"*\"]\r\n\r\n1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7\r\n\"\"\"\r\n\r\n# Create a PGN game object\r\npgn = StringIO(pgn_data)\r\ngame = chess.pgn.read_game(pgn)\r\n\r\n# Detect abnormal moves\r\nabnormal_moves = detect_abnormal_moves(game)\r\nprint(f'Abnormal Moves Detected: {abnormal_moves}')\r\n```\r\n\r\n**Detecting Cheating Patterns**\r\n\r\nTo detect cheating patterns in a chess game, use the `detect_cheating_pattern` function. This function analyzes the PGN game object for cheating patterns.\r\n\r\n```python\r\nfrom cinagu.chess_detection import detect_cheating_pattern\r\nimport chess.pgn\r\nfrom io import StringIO\r\n\r\n# Example PGN data\r\npgn_data = \"\"\"\r\n[Event \"Test\"]\r\n[Site \"Test\"]\r\n[Date \"2024.08.04\"]\r\n[Round \"1\"]\r\n[White \"Player1\"]\r\n[Black \"Player2\"]\r\n[Result \"*\"]\r\n\r\n1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7\r\n\"\"\"\r\n\r\n# Create a PGN game object\r\npgn = StringIO(pgn_data)\r\ngame = chess.pgn.read_game(pgn)\r\n\r\n# Detect cheating patterns\r\nis_cheating = detect_cheating_pattern(game)\r\nprint(f'Cheating Pattern Detected: {is_cheating}')\r\n```\r\n\r\n### Shooting Game Cheat Detection\r\n\r\n**Detecting Aimbots**\r\n\r\nTo detect aimbots in a shooting game, use the detect_aimbot function from the `cinagu.shooting_detection` module. This function analyzes the mouse movements.\r\n\r\n```python\r\nfrom cinagu.shooting_detection import detect_aimbot\r\n\r\n# Example list of mouse movements with their speeds\r\nmouse_movements = [\r\n {'speed': 1200},\r\n {'speed': 500},\r\n {'speed': 1300},\r\n {'speed': 100},\r\n {'speed': 2000}\r\n]\r\n\r\n# Detect aimbot\r\nis_aimbot = detect_aimbot(mouse_movements)\r\nprint(f'Aimbot Detected: {is_aimbot}')\r\n```\r\n\r\n**Detecting Wallhacks**\r\n\r\nTo detect wallhacks in a shooting game, use the `detect_wallhack` function. This function analyzes the player's position and visibility.\r\n\r\n```python\r\nfrom cinagu.shooting_detection import detect_wallhack\r\n\r\n# Example player position and visible players\r\nplayer_position = (0, 0)\r\nvisible_players = [{'position': (1, 1)}]\r\ngame_map = MockGameMap() # Replace with actual game map object\r\n\r\n# Detect wallhack\r\nis_wallhack = detect_wallhack(player_position, visible_players, game_map)\r\nprint(f'Wallhack Detected: {is_wallhack}')\r\n```\r\n\r\n**Detecting Unauthorized Scripts**\r\n\r\nTo detect unauthorized scripts in a shooting game, use the `detect_script` function. This function analyzes the player's actions.\r\n\r\n```python\r\nfrom cinagu.shooting_detection import detect_script\r\n\r\n# Example list of player actions\r\nplayer_actions = [{'pattern': 'auto-fire'}]\r\n\r\n# Detect unauthorized scripts\r\nis_script = detect_script(player_actions)\r\nprint(f'Script Detected: {is_script}')\r\n```\r\n\r\n### Integrating with a Game Engine\r\n\r\nTo integrate Cinagu with a game engine, use the integrate_with_game function from the cinagu.game_integration module. This function sets up the cheat detection to run within the game loop.\r\n\r\nExample with a Mock Game Engine:\r\n\r\nHere\u2019s an example of how to integrate the detection functions with a mock game engine. Replace MockGameEngine, MockPlayer, and MockGameMap with your actual game engine components.\r\n\r\n```python\r\nfrom cinagu.game_integration import integrate_with_game\r\nfrom cinagu.shooting_detection import detect_aimbot, detect_wallhack, detect_script\r\n\r\n# Mock game engine (replace with Ursina, Panda3D, Pygame, etc.)\r\nclass MockGameEngine:\r\n def __init__(self):\r\n self.players = []\r\n\r\n def get_players(self):\r\n return self.players\r\n\r\n def get_map(self):\r\n return MockGameMap()\r\n\r\n def set_update_callback(self, update_func):\r\n self.update_func = update_func\r\n\r\n def run(self):\r\n # Simulate game loop\r\n for _ in range(10): # Run for 10 frames\r\n self.update_func()\r\n\r\nclass MockPlayer:\r\n def __init__(self):\r\n self.mouse_movements = [\r\n {'speed': 1200},\r\n {'speed': 500},\r\n {'speed': 1300},\r\n {'speed': 100},\r\n {'speed': 2000}\r\n ]\r\n self.position = (0, 0)\r\n self.visible_players = [{'position': (1, 1)}]\r\n self.actions = [{'pattern': 'auto-fire'}]\r\n\r\n def get_mouse_movements(self):\r\n return self.mouse_movements\r\n\r\n def get_position(self):\r\n return self.position\r\n\r\n def get_visible_players(self):\r\n return self.visible_players\r\n\r\n def get_actions(self):\r\n return self.actions\r\n\r\nclass MockGameMap:\r\n def is_wall_between(self, pos1, pos2):\r\n return pos1 == (0, 0) and pos2 == (1, 1)\r\n\r\n# Set up the mock game engine\r\ngame_engine = MockGameEngine()\r\nplayer = MockPlayer()\r\ngame_engine.players.append(player)\r\n\r\n# Integrate cheat detection with the game engine\r\ndetection_functions = {\r\n 'aimbot': detect_aimbot,\r\n 'wallhack': detect_wallhack,\r\n 'script': detect_script\r\n}\r\nintegrate_with_game(game_engine, detection_functions)\r\n\r\n# Run the mock game\r\ngame_engine.run()\r\n```\r\n\r\n### Contact\r\nQuy Anh Nguyen - quyanh082013@gmail.com\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python package for detecting cheats and hacks in various games.",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/James7688/cinagu"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "33776cf2dcbe47c46bcf50e75084311acf0986224fb942ce630fd5e654892f09",
"md5": "f82de290d8858263e03b3f3410727813",
"sha256": "bb60ed669271e332746d5b2774d97dc858739bcdfd2a383c434b7cac1c388bd6"
},
"downloads": -1,
"filename": "cinagu-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f82de290d8858263e03b3f3410727813",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 6737,
"upload_time": "2024-08-04T06:58:53",
"upload_time_iso_8601": "2024-08-04T06:58:53.497787Z",
"url": "https://files.pythonhosted.org/packages/33/77/6cf2dcbe47c46bcf50e75084311acf0986224fb942ce630fd5e654892f09/cinagu-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c4c9f3e9dc656dea8182465ceb260be17be78a829b99fc7ab0288b21d7bf3707",
"md5": "4fcac8e0efda76bca9f329846ace9035",
"sha256": "2d175ddd88ac4ccc9a2cb1127f5f388d1c05b4d50c77db24a924d56c3c3250b7"
},
"downloads": -1,
"filename": "cinagu-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "4fcac8e0efda76bca9f329846ace9035",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 6595,
"upload_time": "2024-08-04T06:58:54",
"upload_time_iso_8601": "2024-08-04T06:58:54.975032Z",
"url": "https://files.pythonhosted.org/packages/c4/c9/f3e9dc656dea8182465ceb260be17be78a829b99fc7ab0288b21d7bf3707/cinagu-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-04 06:58:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "James7688",
"github_project": "cinagu",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "cinagu"
}