External technology mobile items to warehouse code writing

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.