From 1730b73d1f96b70f45d742f309aae4baf276ebbc Mon Sep 17 00:00:00 2001 From: imnyang Date: Sat, 30 May 2026 18:45:42 +0900 Subject: [PATCH] feat: implement various player hacks and refactor main loop for modularity --- libs/core.py | 60 ---------------------------------- main.py | 81 ++++++++++++++++++++++++++++++++-------------- modules/aimbot.py | 2 +- modules/armor.py | 12 +++++++ modules/esp.py | 15 +++++++++ modules/grenade.py | 12 +++++++ modules/health.py | 12 +++++++ modules/mk77.py | 16 +++++++++ modules/mtp57.py | 16 +++++++++ 9 files changed, 141 insertions(+), 85 deletions(-) delete mode 100644 libs/core.py create mode 100644 modules/armor.py create mode 100644 modules/grenade.py create mode 100644 modules/health.py create mode 100644 modules/mk77.py create mode 100644 modules/mtp57.py diff --git a/libs/core.py b/libs/core.py deleted file mode 100644 index fd7db1c..0000000 --- a/libs/core.py +++ /dev/null @@ -1,60 +0,0 @@ -import sys -import pyMeow as pm -from pynput import keyboard - - -class Pointer: - local_player = 0x17E0A8 - entity_list = 0x18AC04 - player_count = 0x18AC0C - view_matrix = 0x17DFD0 - - -class ProcessManager: - """프로세스 및 모듈 초기화 관리""" - proc = None - base = None - - @classmethod - def initialize(cls): - """AssaultCube 프로세스 초기화""" - try: - cls.proc = pm.open_process("ac_client.exe") - cls.base = pm.get_module(cls.proc, "ac_client.exe")["base"] - print("Process and base initialized successfully.") - except Exception as e: - print(f"Error initializing process: {e}") - sys.exit(1) - - @classmethod - def get_proc(cls): - return cls.proc - - @classmethod - def get_base(cls): - return cls.base - - -class KeyboardManager: - """키보드 입력 관리""" - left_shift_pressed = False - - @classmethod - def setup(cls): - """키보드 리스너 시작""" - listener = keyboard.Listener(on_press=cls._on_press, on_release=cls._on_release) - listener.start() - - @classmethod - def _on_press(cls, key): - if key == keyboard.Key.shift_l: - cls.left_shift_pressed = True - - @classmethod - def _on_release(cls, key): - if key == keyboard.Key.shift_l: - cls.left_shift_pressed = False - - @classmethod - def is_left_shift_pressed(cls): - return cls.left_shift_pressed diff --git a/main.py b/main.py index c9de859..571b699 100644 --- a/main.py +++ b/main.py @@ -1,30 +1,73 @@ +import sys import pyMeow as pm -from libs.core import Pointer, ProcessManager, KeyboardManager -from modules.esp import Entity, init_colors as init_esp_colors -from modules.aimbot import do_aimbot + +from lib.keyboard import KeyboardManager +from modules.esp import Entity, init_colors as init_esp_colors, process_entities +from modules.aimbot import AimBot + +from modules.armor import ArmorHack +from modules.health import HealthHack +from modules.grenade import GrenadeHack +from modules.mtp57 import MTP57Hack +from modules.mk77 import MK77Hack + +class Pointer: + local_player = 0x17E0A8 + entity_list = 0x18AC04 + player_count = 0x18AC0C + view_matrix = 0x17DFD0 + +proc = None +base = None + +hacks = { + "aimbot": True, + "esp": True, + "armor": True, + "health": True, + "grenade": True, + "mtp57": True, + "mk77": True +} def init(): - ProcessManager.initialize() + try: + proc = pm.open_process("ac_client.exe") + base = pm.get_module(proc, "ac_client.exe")["base"] + print("Process and base initialized successfully.") + except Exception as e: + print(f"Error initializing process: {e}") + sys.exit(1) + + print(f"proc : {proc}") + print(f"base : {base}") + KeyboardManager.setup() - print("Starting ESP + Aimbot (Hold Right Shift) overlay...") pm.overlay_init(target="AssaultCube", fps=144, trackTarget=True) init_esp_colors() - def main(): - proc = ProcessManager.get_proc() - base = ProcessManager.get_base() - + while pm.overlay_loop(): pm.begin_drawing() - pm.draw_fps(10, 10) try: player_count = pm.r_int(proc, base + Pointer.player_count) local_player_addr = pm.r_int(proc, base + Pointer.local_player) my_team = pm.r_int(proc, local_player_addr + 0x30C) # team offset + if hacks["armor"] == True: + ArmorHack.apply(proc, local_player_addr) + if hacks["health"] == True: + HealthHack.apply(proc, local_player_addr) + if hacks["grenade"] == True: + GrenadeHack.apply(proc, local_player_addr) + if hacks["mtp57"] == True: + MTP57Hack.apply(proc, local_player_addr) + if hacks["mk77"] == True: + MK77Hack.apply(proc, local_player_addr) + valid_entities = [] if player_count > 1: @@ -32,21 +75,11 @@ def main(): ent_buffer = pm.r_ints(proc, ent_list, player_count)[1:] v_matrix = pm.r_floats(proc, base + Pointer.view_matrix, 16) - for addr in ent_buffer: - if addr == 0: continue - try: - ent = Entity(proc, addr) - valid_entities.append(ent) - if ent.wts(v_matrix): - ent.draw_box() - ent.draw_name() - ent.draw_health() - except: - continue + valid_entities = process_entities(proc, ent_buffer, v_matrix, hacks.get("esp")) - # 에임봇 실행 - do_aimbot(proc, valid_entities, local_player_addr, my_team, KeyboardManager.is_left_shift_pressed()) - + if hacks["aimbot"] == True: + AimBot(proc, valid_entities, local_player_addr, my_team, KeyboardManager.is_left_shift_pressed()) + except Exception as e: pass diff --git a/modules/aimbot.py b/modules/aimbot.py index a5af6c0..78d9802 100644 --- a/modules/aimbot.py +++ b/modules/aimbot.py @@ -7,7 +7,7 @@ class AimbotOffsets: yaw = 0x34 # camera_x pitch = 0x38 # camera_y -def do_aimbot(proc, entities, local_player_addr, my_team, left_shift_pressed): +def AimBot(proc, entities, local_player_addr, my_team, left_shift_pressed): if not left_shift_pressed or not entities: return diff --git a/modules/armor.py b/modules/armor.py new file mode 100644 index 0000000..2afc510 --- /dev/null +++ b/modules/armor.py @@ -0,0 +1,12 @@ +import pyMeow as pm + +class ArmorHack: + offset = 0xF0 + + @classmethod + def apply(cls, proc, local_player_addr, value=100): + """local_player의 Armor 값을 100으로 고정시킵니다.""" + try: + pm.w_int(proc, local_player_addr + cls.offset, value) + except Exception as e: + pass diff --git a/modules/esp.py b/modules/esp.py index 1b09d5c..358b91d 100644 --- a/modules/esp.py +++ b/modules/esp.py @@ -97,3 +97,18 @@ class Entity: segments=0, color=self.color, ) + +def process_entities(proc, ent_buffer, v_matrix, enable_esp): + valid_entities = [] + for addr in ent_buffer: + if addr == 0: continue + try: + ent = Entity(proc, addr) + valid_entities.append(ent) + if enable_esp and ent.wts(v_matrix): + ent.draw_box() + ent.draw_name() + ent.draw_health() + except: + continue + return valid_entities diff --git a/modules/grenade.py b/modules/grenade.py new file mode 100644 index 0000000..0331a59 --- /dev/null +++ b/modules/grenade.py @@ -0,0 +1,12 @@ +import pyMeow as pm + +class GrenadeHack: + offset = 0x144 + + @classmethod + def apply(cls, proc, local_player_addr, value=9999999): + """local_player의 Grenade 값을 9999999로 고정시킵니다.""" + try: + pm.w_int(proc, local_player_addr + cls.offset, value) + except Exception as e: + pass diff --git a/modules/health.py b/modules/health.py new file mode 100644 index 0000000..71b6a20 --- /dev/null +++ b/modules/health.py @@ -0,0 +1,12 @@ +import pyMeow as pm + +class HealthHack: + offset = 0xEC + + @classmethod + def apply(cls, proc, local_player_addr, value=9999): + """local_player의 Health 값을 9999로 고정시킵니다.""" + try: + pm.w_int(proc, local_player_addr + cls.offset, value) + except Exception as e: + pass diff --git a/modules/mk77.py b/modules/mk77.py new file mode 100644 index 0000000..692531a --- /dev/null +++ b/modules/mk77.py @@ -0,0 +1,16 @@ +import pyMeow as pm + +class MK77Hack: + # 008438DC is MK-77 Ammo -> offset 0x12C from local_player (0x8437B0) + # 008438B8 is MK-77 Mag -> offset 0x108 from local_player (0x8437B0) + offset_ammo = 0x12C + offset_mag = 0x108 + + @classmethod + def apply(cls, proc, local_player_addr, ammo_value=999, mag_value=99): + """local_player의 MK-77 총알 및 탄창 개수를 고정시킵니다.""" + try: + pm.w_int(proc, local_player_addr + cls.offset_ammo, ammo_value) + pm.w_int(proc, local_player_addr + cls.offset_mag, mag_value) + except Exception as e: + pass diff --git a/modules/mtp57.py b/modules/mtp57.py new file mode 100644 index 0000000..3f9b41a --- /dev/null +++ b/modules/mtp57.py @@ -0,0 +1,16 @@ +import pyMeow as pm + +class MTP57Hack: + # 008438F0 is MTP-57 Ammo -> offset 0x140 from local_player (0x8437B0) + # 008438CC is MTP-57 Mag -> offset 0x11C from local_player (0x8437B0) + offset_ammo = 0x140 + offset_mag = 0x11C + + @classmethod + def apply(cls, proc, local_player_addr, ammo_value=999, mag_value=99): + """local_player의 MTP-57 총알 및 탄창 개수를 고정시킵니다.""" + try: + pm.w_int(proc, local_player_addr + cls.offset_ammo, ammo_value) + pm.w_int(proc, local_player_addr + cls.offset_mag, mag_value) + except Exception as e: + pass