losemao 发表于 2023-6-27 09:19

Cheat Engine教程:对步骤2教程的脚本另类写法

如何找关键代码就不说了,网上太多了,这里写了2个小脚本供大家消遣一下:
脚本1:

//code from here to '' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
{$luacode playerbase=ebx testparam=eax}
printf("Tutorial hit me called.testparam=%d",testparam)
writeInteger(playerbase+0x4AC,1000)
{$asm}
jmp returnhere
originalcode:


exit:
jmp returnhere

"Tutorial-i386.exe"+2578F:
jmp newmem
nop
returnhere:





//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"Tutorial-i386.exe"+2578F:
db 29 83 AC 04 00 00
//sub ,eax

脚本2:

//code from here to '' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
{$CCODE playerbase=ebx newhealth=eax}
*(int*)(playerbase+0x4AC)=1000;
newhealth=0;
{$ASM}
originalcode:
sub ,eax

exit:
jmp returnhere

"Tutorial-i386.exe"+2578F:
jmp newmem
nop
returnhere:





//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"Tutorial-i386.exe"+2578F:
db 29 83 AC 04 00 00
//sub ,eax

代码很简单,一个用lua,一个用c,具体就不解释了。
页: [1]
查看完整版本: Cheat Engine教程:对步骤2教程的脚本另类写法