在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

相关推荐
最好有梦想~1 天前
嵌入式Linux Lua使用ZeroBrane远程调试
linux·嵌入式硬件·lua
陌上花开缓缓归以2 天前
mips u-boot如何在汇编中添加调式打印
汇编
chushiyunen2 天前
lua脚本笔记、redis使用lua解锁
redis·笔记·lua
深蓝轨迹2 天前
Redis+Lua实现秒杀优化
数据库·redis·lua
qhs15733 天前
解决 LuaJIT 报错:unknown luaJIT command or jit.* modules not installed
lua
山楂树の3 天前
【计算机系统原理】Intel 与 AT&T 汇编指令格式转换
汇编·学习·缓存
luanma1509803 天前
Laravel 8.X重磅特性全解析
前端·javascript·vue.js·php·lua
luanma1509803 天前
Laravel 7.X核心特性深度解析
android·开发语言·php·lua·laravel
上海合宙LuatOS4 天前
LuatOS扩展库API——【air153C_wtd】外部硬件看门狗
物联网·lua·air153c_wtd 库
上海合宙LuatOS4 天前
LuatOS核心库API——【ymodem】文件传输协议
物联网·lua·ymodem协议