大航海时代ol台服找Call记(十七)交易商货物数据分析 - 3 (购买货物CALL)
根据第(十五)篇,了解了交易商货物在内存中的数据结构。根据万能call 找到购买货物的call
GVOnline.exe+4AD0D - 8B 73 34 - mov esi,[ebx+34]
GVOnline.exe+4AD10 - 8B 7B 30 - mov edi,[ebx+30]
GVOnline.exe+4AD13 - E8 68171100 - call GVOnline.exe+15C480
GVOnline.exe+4AD18 - FF 75 10 - push [ebp+10]
GVOnline.exe+4AD1B - 8D 4D C4 - lea ecx,[ebp-3C]
GVOnline.exe+4AD1E - FF 75 0C - push [ebp+0C]
GVOnline.exe+4AD21 - 51 - push ecx
GVOnline.exe+4AD22 - 56 - push esi
GVOnline.exe+4AD23 - 57 - push edi
GVOnline.exe+4AD24 - FF 73 24 - push [ebx+24]
GVOnline.exe+4AD27 - 8D 88 A81A0000 - lea ecx,[eax+00001AA8]
GVOnline.exe+4AD2D - E8 6E5B6E00 - call GVOnline.exe+7308A0 //------>购买货物call
在call断下来时,堆栈内容如下:
0019FD58(esp+0) - 00000016 - (dword)00000016(22) 参数1:窗口ID(固定)
0019FD5C(esp+4) - 00000000 - (dword)00000000(0) 参数2:固定为0
0019FD60(esp+8) - 0180022A - (dword)0180022A(25166378) 参数3:NPC ID(交易商)
0019FD64(esp+C) - 0019FD7C - (pointer)0019FD7C 参数4:堆栈内存地址
0019FD68(esp+10) - 0019FDE8 - (pointer)0019FDE8 参数5:堆栈内存地址
0019FD6C(esp+14) - 00000000 - (dword)00000000(0) 参数6:固定为0

参数4

参数5

购买物品数组
可知与酒馆点料理有点类似,需要构造内存块数据,CE的Autoassemble如下:
//-------------------------------
alloc(newmem,2048)
newmem:
pushad
sub esp, $100 //堆栈里分配$100个字节
mov edx,esp
mov [edx],0x00f418e8 //固定值
mov [edx+4],0
mov [edx+8],0
mov [edx+c],0
mov [edx+10],0
push 0 //参数6 (0;购买,1:赖帐)
push edx //参数5
add edx,0x14
mov eax,edx // 购买物品数组地址
mov [edx],0x00186a0e //物品ID
mov [edx+4],0x774a0002 //其中:0x774a 为固定值 ,02 为购买数量
mov [edx+8],0x00000082 //购买单价
mov [edx+c],0x09 //品种数量: 1:1; 2-5:5; >5:9 (实际可以随便填不影响)
add edx,0x10
mov [edx],0x00f3971c //固定值
mov [edx+4],eax
mov [edx+8],0x00000001 //购买物品种类数
push edx //参数4
push 0x00180022a //参数3
push 0 //参数2
push 0x16 //参数1
mov ecx,0x01217388
call 00B308A0 //此call会减少0c个堆栈
add esp , $100
popad
ret
createthread(newmem)
//----------------------------------
注:购买货物时需要打开购物窗口,参数价格必须为实时的真实价格。否则 ,会提示 商品价格有变化,购买货物失败。
浙公网安备 33010602011771号