1.13c自动合成汇编点
转载自动合成的逻辑过于复杂就不给出了主要就是利用以下汇编点:
D2Client:
6FB20AE1为拦截输入框(用于获得命令)
6FB5E11C为客户端获得0x9C 0x04数据包位置 也就是进入储存的触发
6FB5E8D0为客户端获得0x9D 0x05数据包的位置 也是从储存中提起的触发
6FAF4230为hackmap的loop点 我用的hackmap导出位置
发包函数:
class D2PKT_ITEM
{
#define ITEM_ACTION_NEW_GROUND 0x00 //9c//新产生在地上 地上
#define ITEM_ACTION_PICK_UP 0x01 //9c//拾取 多
#define ITEM_ACTION_DROP 0x02 //9c//丢弃 地上
#define ITEM_ACTION_OLD_GROUND 0x03 //9c//旧的地上 地上
#define ITEM_ACTION_TO_STORAGE 0x04 //9c //到储存 STASH
#define ITEM_ACTION_FROM_STORAGE 0x05 //9d从储存 手上
#define ITEM_ACTION_TO_EQUIP 0x06 //9d装备 装备栏
#define ITEM_ACTION_FROM_EQUIP 0x08 //9d从装备 手上
#define ITEM_ACTION_SWITCH_EQUIP 0x09 //9d 切装备 -
#define ITEM_ACTION_TO_STORE 0x0B //9c//到商店 商店
#define ITEM_ACTION_FROM_STORE 0x0C //9c 从商店 INV
#define ITEM_ACTION_SWITCH_STORAGE 0x0d //9c转换储存 不知道
#define ITEM_ACTION_TO_BELTSLOT 0x0E //9c去腰带 腰带
#define ITEM_ACTION_FROM_BELTSLOT 0x0F //9c从腰带 手上
#define ITEM_ACTION_SWITCH_BELTSLOT 0x10 //9c 转换腰带 -
#define ITEM_ACTION_TO_CURSOR 0x12 //9c 到受伤 手上
#define ITEM_ACTION_SHIFT_BELTSLOT 0x15 //9d 切换腰带 -
#define PacketItemMaxTick 150
#define PacketItemPickUpTick 20
private:
static DWORD _PKTItemTick;
static DWORD _PKTItemAction;
static DWORD _PKTItemID;
static BYTE _PKTPKTType;
public:
static DWORD PKTItemGetTick() { return _PKTItemTick; }
static void PKTItemRelease()
{
_PKTItemTick = 0;
_PKTItemAction = 0;
_PKTItemID = 0;
_PKTPKTType = 0;
}
static void PKTItemTellW8(BYTE aPacket0, DWORD dwItemID, DWORD ItemAction, DWORD tick)
{
_PKTPKTType = aPacket0;
_PKTItemTick = tick;
_PKTItemAction = ItemAction;
_PKTItemID = dwItemID;
}
static void PKTItemTellW8(DWORD tick)
{
_PKTItemTick = tick;
}
static void PKTItem9C04(BYTE* aPacket, DWORD aLength,UnitAny* pPlayer)//picktocursor
{
if (aLength >= 8)
{
DWORD dwItemId = 0;
memcpy(&dwItemId, aPacket + 4, sizeof(DWORD));
if (aPacket == PACKET_NEWITEM && aPacket == ITEM_ACTION_TO_STORAGE
&& _PKTItemAction == ITEM_ACTION_TO_STORAGE
&& _PKTPKTType == PACKET_NEWITEM
)
{
if (_PKTItemID == 0 && _PKTItemTick)
{
PKTItemRelease();
}
else if(_PKTItemID== dwItemId&& _PKTItemTick)
{
PKTItemRelease();
}
}
}
}
static void PKTItem9D05(BYTE* aPacket, DWORD aLength, UnitAny* pPlayer)//To Stored
{
if (aLength >= 8)
{
DWORD dwItemId = 0;
memcpy(&dwItemId, aPacket + 4, sizeof(DWORD));
if (aPacket == PACKET_ITEMACTION && aPacket == ITEM_ACTION_FROM_STORAGE
&& _PKTItemAction == ITEM_ACTION_FROM_STORAGE
&& _PKTPKTType == PACKET_ITEMACTION
)
{
if (dwItemId == 0 && _PKTItemTick)
{
PKTItemRelease();
}
else if (dwItemId == _PKTItemID && _PKTItemTick)
{
PKTItemRelease();
}
}
}
}
static void PKTItemGameLoop()
{
if (_PKTItemTick > 0)
_PKTItemTick--;
else if (_PKTItemTick == 0)
PKTItemRelease();
}
static BOOL PKTItemCando()
{
if (_PKTItemTick == 0)return TRUE;
return FALSE;
}
static BOOL BuyItem(DWORD ItemID, DWORD npcid)
{
PKTItemTellW8(PACKET_NEWITEM, 0, ITEM_ACTION_TO_STORAGE, PacketItemMaxTick);
BYTE aPacket = { 0 };
aPacket = 0x32;
::memcpy(&aPacket, &npcid, 4);
::memcpy(&aPacket, &ItemID, 4);
//return D2Net::D2NetSendPacketToServer(0, aPacket, 17);
D2Net::D2SendToServer(17, 0, aPacket);
return TRUE;
}
static BOOL SellItem(DWORD ItemID, DWORD npcid)
{
PKTItemTellW8(PACKET_ITEMACTION, 0, ITEM_ACTION_FROM_STORAGE, PacketItemMaxTick);
BYTE aPacket = { 0 };
aPacket = 0x33;
::memcpy(&aPacket, &npcid, 4);
::memcpy(&aPacket, &ItemID, 4);
//return D2Net::D2NetSendPacketToServer(0, aPacket, 17);
D2Net::D2SendToServer(17, 0, aPacket);
return TRUE;
}
static BOOL Interact(DWORD nUnitId, DWORD nUnitType);
static BOOL PickGroundItem(UnitAny* pItem, BOOL bShowClientMove, BOOL bToCursor);
static BOOL OpenCube()
{
if (D2Client::D2GetUIToggle(UIVAR_CUBE))return TRUE;
UnitAny* pCube = CountStorageItems(LOC_INV, D2TXTCODE('box '), ITEMQUALITY_NORMAL, NULL);
if (!pCube)
{
pCube = CountStorageItems(lOC_STASH, D2TXTCODE('box '), ITEMQUALITY_NORMAL, NULL);
if (!pCube)
return FALSE;
}
PKTItemTellW8(PacketItemMaxTick);
D2CoordStrc mypst = { NULL };
D2Common::D2GetUnitXY(*D2Client::ptPlayerClient, &mypst);
BYTE aPacket = { 0x20,0 };
::memcpy(aPacket + 1, &pCube->nItemNum, 4);
::memcpy(aPacket + 5, &(mypst.nX), 4);
::memcpy(aPacket + 9, &(mypst.nY), 4);
D2Net::D2SendToServer(13, 0, aPacket);
return TRUE;
}
static BOOL ToInvxy(DWORD x, DWORD y)
{
UnitAny* phand = D2Common::D2GetCursorItem((*D2Client::ptPlayerClient)->ptInventory);
if (phand == NULL)
return FALSE;
PKTItemTellW8(PACKET_NEWITEM, phand->nUnitId, ITEM_ACTION_TO_STORAGE, PacketItemMaxTick);
BYTE aPacket = { 0x18,0 };
::memcpy(aPacket + 1, &phand->nItemNum, 4);
::memcpy(aPacket + 5, &x, 4);
::memcpy(aPacket + 9, &y, 4);
D2Net::D2SendToServer(17, 0, aPacket);
return TRUE;
}
static BOOL ToInvRandom(BOOL bBagFix = FALSE)
{
UnitAny* phand = D2Common::D2GetCursorItem((*D2Client::ptPlayerClient)->ptInventory);
if (!phand)
return FALSE;
int desx = 0;
int desy = 0;
if (GetTheFirstStoragePlace(LOC_INV, phand->dwTxtFileNo, &desx, &desy, bBagFix))
{
ToInvxy(desx, desy);
return TRUE;
}
return FALSE;
}
static BOOL ToCube()
{
if (!(*D2Client::ptPlayerClient))return FALSE;
UnitAny* phand=D2Common::D2GetCursorItem((*D2Client::ptPlayerClient)->ptInventory);
if (!phand)return FALSE;
UnitAny* pCube = CountStorageItems(LOC_INV, D2TXTCODE('box '), ITEMQUALITY_NORMAL, NULL);//枚举身上的方块
if (!pCube)
{
pCube = CountStorageItems(lOC_STASH, D2TXTCODE('box '), ITEMQUALITY_NORMAL, NULL);//枚举仓库里的方块
if (!pCube || !pCube->nItemNum)
return FALSE;
}
if (!IsStorageCanStore(LOC_CUBE, phand->dwTxtFileNo, FALSE))
return FALSE;
PKTItemTellW8(PACKET_NEWITEM, phand->nItemNum, ITEM_ACTION_TO_STORAGE, PacketItemMaxTick);
BYTE aPacket = { 0x2A,0 };
::memcpy(aPacket + 1, &phand->nItemNum, 4);
::memcpy(aPacket + 5, &pCube->nItemNum, 4);
D2Net::D2SendToServer(9, 0, aPacket);
return TRUE;
}
static BOOL ToCube(DWORD dwhandID, DWORD dwtxtno);
static BOOL RCBag(DWORD dwItemID)//使用之前一定要检查能不能储存
{
D2CoordStrc mypst = { NULL };
D2Common::D2GetUnitXY(*D2Client::ptPlayerClient, &mypst);
if (!mypst.nX)return FALSE;
PKTItemTellW8(PACKET_NEWITEM, 0, ITEM_ACTION_TO_STORAGE, PacketItemMaxTick);
BYTE aPacket = { 0x20,0 };
::memcpy(aPacket + 1, &dwItemID, 4);
::memcpy(aPacket + 5, &mypst.nX, 4);
::memcpy(aPacket + 9, &mypst.nY, 4);
//return D2Net::D2NetSendPacketToServer(0, aPacket, 13);
D2Net::D2SendToServer(13, 0, aPacket);
return TRUE;
}
static BOOL DropCursorItemToGround()
{
UnitAny* phand = D2Common::D2GetCursorItem((*D2Client::ptPlayerClient)->ptInventory);
if (!phand)
return FALSE;
PKTItemTellW8(PACKET_NEWITEM, phand->nItemNum, ITEM_ACTION_DROP, PacketItemMaxTick);
BYTE aPacket = { 0x17 };
::memcpy(aPacket + 1, &phand->nItemNum, 4);
D2Net::D2SendToServer(5, 0, aPacket);
return TRUE;
}
static BOOL PickStorageItemToCursor(DWORD dwItemID)
{
PKTItemTellW8(PACKET_ITEMACTION, dwItemID, ITEM_ACTION_FROM_STORAGE, PacketItemMaxTick);
BYTE aPacket = { 0 };
aPacket = 0x19;
::memcpy(aPacket + 1, &dwItemID, 4);
//return D2Net::D2NetSendPacketToServer(0, aPacket, 5);
D2Net::D2SendToServer(5, 0, aPacket);
return TRUE;
}
static BOOL InteractItem(DWORD ItemID1, DWORD ItemID2)
{
PKTItemTellW8(PACKET_ITEMACTION, ItemID1, ITEM_ACTION_FROM_STORAGE, PacketItemMaxTick);
BYTE aPacket = { 0x1f,0 };
::memcpy(aPacket + 1, &ItemID1, 4);
::memcpy(aPacket + 5, &ItemID2, 4);
//return D2Net::D2NetSendPacketToServer(0, aPacket, 17);
D2Net::D2SendToServer(17, 0, aPacket);
return TRUE;
}
static BOOL Transmute()
{
if (!(*D2Client::ptPlayerClient))return FALSE;
if (D2Common::D2GetCursorItem((*D2Client::ptPlayerClient)->ptInventory))
return FALSE;
PKTItemTellW8(PACKET_NEWITEM, 0, ITEM_ACTION_TO_STORAGE, PacketItemMaxTick);
BYTE aPacket = { 0 };
aPacket = 0x4f;
aPacket = 0x18;
D2Net::D2SendToServer(7, 0, aPacket);
return TRUE;
}
};
页:
[1]