標籤:c++ 遊戲 輔助 外掛 逆向
學習目標:
移動物品函數封裝
作業:
提取倉庫列表基址的特徵碼,添回倉庫列表基址更新代碼。
BOOL MoveGoodToDepot(char*szpGoodsName);//把背包裡的指定物品 移動到倉庫裡邊
#define Base_DepotList 0x31C9A24 //倉庫列表基址 dd [ [0x31C9A24]+410+4*0]
#define BaseCAll_MoveGoods 0x007A0A20 //移動物品CALL
//在背包列表 結構裡添加下列成員函數
BOOL SelGoods(DWORD ndIndex);//選中背包裡的某一格
BOOL MoveGoodsToDepot(DWORD ndIndex=1);//移動選中物品到倉庫的某一格
//物品移動CALL
//前提 先選中物品
//把背包裡的物品 移動到倉庫
mov ebx,4 //下標
mov EDI,dword ptr ds:[Base_BackPackList] //背包基址
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] //倉庫列表基址
MOV ECX,DWORD PTR DS:[EDI+0x1608] //列表分類編號
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) //選中背包裡的某一格
{
DWORD ndObj=NULL;
__try
{
__asm
{
mov ebx,ndIndex //下標
mov EDI,dword ptr ds:[Base_BackPackList] //背包基址
MOV EAX,DWORD PTR DS:[EDI+EBX*4+0x410]
mov ndObj,eax//取出對象
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("異常 BOOL TBACKPACK_LIST::SelGoods(DWORD ndIndex) //選中背包裡的某一格\r\n");
return NULL;
}
return ndObj;
}
BOOL TBACKPACK_LIST::MoveGoodsToDepot(DWORD ndIndex) //移動選中物品到倉庫的某一格
{
__try
{
__asm
{
MOV EDI,DWORD PTR DS:[Base_DepotList] //倉庫列表基址
MOV ECX,DWORD PTR DS:[EDI+0x1608] //列表分類編號
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("異常 TBACKPACK_LIST::MoveGoodsToDepot(DWORD ndIndex=1) //移動選中物品到倉庫的某一格\r\n");
return FALSE;
}
return TRUE;
}
外掛技術移動物品到倉庫代碼編寫