因此,我想将python代码与游戏代码集成(使用游戏的源引擎),并使用引擎.dll在
我试过这个代码:
#######################################################################
# Imports
from ctypes import *
from ctypes.wintypes import *
#######################################################################
MessageBox = ctypes.windll.user32.MessageBoxW
GetModuleHandle = ctypes.windll.kernel32.GetModuleHandleW
GetProcAddress = ctypes.windll.kernel32.GetProcAddress
#######################################################################
EngineFactory = WINFUNCTYPE(c_void_p, c_char_p, c_void_p)(GetProcAddress(GetModuleHandle("engine.dll"), b"CreateInterface"))
dwResult = EngineFactory(b"VEngineClient013", 0)
MessageBox(0, "{0}".format(hex(dwResult)), 0, 0)
它没有工作,代码在调用EngineFactory后停止,我看不到消息框,我检查了ollydbg,看看代码是否正在执行CreateInterface函数,它确实在执行正在工作。那个app调用这个函数并返回一个有效的指针,但我在python代码中无法接收到它。。。在
目前没有回答
相关问题 更多 >
编程相关推荐