add radar hack
This commit is contained in:
parent
b637771a96
commit
44d19f15a3
1 changed files with 49 additions and 3 deletions
52
main.py
52
main.py
|
@ -54,8 +54,8 @@ class Hack():
|
||||||
else:
|
else:
|
||||||
raise MemoryError
|
raise MemoryError
|
||||||
|
|
||||||
def find_variable(self, base, offset: int) -> int:
|
def find_int(self, base, offset: int) -> int:
|
||||||
"""Find element in memory"""
|
"""Find integer in memory"""
|
||||||
local_element = None
|
local_element = None
|
||||||
while not local_element:
|
while not local_element:
|
||||||
local_element = self.pm.read_uint(base + offset)
|
local_element = self.pm.read_uint(base + offset)
|
||||||
|
@ -85,7 +85,7 @@ class Cheat(Hack):
|
||||||
client = self.find_module("client")
|
client = self.find_module("client")
|
||||||
|
|
||||||
# Get player
|
# Get player
|
||||||
local_player = self.find_variable(client, offset["dwLocalPlayer"])
|
local_player = self.find_int(client, offset["dwLocalPlayer"])
|
||||||
|
|
||||||
# Hack loop
|
# Hack loop
|
||||||
while True:
|
while True:
|
||||||
|
@ -106,6 +106,52 @@ class Cheat(Hack):
|
||||||
sleep(0.01) # maybe reduce ban rate?
|
sleep(0.01) # maybe reduce ban rate?
|
||||||
mem.write_uint(client + offset["dwForceJump"], 4)
|
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__":
|
if __name__ == "__main__":
|
||||||
# Cheat
|
# Cheat
|
||||||
|
|
Reference in a new issue