Learning Goals:
Mobile Item Function Encapsulation
Homework:
Extract the signature of the warehouse list base address, and add back to the warehouse list base address to update the code.
BOOL Movegoodtodepot (char*szpgoodsname);//move the specified items in the backpack into the warehouse
#define BASE_DEPOTLIST 0x31c9a24//Warehouse list base address DD [[0x31c9a24]+410+4*0]
#define BASECALL_MOVEGOODS 0X007A0A20//Mobile Item Call
Add the following member functions in the Backpack list structure
BOOL selgoods (DWORD ndindex);//Select a cell in the backpack
BOOL Movegoodstodepot (DWORD ndindex=1);//Move selected items to a certain grid in the warehouse
Item Move Call
If you select an item first
Move the items in your backpack to the warehouse.
MOV ebx,4//subscript
mov edi,dword ptr ds:[base_backpacklist]//backpack base
MOV Eax,dword PTR ds:[edi+ebx*4+0x410]
MOV Ecx,dword PTR Ds:[baseselgoodskill]
MOV DWORD PTR Ds:[ecx+0x228],eax
MOV Edx,dword PTR Ds:[baseselgoodskill]
MOV BYTE PTR ds:[edx+0x230],0x1
MOV Eax,dword PTR Ds:[baseselgoodskill]
MOV Ecx,dword PTR ds:[eax+0x228]
MOV Dx,word PTR ds:[edi+0x1608]
MOV WORD PTR DS:[ECX+0X1F2],DX
MOV Edi,dword PTR ds:[base_depotlist]//Warehouse list base
MOV Ecx,dword PTR ds:[edi+0x1608]//list category number
MOV Edx,dword PTR ds:[edi+0x1bd0]
Push 1
Push ECX
Push edx
MOV Ecx,edi
MOV eax,basecall_movegoods
Call EAX
DWORD Tbackpack_list::selgoods (DWORD Ndindex)//Select a cell in the backpack
{
DWORD Ndobj=null;
__try
{
__asm
{
MOV Ebx,ndindex//subscript
mov edi,dword ptr ds:[base_backpacklist]//backpack base
MOV Eax,dword PTR ds:[edi+ebx*4+0x410]
MOV ndobj,eax//Remove Object
MOV Ecx,dword PTR Ds:[baseselgoodskill]
MOV DWORD PTR Ds:[ecx+0x228],eax
MOV Edx,dword PTR Ds:[baseselgoodskill]
MOV BYTE PTR ds:[edx+0x230],0x1
MOV Eax,dword PTR Ds:[baseselgoodskill]
MOV Ecx,dword PTR ds:[eax+0x228]
MOV Dx,word PTR ds:[edi+0x1608]
MOV WORD PTR DS:[ECX+0X1F2],DX
}
}__except (1)
{
Dbgprintf_mine ("Exception BOOL Tbackpack_list::selgoods (DWORD ndindex)//Select a box in the Backpack \ r \ n");
return NULL;
}
return ndobj;
}
BOOL Tbackpack_list::movegoodstodepot (DWORD ndindex)//Move selected items to a certain grid in the warehouse
{
__try
{
__asm
{
MOV Edi,dword PTR ds:[base_depotlist]//Warehouse list base
MOV Ecx,dword PTR ds:[edi+0x1608]//list category number
MOV Edx,dword PTR ds:[edi+0x1bd0]
MOV Eax,ndindex
Push 1
Push ECX
Push edx
MOV Ecx,edi
MOV eax,basecall_movegoods
Call EAX
}
}__except (1)
{
Dbgprintf_mine ("Exception Tbackpack_list::movegoodstodepot (DWORD ndindex=1)//Move selected items to a certain grid in the warehouse \ r \ n");
return FALSE;
}
return TRUE;
}
External technology mobile items to warehouse code writing