某百度贴吧的cheatEngine内嵌的lua资料
(2017-06-12 11:50:21)分类: 编程 |
lua是一种脚本语言.
cheatEngine6.3有内置的lua解释器,当然还有自己的api.某百度贴吧的资料如下:
读写操作:
readInteger("400600")--从400600中读取整数
readFloat("400600")--从400600中读取浮点
readBytes("400600",10)--从400600中读取一个字节十进制,长度10
writeInteger("400600",48658)--写整数到400600
writeFloat("400600",1)--写浮点数到400600
writeBytes("400400",255,255,255)--写字节到400600十进制
----------------------------------------------
获取进程PID:
getProcessIDFromProcessName("DNF.exe")--通过进程名获取PID
openProcess()--打开指定PID
----------------------------------------------
控件类:
设置控件文本:
control_getCaption(UDF1_CEE)--返回一个窗口组件的内容
control_setCaption(UDF1_CEE,1)写一个文本到指定组件文本
按钮事件:
function CEButton1Click(sender)--按钮被单击触发事件
showMessage(gAboutText) --信息框提示文本
end --单行文本""
--多行文本[[内容]]
gAboutText=[[This trainer was made by Cheat
Engine
http://www.cheatengine.org]]
自定义信息框:
1文本,2提示方式,3信息框按钮
messageDialog([[Please install Cheat Engine ]],5,0,1,2,3,4,5,6,7,8,9,10,11)--0是,1否,2确定,3取消,4中止,5重试,6忽略,7所有,8全否,9全是,10帮助,11关闭
----------------------------------------------
CEAA脚本汇编类:
autoAssemble()--运行文本格式汇编脚本
function oigCheckBoxClick(sender)
if checkbox_getState(WG1_oigCheckBox) == cbChecked then
autoAssemble(step1On) --单选框选中执行启动脚本
else
autoAssemble(step1Off) --单选框未选中执行禁用脚本
end
end
step1Off = [[
1B10860:
db b8 ff ff 00 00
]]
step1On = [[
alloc(newmem,1024)
alloc(GetSkill,1024)
alloc(table1,0x1000)
alloc(table2,0x1000)
label(GetSkill_next)
label(GetSkill_end)
GetSkill:
push ebp
mov ebp,esp
xor eax,eax
push eax
pushad
mov ebx,[ebp+8]
xor edi,edi
mov esi,table1
mov ecx,table2
GetSkill_next:
cmp edi,1000
jge GetSkill_end
mov eax,[esi+edi*4]
test eax,eax
je GetSkill_end
inc edi
cmp eax,ebx
jne GetSkill_next
dec edi
mov eax,[ecx+edi*4]
mov [ebp-4],eax
GetSkill_end:
popad
mov eax,[ebp-4]
mov esp,ebp
pop ebp
ret 4
label(end)
newmem:
pushad
mov esi,[ebp-00000628]
push esi
call GetSkill
cmp eax,0
je end
mov dword ptr ss:[ebp-00000628],eax
end:
popad
mov eax,0FFFF
ret
table1:
dd #9141
dd #30304
dd #10500
table2:
dd #30303
dd #10499
dd #56006
1B10860:
call newmem
]]
cheatEngine6.3有内置的lua解释器,当然还有自己的api.某百度贴吧的资料如下:
读写操作:
readInteger("400600")--从400600中读取整数
readFloat("400600")--从400600中读取浮点
readBytes("400600",10)--从400600中读取一个字节十进制,长度10
writeInteger("400600",48658)--写整数到400600
writeFloat("400600",1)--写浮点数到400600
writeBytes("400400",255,255,255)--写字节到400600十进制
----------------------------------------------
获取进程PID:
getProcessIDFromProcessN
openProcess()--打开指定PID
----------------------------------------------
控件类:
设置控件文本:
control_getCaption(UDF1_CEE)--返回一个窗口组件的内容
control_setCaption(UDF1_CEE,1)写一个文本到指定组件文本
按钮事件:
function CEButton1Click(sender)--按钮被单击触发事件
showMessage(gAboutText) --信息框提示文本
end --单行文本""
--多行文本[[内容]]
gAboutText=[[This trainer was made by Cheat
Engine
http://www.cheatengine.org]]
自定义信息框:
1文本,2提示方式,3信息框按钮
messageDialog([[Please install Cheat Engine ]],5,0,1,2,3,4,5,6,7,8,9,10,11)--0是,1否,2确定,3取消,4中止,5重试,6忽略,7所有,8全否,9全是,10帮助,11关闭
----------------------------------------------
CEAA脚本汇编类:
autoAssemble()--运行文本格式汇编脚本
function oigCheckBoxClick(sender)
if checkbox_getState(WG1_oigCheckBox) == cbChecked then
autoAssemble(step1On) --单选框选中执行启动脚本
else
autoAssemble(step1Off) --单选框未选中执行禁用脚本
end
end
step1Off = [[
1B10860:
db b8 ff ff 00 00
]]
step1On = [[
alloc(newmem,1024)
alloc(GetSkill,1024)
alloc(table1,0x1000)
alloc(table2,0x1000)
label(GetSkill_next)
label(GetSkill_end)
GetSkill:
push ebp
mov ebp,esp
xor eax,eax
push eax
pushad
mov ebx,[ebp+8]
xor edi,edi
mov esi,table1
mov ecx,table2
GetSkill_next:
cmp edi,1000
jge GetSkill_end
mov eax,[esi+edi*4]
test eax,eax
je GetSkill_end
inc edi
cmp eax,ebx
jne GetSkill_next
dec edi
mov eax,[ecx+edi*4]
mov [ebp-4],eax
GetSkill_end:
popad
mov eax,[ebp-4]
mov esp,ebp
pop ebp
ret 4
label(end)
newmem:
pushad
mov esi,[ebp-00000628]
push esi
call GetSkill
cmp eax,0
je end
mov dword ptr ss:[ebp-00000628],eax
end:
popad
mov eax,0FFFF
ret
table1:
dd #9141
dd #30304
dd #10500
table2:
dd #30303
dd #10499
dd #56006
1B10860:
call newmem
]]