Загрузка данных


import pymem
import pymem.process
import ctypes
import time
import sys

dwLocalPlayer = 0x1A29B8
dwEntityList = 0x1A2A78
m_iTeamNum = 0xF0
m_iHealth = 0x1F8
m_vecOrigin = 0x130

user32 = ctypes.windll.user32
gdi32 = ctypes.windll.gdi32

def draw_rect(hdc, x, y, w, h, color):
    brush = gdi32.CreateSolidBrush(color)
    gdi32.SelectObject(hdc, brush)
    gdi32.Rectangle(hdc, int(x), int(y), int(x+w), int(y+h))
    gdi32.DeleteObject(brush)

try:
    pm = pymem.Pymem("hl.exe")
except:
    print("Ошибка: CS 1.6 не запущен")
    sys.exit(1)

client = pymem.process.module_from_name(pm.process_handle, "hw.dll")
client_base = client.lpBaseOfDll

hwnd = user32.FindWindowW(None, "Counter-Strike")
if not hwnd:
    print("Ошибка: окно Counter-Strike не найдено")
    sys.exit(1)

rect = ctypes.wintypes.RECT()
user32.GetWindowRect(hwnd, ctypes.byref(rect))
screen_w = rect.right - rect.left
screen_h = rect.bottom - rect.top
hdc = user32.GetDC(hwnd)

print(f"[+] Чит запущен")
print(f"[+] Client base: {hex(client_base)}")
print(f"[+] Размер окна: {screen_w}x{screen_h}")
print(f"[+] Ждите появления синего квадрата в центре экрана...")

while True:
    try:
        local_player = pm.read_int(client_base + dwLocalPlayer)
        if local_player == 0:
            time.sleep(0.1)
            continue
        
        draw_rect(hdc, screen_w//2 - 20, screen_h//2 - 20, 40, 40, 0x0000FF)
        
    except Exception as e:
        pass
    
    time.sleep(0.05)