This repository has been archived on 2023-09-02. You can view files and clone it, but cannot push or open issues or pull requests.
csh/cheats/radarhack.py

47 lines
1.3 KiB
Python
Raw Normal View History

2023-03-31 18:52:22 +02:00
from hack import Hack
class Radarhack(Hack):
def __init__(self) -> None:
super().__init__()
def radar_hack(self) -> None:
# Aliases
mem = self.pm
offset = self.offsets
# Get module address
client = self.find_module("client")
# Get local player
local_player = self.find_uint(client, offset["dwLocalPlayer"])
# Get local team
local_team = self.find_uint(local_player, offset["m_iTeamNum"])
def cheat():
# Loop all entities
for i in range(1, 32): # 0 is world
entity = mem.read_uint(
client + offset["dwEntityList"] + i * offset["entity_size"])
# Ignore if entity doesn't exist
if not entity:
continue
# Ignore allies
if mem.read_uint(entity + offset["m_iTeamNum"]) == local_team:
continue
# Ignore dormant
if mem.read_bool(entity + offset["m_bDormant"]):
continue
# Check if ennemy is alive
if mem.read_int(entity + offset["m_lifeState"]):
continue
mem.write_bool(entity + offset["m_bSpotted"], True)
self.hack_loop(cheat)