import pymem
import pymem.process
import time
# РУЧНЫЕ СМЕЩЕНИЯ (из вашей диагностики)
dwLocalPlayer = 0x1A29B8
m_iHealth = 0x1F8 # было 0x1F8 в вашей прошлой诊断ке
m_iTeamNum = 0xF0
def main():
print("=" * 50)
print("Мониторинг здоровья CS 1.6")
print("=" * 50)
try:
pm = pymem.Pymem("hl.exe")
print("[+] hl.exe найден")
except:
print("[-] hl.exe не найден!")
input()
return
client = pymem.process.module_from_name(pm.process_handle, "hw.dll")
client_base = client.lpBaseOfDll
print(f"[+] hw.dll base: {hex(client_base)}")
local_player = pm.read_int(client_base + dwLocalPlayer)
if local_player == 0:
print("[-] LocalPlayer не найден. Вы в катке?")
input()
return
print(f"[+] LocalPlayer адрес: {hex(local_player)}")
# Проверяем здоровье по правильному смещению
health = pm.read_int(local_player + m_iHealth)
print(f"[+] Текущее здоровье: {health}")
print("\n[*] Мониторинг запущен. Наносите урон...\n")
last_health = health
try:
while True:
current_health = pm.read_int(local_player + m_iHealth)
if current_health != last_health:
diff = current_health - last_health
if diff < 0:
print(f"[!] Здоровье: {last_health} -> {current_health} (урон: {abs(diff)})")
else:
print(f"[+] Здоровье: {last_health} -> {current_health} (лечение: {diff})")
last_health = current_health
time.sleep(0.05)
except KeyboardInterrupt:
print("\n[*] Мониторинг остановлен.")
if __name__ == "__main__":
main()