add radar hack

This commit is contained in:
Mylloon 2023-03-30 13:47:28 +02:00
parent b637771a96
commit 44d19f15a3
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

52
main.py
View file

@ -54,8 +54,8 @@ class Hack():
else:
raise MemoryError
def find_variable(self, base, offset: int) -> int:
"""Find element in memory"""
def find_int(self, base, offset: int) -> int:
"""Find integer in memory"""
local_element = None
while not local_element:
local_element = self.pm.read_uint(base + offset)
@ -85,7 +85,7 @@ class Cheat(Hack):
client = self.find_module("client")
# Get player
local_player = self.find_variable(client, offset["dwLocalPlayer"])
local_player = self.find_int(client, offset["dwLocalPlayer"])
# Hack loop
while True:
@ -106,6 +106,52 @@ class Cheat(Hack):
sleep(0.01) # maybe reduce ban rate?
mem.write_uint(client + offset["dwForceJump"], 4)
def radar_hack(self) -> None:
# Aliases
mem = self.pm
offset = self.offsets
# Get module address
client = self.find_module("client")
# Get local player
print("Looking for player...")
local_player = self.find_int(client, offset["dwLocalPlayer"])
# Get local team
print("Looking for team...")
local_team = self.find_int(local_player, offset["m_iTeamNum"])
print("Looking for entities...")
# idx 0 == world
ennemies = []
for i in range(1, 64):
entity = self.find_int(
client, offset["dwEntityList"] + i * 0x10)
# Ignore allies
print("Check entity team...", end=" ")
if self.find_int(entity, offset["m_iTeamNum"] == local_team):
print("ally found...")
continue
print("ennemy found...")
ennemies.append(entity)
# Hack loop
print("Running...")
while True:
# Reduce CPU usage
sleep(self.wait_time)
# Show ennemies
for ennemy in ennemies:
# Check if ennemy is alive
if not self.find_int(ennemy, offset["m_iHealth"]):
continue
mem.write_bool(ennemy + offset["m_bSpotted"], True)
if __name__ == "__main__":
# Cheat