import ctypes
import ctypes.wintypes
import psutil
def find_process_by_name(process_name):
for proc in psutil.process_iter(attrs=['pid', 'name']):
if proc.info['name'] == process_name:
return proc.info['pid']
return None
def write_memory(process_handle, address, value):
ctypes.windll.kernel32.WriteProcessMemory(
process_handle,
address,
ctypes.byref(ctypes.c_float(value)),
ctypes.sizeof(ctypes.c_float()),
None
)
process_name = "Game.exe"
pid = find_process_by_name(process_name)
if pid is None:
print(f"Process '{process_name}' not found!")
else:
print(f"Process '{process_name}' found with PID: {pid}")
process_handle = ctypes.windll.kernel32.OpenProcess(0x1F0FFF, False, pid) # PROCESS_ALL_ACCESS = 0x1F0FFF
if not process_handle:
print("Failed to open the process.")
else:
try:
address1 = 0x047B0C98
address2 = 0x047B0C9C
write_memory(process_handle, address1, -2.690775871)
write_memory(process_handle, address2, -1.159874678)
print(f"Все гудд
{hex(address1)} and {hex(address2)}")
finally:
ctypes.windll.kernel32.CloseHandle(process_handle)