在CE自动汇编里调用lua函数

CE自动汇编模板里有一个是调用lua函数,但是关于如何使用的资料很少,结果问AI也是各种错误回答,还各种误导...

下面是32位游戏的例子:

cpp 复制代码
loadlibrary(luaclient-i386.dll)
luacall(openLuaServer('CELUASERVER'))

CELUA_ServerName:
db 'CELUASERVER',0

{$lua}
function myfunction(param)
  showMessage("param:"..param)
end

{$asm}
alloc(myluascript,256)
myluascript:
db 'myfunction(parameter)',0

alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

newmem:
//place your code here
pushad
push 0x00D9F000 //param
push myluascript
call CELUA_ExecuteFunction
popad

originalcode:
call _Launcher.exe+68FBA0

exit:
jmp returnhere

"_Launcher.exe"+68E1C0:
jmp newmem
returnhere:

参考资料:

https://forum.cheatengine.org/viewtopic.php?t=605733

https://forum.cheatengine.org/viewtopic.php?t=615359

相关推荐
Lzh编程小栈1 天前
数据结构与算法之队列深度解析:循环队列+C 语言硬核实现 + 面试考点全梳理
c语言·开发语言·汇编·数据结构·后端·算法·面试
DJ斯特拉1 天前
Redis使用lua脚本
junit·单元测试·lua
Aktx20FNz1 天前
OpenClaw中级到高级教程
lua
LcGero1 天前
Lua + Cocos Creator 实战:用 Lua 驱动 UI 与游戏逻辑
游戏·ui·lua
cch89182 天前
汇编与C语言:底层对话VS高效指挥
c语言·开发语言·汇编
jwn9992 天前
PHP vs 汇编:编程语言的两极对决
开发语言·汇编·php
cch89183 天前
汇编vs易语言:底层与中文编程终极对决
汇编
静心观复3 天前
Lua 脚本是什么
开发语言·lua
LcGero3 天前
Lua 协程(Coroutine):游戏里的“伪多线程”利器
游戏·lua·游戏开发·协程
星夜泊客3 天前
《Lua 模块化核心:require 的地址传递与缓存机制》
缓存·lua