Skip to main content

A Python package for detecting cheats and hacks in various games.

Project description

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:

pip install cinagu

Usage

Chess Cheat Detection

Detecting Abnormal Moves

To detect abnormal moves in a chess game, use thedetect_abnormal_moves function from the cinagu.chess_detection module. This function analyzes the moves from a PGN game object.

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.

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.

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.

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.

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.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cinagu-0.1.4.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

cinagu-0.1.4-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file cinagu-0.1.4.tar.gz.

File metadata

  • Download URL: cinagu-0.1.4.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for cinagu-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2d175ddd88ac4ccc9a2cb1127f5f388d1c05b4d50c77db24a924d56c3c3250b7
MD5 4fcac8e0efda76bca9f329846ace9035
BLAKE2b-256 c4c9f3e9dc656dea8182465ceb260be17be78a829b99fc7ab0288b21d7bf3707

See more details on using hashes here.

File details

Details for the file cinagu-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: cinagu-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for cinagu-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bb60ed669271e332746d5b2774d97dc858739bcdfd2a383c434b7cac1c388bd6
MD5 f82de290d8858263e03b3f3410727813
BLAKE2b-256 33776cf2dcbe47c46bcf50e75084311acf0986224fb942ce630fd5e654892f09

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page