# 注册大漠
import ctypes
import os
import win32api
import win32com.client
import win32con
from pymem.ressources.kernel32 import WriteProcessMemory
p = os.getcwd()
os.system(r'regsvr32 /s %s\dm.dll' % p)
dm = win32com.client.Dispatch('dm.dmsoft')
print(dm.Ver())
pid = win32api.GetCurrentProcessId()
mydll = win32api.GetModuleHandle("dm.dll")
handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, False, pid)
newdata = ctypes.c_long(1)
if WriteProcessMemory(int(handle), mydll + 0x109590, ctypes.byref(newdata), 1, None):
print('成功改写内存!')
else:
print('写内存错误!')
大漠调用python源码