如何找关键代码就不说了,网上太多了,这里写了2个小脚本供大家消遣一下:
脚本1:
[ENABLE]
//code from here to '[DISABLE]' 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:
[DISABLE]
//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 [ebx+000004AC],eax
脚本2:
[ENABLE]
//code from here to '[DISABLE]' 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 [ebx+000004AC],eax
[DISABLE]
//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 [ebx+000004AC],eax