常用命令解析
[ebp-14]括号中间的其实是一个16进制的内存地址,但是该地址是ebp-14(ebp和14都是十六进制)。简单理解就是[]就是取中间寄存器的内存地址
mov 赋值
将10[16进制],存入到eax寄存器(或者你也可以理解为变量eax,不过这么理解不太恰当)中
mov eax,10
cmp 比较
将esi和esp的值进行比较
cmp esi,esp
je 若比较结果相等
若比较相等,则跳到00E38D0
je 00E38DD0
jne 若比较不等
若比较不等,跳转00E38D0
jne 00E38DD0
add 加法
将eax + 1 (16进制下的运算)
add eax,01
sub 减法
将eax - 1 (16进制下的运算)
sub eax,01
push 推送某寄存器入栈
将eax寄存器推入栈
push eax
pop 将某栈内数据取出保存
将eax寄存器取出保存
pop eax
call 程序调用
调用00E3113B的程序
call 00E3113B
lea 赋值
有点类似于mov,但是该函数大多只用来存储内存地址,比如如下命令则意为将 [ebp-0C] ,存入eax 里面去
假设eax = 00E3133E ebp = 00F004EA 那么 ebp-0C = 00F004DE
运行代码以后
eax = 00F004DE , ebp = 00F004EA , ebp-0C = 00F004DE
lea eax,[ebp-0C]
常用的注入代码
其实就几个就够了,我给大家贴一点注释就好
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
aobscan(demo,83 C0 01 89 45 EC 8B F4)//搜索 83 C0 01 89 45 EC 8B F4 这个特征码,搜索出来的结果是一个指针 demo是指针变量
alloc(newmem,2048)//开辟一个内存空间,2048是 2048个字节
alloc(ret,2048)
registersymbol(ret)//为自己开辟的内存空间注册入程序
label(returnhere)//这是标签,让这个东西像call一样可以被调用
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
originalcode:
add eax,01
mov [ebp-14],eax
push esi
lea esi ,[ebp-14]
mov [ret],esi
pop esi
exit:
jmp returnhere
demo:
jmp newmem
nop
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
dealloc(ret)//开辟了就要关闭,防止野指针过多导致游戏崩溃
unregistersymbol(ret)//注册了也要取消注册,好的就这样了
demo:
add eax,01
mov [ebp-14],eax
//Alt: db 83 C0 01 89 45 EC
有些时候用aobscan特征码搜出来的东西,有些时候想要的是特征码搜出来的地址,这个该怎么操作呢
下面是一个案例,脚本运行以后,手动添加指针ret,将值改为字符数组,就是存的内存地址了
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
aobscan(demo,cc 0a 00 00)
alloc(ret,2048)
registersymbol(ret)
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
originalcode:
mov eax,[ebp-14]
push eax
push testfuck.exe+1CCD0
push esi
mov [esi],demo//把搜出来的demo存给esi
mov [ret],esi//再把esi的内存值给ret
pop esi
exit:
jmp returnhere
"testfuck.exe"+18C0E:
jmp newmem
nop 4
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"testfuck.exe"+18C0E:
mov eax,[ebp-14]
push eax
push testfuck.exe+1CCD0
//Alt: db 8B 45 EC 50 68 D0 CC AE 00
同样的也可以不要地址要值,直接把值存给ret就行
mov [ret],demo