在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

相关推荐
JCBP_2 天前
QT(4)
开发语言·汇编·c++·qt·算法
java搬砖工-苤-初心不变2 天前
基于 lua_shared_dict 的本地内存限流实现
开发语言·junit·lua
程序猿多布3 天前
XLua教程之热补丁技术
unity·c#·lua·xlua
java搬砖工-苤-初心不变3 天前
OpenResty 限流方案对比:lua_shared_dict vs Redis
redis·lua·openresty
sheepwjl3 天前
《嵌入式硬件(十二):基于IMX6ULL的时钟操作》
汇编·arm开发·单片机·嵌入式硬件·时钟·.s编译
程序猿多布3 天前
XLua教程之Lua调用C#
unity·c#·lua·xlua
DebugKitty3 天前
硬件开发2-ARM裸机开发1-I.MX6ULL - 汇编点灯
汇编·makefile·imax6ull·gpio·电路复用
我菜就多练3 天前
ARM-汇编的基础知识
汇编·arm开发
(Charon)3 天前
函数之间跳转的实现方式详解:setjmp/longjmp、ucontext 与汇编
汇编
夜猫逐梦3 天前
【Lua】Windows 下编写 C 扩展模块:VS 编译与 Lua 调用全流程
c语言·windows·lua