refactorization

This commit is contained in:
Mylloon 2023-03-31 21:58:07 +02:00
parent 616f6ddd6c
commit 93e01d2637
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
6 changed files with 62 additions and 15 deletions

View file

@ -8,6 +8,12 @@ class Aimbot(Hack):
def __init__(self) -> None: def __init__(self) -> None:
super().__init__() super().__init__()
# AimBot FOV, higher = more aggressive
self.__fov_range = 5.
# Smoothing, more = less efficient
self.__smoothing = 3.
def aimbot(self) -> None: def aimbot(self) -> None:
# Aliases # Aliases
mem = self.pm mem = self.pm
@ -61,8 +67,7 @@ class Aimbot(Hack):
local_player + offset["m_aimPunchAngle"] + offset["float"]) local_player + offset["m_aimPunchAngle"] + offset["float"])
).times(2.) # server multiple punch by 2 ).times(2.) # server multiple punch by 2
# AimBot FOV, higher = more aggressive best_fov = self.__fov_range
best_fov = 5.
best_angle = Vec() best_angle = Vec()
# Loop all entities # Loop all entities
@ -119,8 +124,8 @@ class Aimbot(Hack):
# We found an ennemy to aim at # We found an ennemy to aim at
if not best_angle.is_zero(): if not best_angle.is_zero():
# Smoothing, more = less efficient if self.__smoothing > 0.:
best_angle = best_angle.div(3.) best_angle = best_angle.div(self.__smoothing)
final_angle = view_angles.plus(best_angle) final_angle = view_angles.plus(best_angle)

View file

@ -1,11 +1,15 @@
from hack import Hack
from struct import pack from struct import pack
from hack import Hack
from utils import Color3i
class Chams(Hack): class Chams(Hack):
def __init__(self) -> None: def __init__(self) -> None:
super().__init__() super().__init__()
self.__color = Color3i(255, 255, 0)
def chams(self) -> None: def chams(self) -> None:
# Aliases # Aliases
mem = self.pm mem = self.pm
@ -45,10 +49,15 @@ class Chams(Hack):
entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"] entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"]
# Change color # Change color
mem.write_uint( if self.__color.r > 0:
entity + offset["m_clrRender"] + offset["render_R"], 255) mem.write_uint(
mem.write_uint( entity + offset["m_clrRender"] + offset["render_R"], self.__color.r)
entity + offset["m_clrRender"] + offset["render_G"], 255) if self.__color.g > 0:
mem.write_uint(
entity + offset["m_clrRender"] + offset["render_G"], self.__color.g)
if self.__color.b > 0:
mem.write_uint(
entity + offset["m_clrRender"] + offset["render_B"], self.__color.b)
brightness = 5. brightness = 5.
mem.write_int( mem.write_int(

View file

@ -1,6 +1,7 @@
from hack import Hack
from win32api import GetAsyncKeyState from win32api import GetAsyncKeyState
from hack import Hack
class Fov(Hack): class Fov(Hack):
def __init__(self) -> None: def __init__(self) -> None:

View file

@ -1,10 +1,13 @@
from hack import Hack from hack import Hack
from utils import Color4f
class Glow(Hack): class Glow(Hack):
def __init__(self) -> None: def __init__(self) -> None:
super().__init__() super().__init__()
self.__color = Color4f(1., 0., 0., .8)
def glow(self) -> None: def glow(self) -> None:
# Aliases # Aliases
mem = self.pm mem = self.pm
@ -47,10 +50,18 @@ class Glow(Hack):
entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"] entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"]
# Change color glow # Change color glow
mem.write_float(glow_obj_manager + i + offset["glow_R"], 1.) if self.__color.r > 0.:
# mem.write_float(glow_obj_manager + i + offset["glow_G"], 0.) mem.write_float(glow_obj_manager + i +
# mem.write_float(glow_obj_manager + i + offset["glow_B"], 0.) offset["glow_R"], self.__color.r)
mem.write_float(glow_obj_manager + i + offset["glow_A"], .8) if self.__color.g > 0.:
mem.write_float(glow_obj_manager + i +
offset["glow_G"], self.__color.g)
if self.__color.b > 0.:
mem.write_float(glow_obj_manager + i +
offset["glow_B"], self.__color.b)
if self.__color.a > 0.:
mem.write_float(glow_obj_manager + i +
offset["glow_A"], self.__color.a)
# Render when not visible # Render when not visible
mem.write_bool(glow_obj_manager + i + offset["GOM_wall"], True) mem.write_bool(glow_obj_manager + i + offset["GOM_wall"], True)

View file

@ -5,6 +5,8 @@ class Noflash(Hack):
def __init__(self) -> None: def __init__(self) -> None:
super().__init__() super().__init__()
self.__brightness = 30.
def noflash(self) -> None: def noflash(self) -> None:
# Aliases # Aliases
mem = self.pm mem = self.pm
@ -17,7 +19,7 @@ class Noflash(Hack):
local_player = self.find_uint(client, offset["dwLocalPlayer"]) local_player = self.find_uint(client, offset["dwLocalPlayer"])
def cheat(): def cheat():
mem.write_float(local_player + offset["m_flFlashMaxAlpha"], 30.) mem.write_float(local_player + offset["m_flFlashMaxAlpha"], self.__brightness)
# Value only overrided on first flash or when server fullupdate # Value only overrided on first flash or when server fullupdate
sleep(10) sleep(10)

View file

@ -111,3 +111,22 @@ def angle_fixer(angle: Vec) -> Vec:
angle.y += 360. angle.y += 360.
return angle return angle
class Color3i:
"""Color RGB as integer"""
def __init__(self, r: int, g: int, b: int) -> None:
self.r = r
self.g = g
self.b = b
class Color4f:
"""Color RGBA as float"""
def __init__(self, r: float, g: float, b: float, a: float) -> None:
self.r = r
self.g = g
self.b = b
self.a = a