move cheats in separated files
This commit is contained in:
parent
aaaa21e04c
commit
61567e304c
9 changed files with 497 additions and 436 deletions
445
cheat.py
445
cheat.py
|
@ -1,10 +1,14 @@
|
|||
from win32api import GetAsyncKeyState
|
||||
|
||||
from hack import Hack, sleep
|
||||
from utils import Vec, angle_fixer, calculate_angle, hypot
|
||||
from cheats.aimbot import *
|
||||
from cheats.bhop import *
|
||||
from cheats.chams import *
|
||||
from cheats.glow import *
|
||||
from cheats.noflash import *
|
||||
from cheats.norecoil import *
|
||||
from cheats.radarhack import *
|
||||
from cheats.trigger import *
|
||||
|
||||
|
||||
class Cheat(Hack):
|
||||
class Cheat(Bhop, Radarhack, Glow, Trigger, Norecoil, Noflash, Chams, Aimbot):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
|
@ -17,434 +21,3 @@ class Cheat(Hack):
|
|||
if not func == "hack_loop"
|
||||
# Utils
|
||||
if not func.startswith("find_")]
|
||||
|
||||
def bhop(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
offset = self.offsets
|
||||
|
||||
# Get client
|
||||
client = self.find_module("client")
|
||||
|
||||
# Get player
|
||||
local_player = self.find_uint(client, offset["dwLocalPlayer"])
|
||||
|
||||
def cheat():
|
||||
# Pressing space bar
|
||||
if not GetAsyncKeyState(self.vmap["SPACE"]):
|
||||
return
|
||||
|
||||
# Check if player is alive
|
||||
if not mem.read_uint(local_player + offset["m_iHealth"]):
|
||||
return
|
||||
|
||||
# Check if player on ground
|
||||
if mem.read_uint(local_player + offset["m_fFlags"]) & (1 << 0):
|
||||
mem.write_uint(client + offset["dwForceJump"], 5)
|
||||
sleep(0.01)
|
||||
mem.write_uint(client + offset["dwForceJump"], 4)
|
||||
|
||||
self.hack_loop(cheat)
|
||||
|
||||
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)
|
||||
|
||||
def glow(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"])
|
||||
|
||||
# Get glow object manager
|
||||
glow_obj_manager = self.find_uint(
|
||||
client, offset["dwGlowObjectManager"])
|
||||
|
||||
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
|
||||
|
||||
# Space between values
|
||||
i = mem.read_int(
|
||||
entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"]
|
||||
|
||||
# Change color glow
|
||||
mem.write_float(glow_obj_manager + i + offset["glow_R"], 1.)
|
||||
# mem.write_float(glow_obj_manager + i + offset["glow_G"], 0.)
|
||||
# mem.write_float(glow_obj_manager + i + offset["glow_B"], 0.)
|
||||
mem.write_float(glow_obj_manager + i + offset["glow_A"], 1.)
|
||||
|
||||
# Render when not visible
|
||||
mem.write_bool(glow_obj_manager + i + offset["GOM_wall"], True)
|
||||
|
||||
# Render when visible
|
||||
mem.write_bool(glow_obj_manager + i +
|
||||
offset["GOM_visible"], True)
|
||||
|
||||
self.hack_loop(cheat)
|
||||
|
||||
def trigger(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():
|
||||
# Pressing trigger key
|
||||
if not GetAsyncKeyState(self.vmap["+"]):
|
||||
return
|
||||
|
||||
# Check if player is alive
|
||||
if not mem.read_int(local_player + offset["m_iHealth"]):
|
||||
return
|
||||
|
||||
# Get crosshair info about what we aiming at
|
||||
crosshair_id = mem.read_int(
|
||||
local_player + offset["m_iCrosshairId"])
|
||||
|
||||
# 0 is wall, +64 isn't a player
|
||||
if (crosshair_id == 0) or (crosshair_id > 64):
|
||||
return
|
||||
|
||||
# Get ennemy under crosshair
|
||||
ennemy = mem.read_uint(
|
||||
client + offset["dwEntityList"] + (crosshair_id - 1) * offset["entity_size"])
|
||||
|
||||
# Check if ennemy is alive
|
||||
if mem.read_int(ennemy + offset["m_lifeState"]):
|
||||
return
|
||||
|
||||
# Ignore allies
|
||||
if mem.read_int(ennemy + offset["m_iTeamNum"]) == local_team:
|
||||
return
|
||||
|
||||
# Shoot
|
||||
mem.write_uint(client + offset["dwForceAttack"], 6)
|
||||
sleep(0.2)
|
||||
mem.write_uint(client + offset["dwForceAttack"], 4)
|
||||
|
||||
self.hack_loop(cheat)
|
||||
|
||||
def no_recoil(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
offset = self.offsets
|
||||
|
||||
# Get module addresses
|
||||
client = self.find_module("client")
|
||||
engine = self.find_module("engine")
|
||||
|
||||
# Get local player
|
||||
local_player = self.find_uint(client, offset["dwLocalPlayer"])
|
||||
|
||||
# Get client state
|
||||
client_state = mem.read_uint(engine + offset["dwClientState"])
|
||||
|
||||
# Control variable
|
||||
self.nr__old_punch = Vec()
|
||||
|
||||
def cheat():
|
||||
# Check if player is shooting
|
||||
if mem.read_int(local_player + offset["m_iShotsFired"]):
|
||||
|
||||
# Where player is looking
|
||||
view_angles = Vec(
|
||||
mem.read_float(
|
||||
client_state + offset["dwClientState_ViewAngles"]),
|
||||
mem.read_float(
|
||||
client_state + offset["dwClientState_ViewAngles"] + offset["float"])
|
||||
)
|
||||
|
||||
aim_punch = Vec(
|
||||
mem.read_float(
|
||||
local_player + offset["m_aimPunchAngle"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_aimPunchAngle"] + offset["float"])
|
||||
).times(2.) # server multiple punch by 2
|
||||
|
||||
# New angles
|
||||
new_angle = angle_fixer(view_angles.plus(
|
||||
self.nr__old_punch).minus(aim_punch))
|
||||
|
||||
# Cancel recoil
|
||||
mem.write_float(
|
||||
client_state + offset["dwClientState_ViewAngles"], new_angle.x)
|
||||
mem.write_float(
|
||||
client_state + offset["dwClientState_ViewAngles"] + offset["float"], new_angle.y)
|
||||
|
||||
self.nr__old_punch = aim_punch
|
||||
|
||||
else:
|
||||
# Not spraying
|
||||
self.nr__old_punch = Vec()
|
||||
|
||||
self.hack_loop(cheat)
|
||||
|
||||
def aimbot(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
offset = self.offsets
|
||||
|
||||
# Get module addresses
|
||||
client = self.find_module("client")
|
||||
engine = self.find_module("engine")
|
||||
|
||||
# Get local player
|
||||
local_player = self.find_uint(client, offset["dwLocalPlayer"])
|
||||
|
||||
# Get local team
|
||||
local_team = self.find_uint(local_player, offset["m_iTeamNum"])
|
||||
|
||||
# Get client state
|
||||
client_state = self.find_uint(engine, offset["dwClientState"])
|
||||
|
||||
def cheat():
|
||||
# Pressing left click
|
||||
if not GetAsyncKeyState(self.vmap["LBUTTON"]):
|
||||
return
|
||||
|
||||
# Where are the eyes
|
||||
local_eye_pos = Vec(
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecOrigin"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecOrigin"] + offset["float"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecOrigin"] + offset["float"] * 2)
|
||||
).plus(Vec(
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecViewOffset"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecViewOffset"] + offset["float"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecViewOffset"] + offset["float"] * 2)
|
||||
))
|
||||
|
||||
# Where player is looking
|
||||
view_angles = Vec(
|
||||
mem.read_float(
|
||||
client_state + offset["dwClientState_ViewAngles"]),
|
||||
mem.read_float(
|
||||
client_state + offset["dwClientState_ViewAngles"] + offset["float"])
|
||||
)
|
||||
|
||||
# How much the view is modified
|
||||
aim_punch = Vec(
|
||||
mem.read_float(
|
||||
local_player + offset["m_aimPunchAngle"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_aimPunchAngle"] + offset["float"])
|
||||
).times(2.) # server multiple punch by 2
|
||||
|
||||
# AimBot FOV, higher = more aggressive
|
||||
best_fov = 5.
|
||||
best_angle = Vec()
|
||||
|
||||
# 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_int(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
|
||||
|
||||
# Don't aim at ennemy behind a wall
|
||||
if not (
|
||||
mem.read_int(entity + offset["m_bSpottedByMask"])
|
||||
&
|
||||
(1 << mem.read_int(
|
||||
client_state + offset["dwClientState_GetLocalPlayer"]))
|
||||
):
|
||||
continue
|
||||
|
||||
# Find head
|
||||
boneMatrix = mem.read_uint(entity + offset["m_dwBoneMatrix"])
|
||||
|
||||
ennemy_head = Vec(
|
||||
mem.read_float(
|
||||
boneMatrix + offset["head_idx"] + offset["head_x"]),
|
||||
mem.read_float(
|
||||
boneMatrix + offset["head_idx"] + offset["head_y"]),
|
||||
mem.read_float(
|
||||
boneMatrix + offset["head_idx"] + offset["head_z"])
|
||||
)
|
||||
|
||||
angle = calculate_angle(
|
||||
local_eye_pos, ennemy_head, view_angles.plus(aim_punch))
|
||||
|
||||
# Current FOV
|
||||
fov = hypot(angle.x, angle.y)
|
||||
|
||||
if (fov < best_fov):
|
||||
best_fov = fov
|
||||
best_angle = angle
|
||||
|
||||
# We found an ennemy to aim at
|
||||
if not best_angle.is_zero():
|
||||
# Smoothing, more = less efficient
|
||||
best_angle = best_angle.div(3.)
|
||||
|
||||
final_angle = view_angles.plus(best_angle)
|
||||
|
||||
# Fix angle if needed
|
||||
final_angle = angle_fixer(final_angle)
|
||||
|
||||
mem.write_float(
|
||||
client_state + offset["dwClientState_ViewAngles"], final_angle.x)
|
||||
mem.write_float(
|
||||
client_state + offset["dwClientState_ViewAngles"] + offset["float"], final_angle.y)
|
||||
|
||||
self.hack_loop(cheat)
|
||||
|
||||
def chams(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
offset = self.offsets
|
||||
|
||||
# Get module addresses
|
||||
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
|
||||
|
||||
# Space between values
|
||||
i = mem.read_int(
|
||||
entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"]
|
||||
|
||||
# Change color
|
||||
mem.write_uint(
|
||||
entity + offset["m_clrRender"] + offset["render_R"], 255)
|
||||
mem.write_uint(
|
||||
entity + offset["m_clrRender"] + offset["render_G"], 255)
|
||||
# mem.write_uint(
|
||||
# entity + offset["m_clrRender"] + offset["render_B"], 0)
|
||||
|
||||
self.hack_loop(cheat)
|
||||
|
||||
def noflash(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"])
|
||||
|
||||
def cheat():
|
||||
if (mem.read_int(local_player + offset["m_flFlashDuration"])):
|
||||
mem.write_int(local_player + offset["m_flFlashDuration"], 0)
|
||||
|
||||
# Less chance to get flashed again
|
||||
sleep(1)
|
||||
|
||||
self.hack_loop(cheat)
|
||||
|
|
138
cheats/aimbot.py
Normal file
138
cheats/aimbot.py
Normal file
|
@ -0,0 +1,138 @@
|
|||
from win32api import GetAsyncKeyState
|
||||
|
||||
from hack import Hack
|
||||
from utils import Vec, angle_fixer, calculate_angle, hypot
|
||||
|
||||
|
||||
class Aimbot(Hack):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
def aimbot(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
offset = self.offsets
|
||||
|
||||
# Get module addresses
|
||||
client = self.find_module("client")
|
||||
engine = self.find_module("engine")
|
||||
|
||||
# Get local player
|
||||
local_player = self.find_uint(client, offset["dwLocalPlayer"])
|
||||
|
||||
# Get local team
|
||||
local_team = self.find_uint(local_player, offset["m_iTeamNum"])
|
||||
|
||||
# Get client state
|
||||
client_state = self.find_uint(engine, offset["dwClientState"])
|
||||
|
||||
def cheat():
|
||||
# Pressing left click
|
||||
if not GetAsyncKeyState(self.vmap["LBUTTON"]):
|
||||
return
|
||||
|
||||
# Where are the eyes
|
||||
local_eye_pos = Vec(
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecOrigin"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecOrigin"] + offset["float"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecOrigin"] + offset["float"] * 2)
|
||||
).plus(Vec(
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecViewOffset"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecViewOffset"] + offset["float"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_vecViewOffset"] + offset["float"] * 2)
|
||||
))
|
||||
|
||||
# Where player is looking
|
||||
view_angles = Vec(
|
||||
mem.read_float(
|
||||
client_state + offset["dwClientState_ViewAngles"]),
|
||||
mem.read_float(
|
||||
client_state + offset["dwClientState_ViewAngles"] + offset["float"])
|
||||
)
|
||||
|
||||
# How much the view is modified
|
||||
aim_punch = Vec(
|
||||
mem.read_float(
|
||||
local_player + offset["m_aimPunchAngle"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_aimPunchAngle"] + offset["float"])
|
||||
).times(2.) # server multiple punch by 2
|
||||
|
||||
# AimBot FOV, higher = more aggressive
|
||||
best_fov = 5.
|
||||
best_angle = Vec()
|
||||
|
||||
# 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_int(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
|
||||
|
||||
# Don't aim at ennemy behind a wall
|
||||
if not (
|
||||
mem.read_int(entity + offset["m_bSpottedByMask"])
|
||||
&
|
||||
(1 << mem.read_int(
|
||||
client_state + offset["dwClientState_GetLocalPlayer"]))
|
||||
):
|
||||
continue
|
||||
|
||||
# Find head
|
||||
boneMatrix = mem.read_uint(entity + offset["m_dwBoneMatrix"])
|
||||
|
||||
ennemy_head = Vec(
|
||||
mem.read_float(
|
||||
boneMatrix + offset["head_idx"] + offset["head_x"]),
|
||||
mem.read_float(
|
||||
boneMatrix + offset["head_idx"] + offset["head_y"]),
|
||||
mem.read_float(
|
||||
boneMatrix + offset["head_idx"] + offset["head_z"])
|
||||
)
|
||||
|
||||
angle = calculate_angle(
|
||||
local_eye_pos, ennemy_head, view_angles.plus(aim_punch))
|
||||
|
||||
# Current FOV
|
||||
fov = hypot(angle.x, angle.y)
|
||||
|
||||
if (fov < best_fov):
|
||||
best_fov = fov
|
||||
best_angle = angle
|
||||
|
||||
# We found an ennemy to aim at
|
||||
if not best_angle.is_zero():
|
||||
# Smoothing, more = less efficient
|
||||
best_angle = best_angle.div(3.)
|
||||
|
||||
final_angle = view_angles.plus(best_angle)
|
||||
|
||||
# Fix angle if needed
|
||||
final_angle = angle_fixer(final_angle)
|
||||
|
||||
mem.write_float(
|
||||
client_state + offset["dwClientState_ViewAngles"], final_angle.x)
|
||||
mem.write_float(
|
||||
client_state + offset["dwClientState_ViewAngles"] + offset["float"], final_angle.y)
|
||||
|
||||
self.hack_loop(cheat)
|
36
cheats/bhop.py
Normal file
36
cheats/bhop.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
from win32api import GetAsyncKeyState
|
||||
|
||||
from hack import Hack, sleep
|
||||
|
||||
|
||||
class Bhop(Hack):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
def bhop(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
offset = self.offsets
|
||||
|
||||
# Get client
|
||||
client = self.find_module("client")
|
||||
|
||||
# Get player
|
||||
local_player = self.find_uint(client, offset["dwLocalPlayer"])
|
||||
|
||||
def cheat():
|
||||
# Pressing space bar
|
||||
if not GetAsyncKeyState(self.vmap["SPACE"]):
|
||||
return
|
||||
|
||||
# Check if player is alive
|
||||
if not mem.read_uint(local_player + offset["m_iHealth"]):
|
||||
return
|
||||
|
||||
# Check if player on ground
|
||||
if mem.read_uint(local_player + offset["m_fFlags"]) & (1 << 0):
|
||||
mem.write_uint(client + offset["dwForceJump"], 5)
|
||||
sleep(0.01)
|
||||
mem.write_uint(client + offset["dwForceJump"], 4)
|
||||
|
||||
self.hack_loop(cheat)
|
56
cheats/chams.py
Normal file
56
cheats/chams.py
Normal file
|
@ -0,0 +1,56 @@
|
|||
from hack import Hack
|
||||
|
||||
|
||||
class Chams(Hack):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
def chams(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
offset = self.offsets
|
||||
|
||||
# Get module addresses
|
||||
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
|
||||
|
||||
# Space between values
|
||||
i = mem.read_int(
|
||||
entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"]
|
||||
|
||||
# Change color
|
||||
mem.write_uint(
|
||||
entity + offset["m_clrRender"] + offset["render_R"], 255)
|
||||
mem.write_uint(
|
||||
entity + offset["m_clrRender"] + offset["render_G"], 255)
|
||||
# mem.write_uint(
|
||||
# entity + offset["m_clrRender"] + offset["render_B"], 0)
|
||||
|
||||
self.hack_loop(cheat)
|
65
cheats/glow.py
Normal file
65
cheats/glow.py
Normal file
|
@ -0,0 +1,65 @@
|
|||
from hack import Hack
|
||||
|
||||
|
||||
class Glow(Hack):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
def glow(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"])
|
||||
|
||||
# Get glow object manager
|
||||
glow_obj_manager = self.find_uint(
|
||||
client, offset["dwGlowObjectManager"])
|
||||
|
||||
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
|
||||
|
||||
# Space between values
|
||||
i = mem.read_int(
|
||||
entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"]
|
||||
|
||||
# Change color glow
|
||||
mem.write_float(glow_obj_manager + i + offset["glow_R"], 1.)
|
||||
# mem.write_float(glow_obj_manager + i + offset["glow_G"], 0.)
|
||||
# mem.write_float(glow_obj_manager + i + offset["glow_B"], 0.)
|
||||
mem.write_float(glow_obj_manager + i + offset["glow_A"], 1.)
|
||||
|
||||
# Render when not visible
|
||||
mem.write_bool(glow_obj_manager + i + offset["GOM_wall"], True)
|
||||
|
||||
# Render when visible
|
||||
mem.write_bool(glow_obj_manager + i +
|
||||
offset["GOM_visible"], True)
|
||||
|
||||
self.hack_loop(cheat)
|
26
cheats/noflash.py
Normal file
26
cheats/noflash.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
from hack import Hack, sleep
|
||||
|
||||
|
||||
class Noflash(Hack):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
def noflash(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"])
|
||||
|
||||
def cheat():
|
||||
if (mem.read_int(local_player + offset["m_flFlashDuration"])):
|
||||
mem.write_int(local_player + offset["m_flFlashDuration"], 0)
|
||||
|
||||
# Less chance to get flashed again
|
||||
sleep(1)
|
||||
|
||||
self.hack_loop(cheat)
|
63
cheats/norecoil.py
Normal file
63
cheats/norecoil.py
Normal file
|
@ -0,0 +1,63 @@
|
|||
from hack import Hack
|
||||
from utils import Vec, angle_fixer
|
||||
|
||||
|
||||
class Norecoil(Hack):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
|
||||
def no_recoil(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
offset = self.offsets
|
||||
|
||||
# Get module addresses
|
||||
client = self.find_module("client")
|
||||
engine = self.find_module("engine")
|
||||
|
||||
# Get local player
|
||||
local_player = self.find_uint(client, offset["dwLocalPlayer"])
|
||||
|
||||
# Get client state
|
||||
client_state = mem.read_uint(engine + offset["dwClientState"])
|
||||
|
||||
# Control variable
|
||||
self.nr__old_punch = Vec()
|
||||
|
||||
def cheat():
|
||||
# Check if player is shooting
|
||||
if mem.read_int(local_player + offset["m_iShotsFired"]):
|
||||
|
||||
# Where player is looking
|
||||
view_angles = Vec(
|
||||
mem.read_float(
|
||||
client_state + offset["dwClientState_ViewAngles"]),
|
||||
mem.read_float(
|
||||
client_state + offset["dwClientState_ViewAngles"] + offset["float"])
|
||||
)
|
||||
|
||||
aim_punch = Vec(
|
||||
mem.read_float(
|
||||
local_player + offset["m_aimPunchAngle"]),
|
||||
mem.read_float(
|
||||
local_player + offset["m_aimPunchAngle"] + offset["float"])
|
||||
).times(2.) # server multiple punch by 2
|
||||
|
||||
# New angles
|
||||
new_angle = angle_fixer(view_angles.plus(
|
||||
self.nr__old_punch).minus(aim_punch))
|
||||
|
||||
# Cancel recoil
|
||||
mem.write_float(
|
||||
client_state + offset["dwClientState_ViewAngles"], new_angle.x)
|
||||
mem.write_float(
|
||||
client_state + offset["dwClientState_ViewAngles"] + offset["float"], new_angle.y)
|
||||
|
||||
self.nr__old_punch = aim_punch
|
||||
|
||||
else:
|
||||
# Not spraying
|
||||
self.nr__old_punch = Vec()
|
||||
|
||||
self.hack_loop(cheat)
|
46
cheats/radarhack.py
Normal file
46
cheats/radarhack.py
Normal file
|
@ -0,0 +1,46 @@
|
|||
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)
|
58
cheats/trigger.py
Normal file
58
cheats/trigger.py
Normal file
|
@ -0,0 +1,58 @@
|
|||
from win32api import GetAsyncKeyState
|
||||
|
||||
from hack import Hack, sleep
|
||||
|
||||
|
||||
class Trigger(Hack):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
def trigger(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():
|
||||
# Pressing trigger key
|
||||
if not GetAsyncKeyState(self.vmap["+"]):
|
||||
return
|
||||
|
||||
# Check if player is alive
|
||||
if not mem.read_int(local_player + offset["m_iHealth"]):
|
||||
return
|
||||
|
||||
# Get crosshair info about what we aiming at
|
||||
crosshair_id = mem.read_int(
|
||||
local_player + offset["m_iCrosshairId"])
|
||||
|
||||
# 0 is wall, +64 isn't a player
|
||||
if (crosshair_id == 0) or (crosshair_id > 64):
|
||||
return
|
||||
|
||||
# Get ennemy under crosshair
|
||||
ennemy = mem.read_uint(
|
||||
client + offset["dwEntityList"] + (crosshair_id - 1) * offset["entity_size"])
|
||||
|
||||
# Check if ennemy is alive
|
||||
if mem.read_int(ennemy + offset["m_lifeState"]):
|
||||
return
|
||||
|
||||
# Ignore allies
|
||||
if mem.read_int(ennemy + offset["m_iTeamNum"]) == local_team:
|
||||
return
|
||||
|
||||
# Shoot
|
||||
mem.write_uint(client + offset["dwForceAttack"], 6)
|
||||
sleep(0.2)
|
||||
mem.write_uint(client + offset["dwForceAttack"], 4)
|
||||
|
||||
self.hack_loop(cheat)
|
Reference in a new issue