fixes and notice that its not working

This commit is contained in:
Mylloon 2023-03-30 16:10:55 +02:00
parent c947570ddb
commit 64cbbe9b58
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

44
main.py
View file

@ -279,8 +279,16 @@ class Cheat(Hack):
# Get local player # Get local player
local_player = self.find_uint(client, offset["dwLocalPlayer"]) local_player = self.find_uint(client, offset["dwLocalPlayer"])
old_punch_x = 0. # Float size
old_punch_y = 0. float_offset = 4
# Control variable
self.nr__old_punch_x = 0.
self.nr__old_punch_y = 0.
# TMP NOTICE
print("This one isn't working.")
exit(2)
def cheat(): def cheat():
# TODO: Reduce read/write call # TODO: Reduce read/write call
@ -289,31 +297,32 @@ class Cheat(Hack):
if mem.read_int(local_player + offset["m_iShotsFired"]): if mem.read_int(local_player + offset["m_iShotsFired"]):
client_state = mem.read_uint(engine + offset["dwClientState"]) client_state = mem.read_uint(engine + offset["dwClientState"])
# 4 = offset of integer # Where player is looking
# view angle
view_angles_x = mem.read_float( view_angles_x = mem.read_float(
client_state + offset["dwClientState_ViewAngles"]) client_state + offset["dwClientState_ViewAngles"])
view_angles_y = mem.read_float( view_angles_y = mem.read_float(
client_state + offset["dwClientState_ViewAngles"] + 4) client_state + offset["dwClientState_ViewAngles"] + float_offset)
# Server multiple punch by 2
server_mult = 2. server_mult = 2.
# recoil # How much the view is modified
aim_punch_x = mem.read_float( aim_punch_x = mem.read_float(
client_state + offset["m_aimPunchAngle"]) * server_mult client_state + offset["m_aimPunchAngle"]) * server_mult
aim_punch_y = mem.read_float( aim_punch_y = mem.read_int(
client_state + offset["m_aimPunchAngle"] + 4) * server_mult client_state + offset["m_aimPunchAngle"] + float_offset) * server_mult
# New angles # New angles
new_angle_x = view_angles_x + old_punch_x - aim_punch_x new_angle_x = view_angles_x + self.nr__old_punch_x - aim_punch_x
new_angle_y = view_angles_y + old_punch_y - aim_punch_y new_angle_y = view_angles_y + self.nr__old_punch_y - aim_punch_y
# Sanity check # Limit of pitch in game is ]-89; 180[
if new_angle_x > 89.: if new_angle_x > 89.:
new_angle_x = 89. new_angle_x = 89.
if new_angle_x < -89.: if new_angle_x < -89.:
new_angle_x = -89 new_angle_x = -89
# Limit of yaw in game is ]-180; 360[
while (new_angle_y > 180.): while (new_angle_y > 180.):
new_angle_y -= 360. new_angle_y -= 360.
while (new_angle_y < -180.): while (new_angle_y < -180.):
@ -323,15 +332,16 @@ class Cheat(Hack):
mem.write_float( mem.write_float(
client_state + offset["dwClientState_ViewAngles"], new_angle_x) client_state + offset["dwClientState_ViewAngles"], new_angle_x)
mem.write_float( mem.write_float(
client_state + offset["dwClientState_ViewAngles"] + 4, new_angle_y) client_state + offset["dwClientState_ViewAngles"] + float_offset, new_angle_y)
old_punch_x = aim_punch_x self.nr__old_punch_x = aim_punch_x
old_punch_y = aim_punch_y self.nr__old_punch_y = aim_punch_y
else: else:
# Not spraying # Not spraying
old_punch_x = 0. self.nr__old_punch_x = 0.
old_punch_y = 0. self.nr__old_punch_y = 0.
pass
self.hack_loop(cheat) self.hack_loop(cheat)