From 9f55b5edb1ec7b44648e33cc509fb2e79244faa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=96=AF?= <2240031003@qq.com> Date: Sat, 3 Sep 2022 17:30:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=9C=9C=E8=9C=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base.h | 55 +- src/controller.cpp | 45 +- src/controller.h | 12 +- src/df_main.cpp | 70 +- src/dispatch.cpp | 124 +++- src/dispatch.h | 2 + src/enum.h | 8 +- src/ida_sdk.h | 300 +++++++++ src/inline_hook.h | 46 +- src/sdk_class.h | 259 +++++++- test/main.cc | 1550 ++------------------------------------------ 11 files changed, 875 insertions(+), 1596 deletions(-) create mode 100644 src/ida_sdk.h diff --git a/src/base.h b/src/base.h index 265faa5..b3432f2 100644 --- a/src/base.h +++ b/src/base.h @@ -45,6 +45,7 @@ namespace base const int getCurCharacInvenW = 0x80DA28E; const int _checkItemMovable = 0x0865F1E1; const int getCurCharacInvenR = 0x080DA27E; + const int getCurCharacR = 0x08120432; } namespace CUser @@ -67,7 +68,7 @@ namespace base const int GetAccountCargo = 0x0822FC22; const int CheckInTrade = 0x080DA2FE; const int IsExistAccountCargo = 0x0822FC30; - const int send_itemspace = 0x0865DB6C; + const int send_itemspace = 0x0865DB6C; } @@ -83,6 +84,39 @@ namespace base const int is_stackable = 0x80F12FA; const int IsRoutingItem = 0x08150F18; const int GetAttachType = 0x080F12E2; + const int GetCashPrice = 0x0822C856; + const int GetDyeInfo = 0x0822C86E; + const int GetExpertJobAdditionalExp = 0x0850D30E; + const int GetExpertJobCompoundMaterialVariation = 0x0850D292; + const int GetExpertJobCompoundRateVariation = 0x0850D2AA; + const int GetExpertJobCompoundResultVariation = 0x0850D2C2; + const int GetExpertJobSelfDisjointBigWinRate = 0x0850D2DE; + const int GetExpertJobSelfDisjointResultVariation = 0x0850D2F6; + const int GetFinishPointPrice = 0x0822C83E; + const int GetIncreaseStatusIntData = 0x08694658; + const int GetIncreaseStatusType = 0x086946B6; + const int GetItemIconName = 0x085143EC; + const int GetItemName = 0x0811ED82; + const int GetMedalPrice = 0x0822C862; + const int GetNeedLevel = 0x08545FDA; + const int GetNeedMaterial = 0x0850D6F4; + const int GetQuestItemDropBouns = 0x08514404; + const int GetRandomOptionGrade = 0x0851441C; + const int GetSellPrice = 0x08473612; + const int GetUpSkillType = 0x08545FCC; + const int GetUsablePvPRank = 0x086946C4; + const int getAdvanceAltarNeedGage = 0x081347CA; + const int getExpirationDate = 0x080F1306; + const int getFootControlRateLimit = 0x0850D286; + const int getItemGroupName = 0x080F1312; + const int getUsableLevel = 0x080F12EE; + const int getUsablePeriod = 0x08110C60; + const int get_gen_rate = 0x0832E02A; + const int get_grade = 0x08110C54; + const int get_index = 0x08110C48; + const int get_need_skill = 0x0850D27A; + const int get_price = 0x0822C84A; + const int get_rarity = 0x080F12D6; } namespace CEquipItem @@ -97,7 +131,9 @@ namespace base const int getKey = 0x850D14E; const int isEquipableItemType = 0x08150812; const int IsTradeLimitAttachTypeItem = 0x081201DC; - const int GetItemSpace = 0x083481E2; + const int GetItemSpace = 0x083481E2; + const int SetReSealCount = 0x0822B466; + const int GetReSealCount = 0x0822B456; } @@ -115,6 +151,8 @@ namespace base const int gain_money = 0x84FF29C; const int GetInvenRef = 0x84FC1DE; const int GetInvenSlot = 0x084FB918; + const int update_item = 0x085000AE; + } namespace DB_UpdateAvatarJewelSlot @@ -133,6 +171,7 @@ namespace base const int get_short = 0x858CFC0; const int get_int = 0x858D27E; const int get_binary = 0x858D3B2; + const int copy = 0x0858DCD2; } namespace InterfacePacketBuf @@ -274,6 +313,18 @@ namespace base const int Get = 0x081935A2; const int SendDurability = 0x08190416; } + + namespace Dispatcher_ModItemAttr + { + const int dispatch_sig = 0x08200B08; + const int dispatch_sig_hook = 0x08201119; //.text:08201119 cmp eax, 28D14Eh + const int dispatch_sig_ret = 0x0820111E; //.text:0820111E ja short loc_820113E + const int _SendResult = 0x08201938; + + } + } + + diff --git a/src/controller.cpp b/src/controller.cpp index df16c68..8bc88af 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -11,6 +11,7 @@ Controller::Controller() : old_IPacketDispatcher_ParamBase_dispatch_template((IPacketDispatcher_ParamBase_dispatch_template_Type*)base::IPacketDispatcher::ParamBase::dispatch_template), old_UseJewel_dispatch_sig((UseJewel_dispatch_sig_Type*)base::Dispatcher_UseJewel::dispatch_sig), + old_Dispatcher_ModItemAttr_dispatch_sig((Dispatcher_ModItemAttr_dispatch_sig_Type*)base::Dispatcher_ModItemAttr::dispatch_sig), old_PacketDispatcher_doDispatch((PacketDispatcher_doDispatch_Type*)base::PacketDispatcher::doDispatch) { @@ -24,22 +25,26 @@ Controller::~Controller() void Controller::init() { - CodeHook::WriteUChar((void*)(base::GlobalData::Init_fix_1 - 0x1), 0); + Mem::WriteUChar((void*)(base::GlobalData::Init_fix_1 - 0x1), 0); //.text:085BDE9D 83 F8 0A cmp eax, 10 - CodeHook::WriteUChar((void*)(base::CParty::addDungeonClear_fix_1 + 2), 0x7E); //普通被击 + Mem::WriteUChar((void*)(base::CParty::addDungeonClear_fix_1 + 2), 0x7E); //普通被击 //.text:085BDF30 83 F8 1E cmp eax, 30 - CodeHook::WriteUChar((void*)(base::CParty::addDungeonClear_fix_2 + 2), 0x7E); //远古被击 + Mem::WriteUChar((void*)(base::CParty::addDungeonClear_fix_2 + 2), 0x7E); //远古被击 //.text:085BDFC3 83 F8 32 cmp eax, 50 - CodeHook::WriteUChar((void*)(base::CParty::addDungeonClear_fix_3 + 2), 0x7E); //异界被击 + Mem::WriteUChar((void*)(base::CParty::addDungeonClear_fix_3 + 2), 0x7E); //异界被击 //mhook_IPacketDispatcher_ParamBase_dispatch_template.Hook((void**)&old_IPacketDispatcher_ParamBase_dispatch_template, (void*)hook_IPacketDispatcher_ParamBase_dispatch_template); - mhook_PacketDispatcher_doDispatch.Hook((void**)&old_PacketDispatcher_doDispatch, (void*)hook_PacketDispatcher_doDispatch); mhook_UseJewel_dispatch_sig.Hook((void**)&old_UseJewel_dispatch_sig, (void*)hook_UseJewel_dispatch_sig); + mhook_UseJewel_dispatch_sig.Hook((void**)&old_Dispatcher_ModItemAttr_dispatch_sig, (void*)hook_Dispatcher_ModItemAttr_dispatch_sig); + + mhook_PacketDispatcher_doDispatch.Hook((void**)&old_PacketDispatcher_doDispatch, (void*)hook_PacketDispatcher_doDispatch); + + LOG("Controller::init()"); } @@ -234,6 +239,34 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* us return 0; } +int Controller::hook_Dispatcher_ModItemAttr_dispatch_sig(Dispatcher_ModItemAttr* dis_mod, CUser* user, PacketBuf* pBuf) +{ + PacketBuf new_buf; + memcpy(&new_buf, pBuf, sizeof(PacketBuf)); + int equipment_pos = new_buf.get_short(); + int equipment_id = new_buf.get_int(); + int item_pos = new_buf.get_short(); + + CInventory* CurCharacInvenW = user->getCurCharacInvenR(); + + auto item_inven = CurCharacInvenW->GetInvenRef(CInventory::INVENTORY_TYPE_ITEM, item_pos); + + LOG(u8"UseEquipmentMoveItem [ equipment_pos:%d equipment_id:%d item_pos:%d item_id:%d ]" + , equipment_pos + , equipment_id + , item_pos + , item_inven->getKey() + ); + + if (!item_inven->isEmpty() && item_inven->getKey() == ITEM_ID_YIJIRUHUN) + { + ENUM_PACK_RET_TYPE ret = CDispatch::Get()->Dispatcher_ModItemAttr_dispatch_sig(dis_mod, user, pBuf); + int result = (ret == PAK_ERROR) ? 1 : 0; + return result; + } + return Controller::Get()->old_Dispatcher_ModItemAttr_dispatch_sig(dis_mod, user, pBuf); +} + int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher* a1, CUser* user, int packet_class, int packet_id, char* packet_src, int packet_len, int a7, int a8) { int(***dispatcher)(int, CUser*, char*) = (int(***)(int, CUser*, char*))a1->get_dispatcher(packet_id); @@ -256,7 +289,7 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher* a1, CUser* us } - if (packet_id == Packet_UseEquipmentMoveItem) + if (packet_id == PACKET_ID_ITEM_USE_EQUIPMENT_MOVEITEM) { int result = 0; PacketBuf* v25 = PacketBuf::NewPacketBuf(); diff --git a/src/controller.h b/src/controller.h index a706d08..5784235 100644 --- a/src/controller.h +++ b/src/controller.h @@ -15,7 +15,7 @@ public: private: Controller(); - ~Controller(); + ~Controller(); public: void init(); @@ -32,6 +32,10 @@ private: */ static int hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pUser, PacketBuf* pBuf); + //浣跨敤铚滆湣 + static int hook_Dispatcher_ModItemAttr_dispatch_sig(Dispatcher_ModItemAttr* dis_mod, CUser* user, PacketBuf* pBuf); + + /** * @brief hook鏀跺寘澶勭悊 * @param a1 @@ -46,6 +50,8 @@ private: */ static int hook_PacketDispatcher_doDispatch(PacketDispatcher* a1, CUser* a2, int a3, int packet_id, char* packet_src, int pecakt_len, int a7, int a8); + + private: using IPacketDispatcher_ParamBase_dispatch_template_Type = decltype(hook_IPacketDispatcher_ParamBase_dispatch_template); IPacketDispatcher_ParamBase_dispatch_template_Type* old_IPacketDispatcher_ParamBase_dispatch_template; @@ -53,6 +59,9 @@ private: using UseJewel_dispatch_sig_Type = decltype(hook_UseJewel_dispatch_sig); UseJewel_dispatch_sig_Type* old_UseJewel_dispatch_sig; + using Dispatcher_ModItemAttr_dispatch_sig_Type = decltype(hook_Dispatcher_ModItemAttr_dispatch_sig); + Dispatcher_ModItemAttr_dispatch_sig_Type* old_Dispatcher_ModItemAttr_dispatch_sig; + using PacketDispatcher_doDispatch_Type = decltype(hook_PacketDispatcher_doDispatch); PacketDispatcher_doDispatch_Type* old_PacketDispatcher_doDispatch; @@ -60,6 +69,7 @@ private: private: FuncHook mhook_IPacketDispatcher_ParamBase_dispatch_template; FuncHook mhook_UseJewel_dispatch_sig; + FuncHook mhook_Dispatcher_ModItemAttr_dispatch_sig; FuncHook mhook_PacketDispatcher_doDispatch; }; \ No newline at end of file diff --git a/src/df_main.cpp b/src/df_main.cpp index 74fa4c3..203de50 100644 --- a/src/df_main.cpp +++ b/src/df_main.cpp @@ -318,7 +318,7 @@ void* replaceIAT(const char* pName, void* pAddr) void** jmpAddr = (void**)pRelDyn[i].r_offset; //printf("jmpaddr::::::::::::::::::::%X\n", pRelDyn[i].r_offset); pOrgAddr = (void*)((char*)(*jmpAddr) + (int)jmpAddr + sizeof(void*)); - CodeHook::WriteBytes(pOrgAddr, &pAddr, sizeof(pAddr)); + Mem::WriteBytes(pOrgAddr, &pAddr, sizeof(pAddr)); break; } } @@ -541,7 +541,7 @@ void loga() { int a = 1; void* buf = malloc(4); - CodeHook::WriteBytes(buf, &a, 4); + Mem::WriteBytes(buf, &a, 4); getConfigPath(szGamePath, sizeof(szGamePath)); unsigned int nMaxGrade = 80; bGMMode = 1; @@ -553,34 +553,34 @@ void loga() //CodeHook::WriteUChar(MAIN_OFFSET(0x22069B), 0x01); //ServerParameterScript::isDungeonOpen - CodeHook::WriteUChar(MAIN_OFFSET(0x220894), 0x01); + Mem::WriteUChar(MAIN_OFFSET(0x220894), 0x01); //Init DataManager - CodeHook::WriteUChar(MAIN_OFFSET(0x258E80), 0xEB); + Mem::WriteUChar(MAIN_OFFSET(0x258E80), 0xEB); //Init Level Exp - CodeHook::WriteUChar(MAIN_OFFSET(0x314ECB), 0xEB); + Mem::WriteUChar(MAIN_OFFSET(0x314ECB), 0xEB); //Init Mob Reward - CodeHook::WriteUChar(MAIN_OFFSET(0x314FCB), 0xEB); + Mem::WriteUChar(MAIN_OFFSET(0x314FCB), 0xEB); //CDataManager::GetSpAtLevelUp - CodeHook::WriteUChar(MAIN_OFFSET(0x318CC8), 0xE6); + Mem::WriteUChar(MAIN_OFFSET(0x318CC8), 0xE6); //fixbug - CodeHook::WriteUChar(MAIN_OFFSET(0x31C128), 0x7E); - CodeHook::WriteUChar(MAIN_OFFSET(0x31C129), 0x06); + Mem::WriteUChar(MAIN_OFFSET(0x31C128), 0x7E); + Mem::WriteUChar(MAIN_OFFSET(0x31C129), 0x06); - CodeHook::WriteUChar(MAIN_OFFSET(0x547005), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x61AF55), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x61B0F3), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x61DD28), nMaxGrade - 1); - CodeHook::WriteUChar(MAIN_OFFSET(0x61E86A), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x61EE9C), nMaxGrade - 1); - CodeHook::WriteUChar(MAIN_OFFSET(0x6224A8), nMaxGrade - 1); - CodeHook::WriteUChar(MAIN_OFFSET(0x622929), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x641D4B), nMaxGrade - 1); - CodeHook::WriteUChar(MAIN_OFFSET(0x647ECE), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x647EDA), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x647F82), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x647F88), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x66521D), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x665223), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x547005), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x61AF55), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x61B0F3), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x61DD28), nMaxGrade - 1); + Mem::WriteUChar(MAIN_OFFSET(0x61E86A), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x61EE9C), nMaxGrade - 1); + Mem::WriteUChar(MAIN_OFFSET(0x6224A8), nMaxGrade - 1); + Mem::WriteUChar(MAIN_OFFSET(0x622929), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x641D4B), nMaxGrade - 1); + Mem::WriteUChar(MAIN_OFFSET(0x647ECE), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x647EDA), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x647F82), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x647F88), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x66521D), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x665223), nMaxGrade); //SUBHOOK_SETUP(doDispatch); SUBHOOK_SETUP(addServerHackCnt); SUBHOOK_SETUP(put_header); @@ -599,20 +599,20 @@ void loga() if (nMaxGrade > 70) { //浠ヤ笅闇瑕佹墿鍏呯被澶у皬, 淇敼鍋忕Щ - CodeHook::WriteUInt(MAIN_OFFSET(0x87162 + 3), 0xB678 + nMaxGrade * 4 + nMaxGrade * 12); + Mem::WriteUInt(MAIN_OFFSET(0x87162 + 3), 0xB678 + nMaxGrade * 4 + nMaxGrade * 12); //CDataManager::set_reward_sp - CodeHook::WriteUInt(MAIN_OFFSET(0x318C26 + 2), 10836 + 840); - CodeHook::WriteUChar(MAIN_OFFSET(0x318C3B), nMaxGrade); - CodeHook::WriteUInt(MAIN_OFFSET(0x318C68 + 2), 10836 + 840); - CodeHook::WriteUChar(MAIN_OFFSET(0x318C79), nMaxGrade); + Mem::WriteUInt(MAIN_OFFSET(0x318C26 + 2), 10836 + 840); + Mem::WriteUChar(MAIN_OFFSET(0x318C3B), nMaxGrade); + Mem::WriteUInt(MAIN_OFFSET(0x318C68 + 2), 10836 + 840); + Mem::WriteUChar(MAIN_OFFSET(0x318C79), nMaxGrade); //CDataManager::GetSpAtLevelUp - CodeHook::WriteUChar(MAIN_OFFSET(0x318CC4), nMaxGrade); - CodeHook::WriteUInt(MAIN_OFFSET(0x318CD4 + 2), 10836 + 840); + Mem::WriteUChar(MAIN_OFFSET(0x318CC4), nMaxGrade); + Mem::WriteUInt(MAIN_OFFSET(0x318CD4 + 2), 10836 + 840); } - CodeHook::WriteUChar(MAIN_OFFSET(0x61B8F6), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x622659), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x622941), nMaxGrade); - CodeHook::WriteUChar(MAIN_OFFSET(0x622941), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x61B8F6), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x622659), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x622941), nMaxGrade); + Mem::WriteUChar(MAIN_OFFSET(0x622941), nMaxGrade); } diff --git a/src/dispatch.cpp b/src/dispatch.cpp index 69a75b6..aedfd7e 100644 --- a/src/dispatch.cpp +++ b/src/dispatch.cpp @@ -115,9 +115,10 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf) //Data: equipment_citem->GetItemType=147418664 item_citem->is_stackable=1 item_citem->GetItemType=11 int equipment_Type = ((CEquipItem*)equipment_citem)->GetItemType(); + int rarity = equipment_citem->get_rarity(); LOG(u8"Data: equipment_citem->GetItemType=%d item_citem->is_stackable=%d item_citem->GetItemType=%d" - , (*(int(**)(CItem*))(*(int*)equipment_citem + 12))(equipment_citem) + , equipment_Type , item_citem->is_stackable() , item_citem->GetItemType() ); @@ -138,10 +139,14 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf) user->SendCmdErrorPacket(205, 209); return PAK_IGNORE; } + + + Inven_Item new_equipment_item = {}; + invenR->GetInvenSlot(&new_equipment_item, CInventory::INVENTORY_TYPE_ITEM, equipment_pos); + + int v9 = 0; //返回给客户端的错误码 - switch (item_id) - { - case ITEM_ID_KUAJIESHI: + if (item_id == ITEM_ID_KUAJIESHI) { LOG(u8"user->CheckInTrade:%d", user->CheckInTrade()); @@ -158,15 +163,9 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf) { CAccountCargo* AccountCargo = user->GetAccountCargo(); - invenR = user->getCurCharacInvenR(); - Inven_Item ins_item = {}; - - invenR->GetInvenSlot(&ins_item, CInventory::INVENTORY_TYPE_ITEM, equipment_pos); - - - LOG(u8"ins_item.IsTradeLimitAttachTypeItem :%d", ins_item.IsTradeLimitAttachTypeItem()); - LOG(u8"AccountCargo->CheckInsertCondition :%d", AccountCargo->CheckInsertCondition(&ins_item)); + LOG(u8"ins_item.IsTradeLimitAttachTypeItem :%d", new_equipment_item.IsTradeLimitAttachTypeItem()); + LOG(u8"AccountCargo->CheckInsertCondition :%d", AccountCargo->CheckInsertCondition(&new_equipment_item)); int empty_slot = 0; if (AccountCargo->CheckSlotEmpty(empty_slot) != 1) @@ -186,8 +185,8 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf) if (invenW->delete_item(CInventory::INVENTORY_TYPE_ITEM, equipment_pos, 1, 37, 1) && invenW->delete_item(CInventory::INVENTORY_TYPE_ITEM, item_pos, 1, 37, 1)) { - int a9 = AccountCargo->InsertItem(&ins_item, empty_slot); - user->SendUpdateItemList(1, ins_item.GetItemSpace(), equipment_pos); + int a9 = AccountCargo->InsertItem(&new_equipment_item, empty_slot); + user->SendUpdateItemList(1, new_equipment_item.GetItemSpace(), equipment_pos); user->SendUpdateItemList(1, item_avartar->GetItemSpace(), item_pos); user->send_itemspace(12); @@ -209,17 +208,6 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf) } return PAK_IGNORE; } - - - } - break; - case ITEM_ID_YIJIRUHUN: - { - - } - break; - default: - break; } @@ -263,4 +251,90 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf) return PAK_OK; } +ENUM_PACK_RET_TYPE CDispatch::Dispatcher_ModItemAttr_dispatch_sig(Dispatcher_ModItemAttr* dis_mod, CUser* user, PacketBuf* pBuf) +{ + if (user->get_state() != 3 || !user->getCurCharacR()) + { + user->SendCmdErrorPacket(84, 0xD1u); + return PAK_IGNORE; + } + int equipment_pos = pBuf->get_short(); + int equipment_id = pBuf->get_int(); + int item_pos = pBuf->get_short(); + + auto CurCharacInvenW = (CInventory*)user->getCurCharacInvenW(); + Inven_Item equipment_inven = {}; + CurCharacInvenW->GetInvenSlot(&equipment_inven, CInventory::INVENTORY_TYPE_ITEM, equipment_pos); + + if (equipment_inven.isEmpty() || equipment_inven.getKey() != equipment_id) + { + user->SendCmdErrorPacket(84, 4); + return PAK_IGNORE; + } + CItem* equipment_item = CDataManager::G_CDataManager()->find_item(equipment_id); + if (!equipment_item) + { + user->SendCmdErrorPacket(84, 4); + return PAK_IGNORE; + } + + int equipment_Type = ((CEquipItem*)equipment_item)->GetItemType(); + + if (equipment_Type <= 9 || equipment_Type > 21 || equipment_Type == 11) + { + user->SendCmdErrorPacket(84, 19); + return PAK_IGNORE; + } + Inven_Item item_inven = {}; + CurCharacInvenW->GetInvenSlot(&item_inven, CInventory::INVENTORY_TYPE_ITEM, item_pos); + + if (item_inven.isEmpty()) + { + user->SendCmdErrorPacket(84, 17); + return PAK_IGNORE; + } + + if (user->CheckItemLock(1, equipment_pos)) + { + user->SendCmdErrorPacket(84, 0xD5u); + return PAK_IGNORE; + } + + if (item_inven.getKey() != ITEM_ID_YIJIRUHUN) + { + user->SendCmdErrorPacket(84, 17); + return PAK_IGNORE; + } + + int grade = equipment_item->get_grade(); + int rarity = equipment_item->get_rarity(); + int attach_type = equipment_item->GetAttachType(); + auto add_info = item_inven.get_add_info(); + + if (equipment_item->GetAttachType() != 3) + { + user->SendCmdErrorPacket(84, 19); + return PAK_IGNORE; + } + if (equipment_inven.package != 0) + { + user->SendCmdErrorPacket(84, 18); + return PAK_IGNORE; + } + if (CurCharacInvenW->delete_item(CInventory::INVENTORY_TYPE_ITEM, item_pos, 1, 3, 1) != 1) + { + user->SendCmdErrorPacket(84, -3); + return PAK_IGNORE; + } + + equipment_inven.package = 1; + CurCharacInvenW->update_item( + CInventory::INVENTORY_TYPE_ITEM, + equipment_pos, + equipment_inven); + + dis_mod->_SendResult(user, 1, item_pos, equipment_pos); + + return PAK_IGNORE; +} diff --git a/src/dispatch.h b/src/dispatch.h index ac16c57..5e45d8e 100644 --- a/src/dispatch.h +++ b/src/dispatch.h @@ -16,6 +16,8 @@ public: public: ENUM_PACK_RET_TYPE UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf); + ENUM_PACK_RET_TYPE Dispatcher_ModItemAttr_dispatch_sig(Dispatcher_ModItemAttr* dis_mod, CUser* user, PacketBuf* pBuf); + protected: diff --git a/src/enum.h b/src/enum.h index 78e2fec..33392ae 100644 --- a/src/enum.h +++ b/src/enum.h @@ -1,9 +1,11 @@ #pragma once enum ENUM_PACKET_ID { - Packet_UseItem = 84, - - Packet_UseEquipmentMoveItem = 2000, + PACKET_ID_ITEM_USE = 84, + PACKET_ID_ITEM_LOCK = 271, + PACKET_ID_ITEM_UNLOCK = 272, + PACKET_ID_ITEM_UNLOCK_CANCEL = 273, + PACKET_ID_ITEM_USE_EQUIPMENT_MOVEITEM = 2000, }; enum ENUM_PACK_RET_TYPE diff --git a/src/ida_sdk.h b/src/ida_sdk.h new file mode 100644 index 0000000..96d8334 --- /dev/null +++ b/src/ida_sdk.h @@ -0,0 +1,300 @@ +/* + + This file contains definitions used by the Hex-Rays decompiler output. + It has type definitions and convenience macros to make the + output more readable. + + Copyright (c) 2007-2011 Hex-Rays + +*/ + +#if defined(__GNUC__) +typedef long long ll; +typedef unsigned long long ull; +#define __int64 long long +#define __int32 int +#define __int16 short +#define __int8 char +#define MAKELL(num) num ## LL +#define FMT_64 "ll" +#elif defined(_MSC_VER) +typedef __int64 ll; +typedef unsigned __int64 ull; +#define MAKELL(num) num ## i64 +#define FMT_64 "I64" +#elif defined (__BORLANDC__) +typedef __int64 ll; +typedef unsigned __int64 ull; +#define MAKELL(num) num ## i64 +#define FMT_64 "L" +#else +#error "unknown compiler" +#endif +typedef unsigned int uint; +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned long ulong; + +typedef char int8; +typedef signed char sint8; +typedef unsigned char uint8; +typedef short int16; +typedef signed short sint16; +typedef unsigned short uint16; +typedef int int32; +typedef signed int sint32; +typedef unsigned int uint32; +typedef ll int64; +typedef ll sint64; +typedef ull uint64; + +// Partially defined types: +#define _BYTE uint8 +#define _WORD uint16 +#define _DWORD uint32 +#define _QWORD uint64 +#if !defined(_MSC_VER) +#define _LONGLONG __int128 +#endif + +#ifndef _WINDOWS_ +typedef int8 BYTE; +typedef int16 WORD; +typedef int32 DWORD; +typedef int32 LONG; +#endif +typedef int64 QWORD; +#ifndef __cplusplus +typedef int bool; // we want to use bool in our C programs +#endif + +// Some convenience macros to make partial accesses nicer +// first unsigned macros: +#define LOBYTE(x) (*((_BYTE*)&(x))) // low byte +#define LOWORD(x) (*((_WORD*)&(x))) // low word +#define LODWORD(x) (*((_DWORD*)&(x))) // low dword +#define HIBYTE(x) (*((_BYTE*)&(x)+1)) +#define HIWORD(x) (*((_WORD*)&(x)+1)) +#define HIDWORD(x) (*((_DWORD*)&(x)+1)) +#define BYTEn(x, n) (*((_BYTE*)&(x)+n)) +#define WORDn(x, n) (*((_WORD*)&(x)+n)) +#define BYTE1(x) BYTEn(x, 1) // byte 1 (counting from 0) +#define BYTE2(x) BYTEn(x, 2) +#define BYTE3(x) BYTEn(x, 3) +#define BYTE4(x) BYTEn(x, 4) +#define BYTE5(x) BYTEn(x, 5) +#define BYTE6(x) BYTEn(x, 6) +#define BYTE7(x) BYTEn(x, 7) +#define BYTE8(x) BYTEn(x, 8) +#define BYTE9(x) BYTEn(x, 9) +#define BYTE10(x) BYTEn(x, 10) +#define BYTE11(x) BYTEn(x, 11) +#define BYTE12(x) BYTEn(x, 12) +#define BYTE13(x) BYTEn(x, 13) +#define BYTE14(x) BYTEn(x, 14) +#define BYTE15(x) BYTEn(x, 15) +#define WORD1(x) WORDn(x, 1) +#define WORD2(x) WORDn(x, 2) // third word of the object, unsigned +#define WORD3(x) WORDn(x, 3) +#define WORD4(x) WORDn(x, 4) +#define WORD5(x) WORDn(x, 5) +#define WORD6(x) WORDn(x, 6) +#define WORD7(x) WORDn(x, 7) + +// now signed macros (the same but with sign extension) +#define SLOBYTE(x) (*((int8*)&(x))) +#define SLOWORD(x) (*((int16*)&(x))) +#define SLODWORD(x) (*((int32*)&(x))) +#define SHIBYTE(x) (*((int8*)&(x)+1)) +#define SHIWORD(x) (*((int16*)&(x)+1)) +#define SHIDWORD(x) (*((int32*)&(x)+1)) +#define SBYTEn(x, n) (*((int8*)&(x)+n)) +#define SWORDn(x, n) (*((int16*)&(x)+n)) +#define SBYTE1(x) SBYTEn(x, 1) +#define SBYTE2(x) SBYTEn(x, 2) +#define SBYTE3(x) SBYTEn(x, 3) +#define SBYTE4(x) SBYTEn(x, 4) +#define SBYTE5(x) SBYTEn(x, 5) +#define SBYTE6(x) SBYTEn(x, 6) +#define SBYTE7(x) SBYTEn(x, 7) +#define SBYTE8(x) SBYTEn(x, 8) +#define SBYTE9(x) SBYTEn(x, 9) +#define SBYTE10(x) SBYTEn(x, 10) +#define SBYTE11(x) SBYTEn(x, 11) +#define SBYTE12(x) SBYTEn(x, 12) +#define SBYTE13(x) SBYTEn(x, 13) +#define SBYTE14(x) SBYTEn(x, 14) +#define SBYTE15(x) SBYTEn(x, 15) +#define SWORD1(x) SWORDn(x, 1) +#define SWORD2(x) SWORDn(x, 2) +#define SWORD3(x) SWORDn(x, 3) +#define SWORD4(x) SWORDn(x, 4) +#define SWORD5(x) SWORDn(x, 5) +#define SWORD6(x) SWORDn(x, 6) +#define SWORD7(x) SWORDn(x, 7) + + +// Helper functions to represent some assembly instructions. + +#ifdef __cplusplus + +// Fill memory block with an integer value +inline void memset32(void* ptr, uint32 value, int count) +{ + uint32* p = (uint32*)ptr; + for (int i = 0; i < count; i++) + *p++ = value; +} + +// Generate a reference to pair of operands +template int16 __PAIR__(int8 high, T low) { return (((int16)high) << sizeof(high) * 8) | uint8(low); } +template int32 __PAIR__(int16 high, T low) { return (((int32)high) << sizeof(high) * 8) | uint16(low); } +template int64 __PAIR__(int32 high, T low) { return (((int64)high) << sizeof(high) * 8) | uint32(low); } +template uint16 __PAIR__(uint8 high, T low) { return (((uint16)high) << sizeof(high) * 8) | uint8(low); } +template uint32 __PAIR__(uint16 high, T low) { return (((uint32)high) << sizeof(high) * 8) | uint16(low); } +template uint64 __PAIR__(uint32 high, T low) { return (((uint64)high) << sizeof(high) * 8) | uint32(low); } + +// rotate left +template T __ROL__(T value, uint count) +{ + const uint nbits = sizeof(T) * 8; + count %= nbits; + + T high = value >> (nbits - count); + value <<= count; + value |= high; + return value; +} + +// rotate right +template T __ROR__(T value, uint count) +{ + const uint nbits = sizeof(T) * 8; + count %= nbits; + + T low = value << (nbits - count); + value >>= count; + value |= low; + return value; +} + +// carry flag of left shift +template int8 __MKCSHL__(T value, uint count) +{ + const uint nbits = sizeof(T) * 8; + count %= nbits; + + return (value >> (nbits - count)) & 1; +} + +// carry flag of right shift +template int8 __MKCSHR__(T value, uint count) +{ + return (value >> (count - 1)) & 1; +} + +// sign flag +template int8 __SETS__(T x) +{ + if (sizeof(T) == 1) + return int8(x) < 0; + if (sizeof(T) == 2) + return int16(x) < 0; + if (sizeof(T) == 4) + return int32(x) < 0; + return int64(x) < 0; +} + +// overflow flag of subtraction (x-y) +template int8 __OFSUB__(T x, U y) +{ + if (sizeof(T) < sizeof(U)) + { + U x2 = x; + int8 sx = __SETS__(x2); + return (sx ^ __SETS__(y)) & (sx ^ __SETS__(x2 - y)); + } + else + { + T y2 = y; + int8 sx = __SETS__(x); + return (sx ^ __SETS__(y2)) & (sx ^ __SETS__(x - y2)); + } +} + +// overflow flag of addition (x+y) +template int8 __OFADD__(T x, U y) +{ + if (sizeof(T) < sizeof(U)) + { + U x2 = x; + int8 sx = __SETS__(x2); + return ((1 ^ sx) ^ __SETS__(y)) & (sx ^ __SETS__(x2 + y)); + } + else + { + T y2 = y; + int8 sx = __SETS__(x); + return ((1 ^ sx) ^ __SETS__(y2)) & (sx ^ __SETS__(x + y2)); + } +} + +// carry flag of subtraction (x-y) +template int8 __CFSUB__(T x, U y) +{ + int size = sizeof(T) > sizeof(U) ? sizeof(T) : sizeof(U); + if (size == 1) + return uint8(x) < uint8(y); + if (size == 2) + return uint16(x) < uint16(y); + if (size == 4) + return uint32(x) < uint32(y); + return uint64(x) < uint64(y); +} + +// carry flag of addition (x+y) +template int8 __CFADD__(T x, U y) +{ + int size = sizeof(T) > sizeof(U) ? sizeof(T) : sizeof(U); + if (size == 1) + return uint8(x) > uint8(x + y); + if (size == 2) + return uint16(x) > uint16(x + y); + if (size == 4) + return uint32(x) > uint32(x + y); + return uint64(x) > uint64(x + y); +} + +#else +// The following definition is not quite correct because it always returns +// uint64. The above C++ functions are good, though. +#define __PAIR__(high, low) (((uint64)(high)<>y) +#define __CFADD__(x, y) invalid_operation // Generate carry flag for (x+y) +#define __CFSUB__(x, y) invalid_operation // Generate carry flag for (x-y) +#define __OFADD__(x, y) invalid_operation // Generate overflow flag for (x+y) +#define __OFSUB__(x, y) invalid_operation // Generate overflow flag for (x-y) +#endif + +// No definition for rcl/rcr because the carry flag is unknown +#define __RCL__(x, y) invalid_operation // Rotate left thru carry +#define __RCR__(x, y) invalid_operation // Rotate right thru carry +#define __MKCRCL__(x, y) invalid_operation // Generate carry flag for a RCL +#define __MKCRCR__(x, y) invalid_operation // Generate carry flag for a RCR +#define __SETP__(x, y) invalid_operation // Generate parity flag for (x-y) + +// In the decompilation listing there are some objects declarared as _UNKNOWN +// because we could not determine their types. Since the C compiler does not +// accept void item declarations, we replace them by anything of our choice, +// for example a char: + +#define _UNKNOWN char + +#ifdef _MSC_VER +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#endif \ No newline at end of file diff --git a/src/inline_hook.h b/src/inline_hook.h index 174b70e..69610ab 100644 --- a/src/inline_hook.h +++ b/src/inline_hook.h @@ -212,7 +212,7 @@ class CMemPool { private: size_t SysPageSize; - void *MemPool; + void* MemPool; std::map AllocMap; std::map FreeMap; public: @@ -254,7 +254,7 @@ public: } void* alloc(size_t _size) { - void *pBuf = NULL; + void* pBuf = NULL; for (std::map::iterator iter = FreeMap.begin(); iter != FreeMap.end(); iter++) { if (iter->second >= _size) @@ -350,32 +350,58 @@ public: } private: bool Actived; - void *Src; - void **SrcPtr; - void *Dst; + void* Src; + void** SrcPtr; + void* Dst; unsigned char* HookCode; size_t SrcCodeSize; size_t HookCodeSize; }; -class CodeHook +class Mem { public: - static void WriteUChar(void *Addr, unsigned char Value) + static void WriteUChar(void* Addr, unsigned char Value) { WriteBytes(Addr, &Value, 1); } - static void WriteUShort(void *Addr, unsigned short Value) + static void WriteUShort(void* Addr, unsigned short Value) { WriteBytes(Addr, &Value, 2); } - static void WriteUInt(void *Addr, unsigned int Value) + static void WriteUInt(void* Addr, unsigned int Value) { WriteBytes(Addr, &Value, 4); } - static void WriteBytes(void *Addr, void *Data, size_t Len) + static void WriteBytes(void* Addr, void* Data, size_t Len) { CMemPool::GetInstance()->SetPageProtect(Addr, PROT_READ | PROT_WRITE | PROT_EXEC); memcpy(Addr, Data, Len); } + + static void HookJmp(int base, int func_) + { + char Jmp[5] = {}; + *((char*)Jmp) = 0xE9; + *((int*)(Jmp + 1)) = func_ - base - 5; + WriteBytes((void*)base, Jmp, 5); + } + + static void HookCall(int base, int func_) + { + char Jmp[5] = {}; + *((char*)Jmp) = 0xE8; + *((int*)(Jmp + 1)) = func_ - base - 5; + WriteBytes((void*)base, Jmp, 5); + } + + static void HookCall_6(int base, int func_) + { + char Jmp[6] = {}; + *((char*)Jmp) = 0xE8; + *((int*)(Jmp + 1)) = func_ - base - 5; + *((char*)(Jmp + 5)) = 0x90; + WriteBytes((void*)base, Jmp, 5); + } + }; diff --git a/src/sdk_class.h b/src/sdk_class.h index 73aa787..9bf4c24 100644 --- a/src/sdk_class.h +++ b/src/sdk_class.h @@ -2,10 +2,10 @@ #define USER_CLASS_H #include "base.h" #include "enum.h" - +#include "ida_sdk.h" #include - +#pragma pack(push, 0x01) template R CallT(A call_addr, const ARG ... arguments) { @@ -36,6 +36,8 @@ class CUser; class PacketBuf; class PacketGuard; class InterfacePacketBuf; +class Dispatcher_ModItemAttr; + namespace WongWork { @@ -112,6 +114,11 @@ public: return CallT(base::CUserCharacInfo::getCurCharacInvenR, this); } + int getCurCharacR() + { + return CallT(base::CUserCharacInfo::getCurCharacR, this); + } + }; class CUser : public CUserCharacInfo @@ -123,6 +130,12 @@ public: return int(((__func)base::CUser::get_state)(this)); } + /** + * @brief 妫鏌ョ墿鍝侀攣瀹 + * @param a2 鑳屽寘浣嶇疆 + * @param a3 鐗╁搧鏍忎綅 + * @return + */ bool CheckItemLock(int a2, int a3) { typedef bool (*__func)(CUser* a1, int a2, int a3); @@ -156,10 +169,10 @@ public: return int(((__func)base::CUser::SendUpdateItemList)(this, a2, a3, a4)); } - int SendCmdErrorPacket(int a2, unsigned char a3) + int SendCmdErrorPacket(int packet_id, unsigned char a3) { typedef int (*__func)(CUser* a1, int a2, unsigned char a3); - return int(((__func)base::CUser::SendCmdErrorPacket)(this, a2, a3)); + return int(((__func)base::CUser::SendCmdErrorPacket)(this, packet_id, a3)); } int isEnableAvatarSocketAction() @@ -357,7 +370,11 @@ public: class CItem : public CStackableItem { public: - //閬撳叿鏄惁涓烘秷鑰楀搧 + + /** + * @brief 鏄惁涓烘秷鑰楀搧 + * @return + */ bool is_stackable() { typedef bool (*__func)(CItem* a1); @@ -370,10 +387,183 @@ public: return ((__func)base::CItem::IsRoutingItem)(this); } + /** + * @brief 鍙栭檮鍔犵被鍨 + * @return + */ int GetAttachType() { return CallT(base::CItem::GetAttachType, this); } + + int GetCashPrice() + { + return CallT(base::CItem::GetCashPrice, this); + } + + int GetDyeInfo() + { + return CallT(base::CItem::GetDyeInfo, this); + } + + int GetExpertJobAdditionalExp(int a2) + { + return CallT(base::CItem::GetExpertJobAdditionalExp, this, a2); + } + + int GetExpertJobCompoundMaterialVariation() + { + return CallT(base::CItem::GetExpertJobCompoundMaterialVariation, this); + } + + int GetExpertJobCompoundRateVariation() + { + return CallT(base::CItem::GetExpertJobCompoundRateVariation, this); + } + + int GetExpertJobCompoundResultVariation(int a2) + { + return CallT(base::CItem::GetExpertJobCompoundResultVariation, this, a2); + } + + int GetExpertJobSelfDisjointBigWinRate() + { + return CallT(base::CItem::GetExpertJobSelfDisjointBigWinRate, this); + } + + int GetExpertJobSelfDisjointResultVariation() + { + return CallT(base::CItem::GetExpertJobSelfDisjointResultVariation, this); + } + + int GetFinishPointPrice() + { + return CallT(base::CItem::GetFinishPointPrice, this); + } + + int GetIncreaseStatusIntData(int a2, int& a3) + { + return CallT(base::CItem::GetIncreaseStatusIntData, this, a2, a3); + } + + int GetIncreaseStatusType() + { + return CallT(base::CItem::GetIncreaseStatusType, this); + } + + int GetItemIconName() + { + return CallT(base::CItem::GetItemIconName, this); + } + + int GetItemName() + { + return CallT(base::CItem::GetItemName, this); + } + + int GetMedalPrice() + { + return CallT(base::CItem::GetMedalPrice, this); + } + + int GetNeedLevel() + { + return CallT(base::CItem::GetNeedLevel, this); + } + + int GetNeedMaterial() + { + return CallT(base::CItem::GetNeedMaterial, this); + } + + int GetQuestItemDropBouns() + { + return CallT(base::CItem::GetQuestItemDropBouns, this); + } + + int GetRandomOptionGrade() + { + return CallT(base::CItem::GetRandomOptionGrade, this); + } + + int GetSellPrice() + { + return CallT(base::CItem::GetSellPrice, this); + } + + int GetUpSkillType() + { + return CallT(base::CItem::GetUpSkillType, this); + } + + int GetUsablePvPRank() + { + return CallT(base::CItem::GetUsablePvPRank, this); + } + + int getAdvanceAltarNeedGage() + { + return CallT(base::CItem::getAdvanceAltarNeedGage, this); + } + + int getExpirationDate() + { + return CallT(base::CItem::getExpirationDate, this); + } + + int getFootControlRateLimit() + { + return CallT(base::CItem::getFootControlRateLimit, this); + } + + int getItemGroupName() + { + return CallT(base::CItem::getItemGroupName, this); + } + + int getUsableLevel() + { + return CallT(base::CItem::getUsableLevel, this); + } + + int getUsablePeriod() + { + return CallT(base::CItem::getUsablePeriod, this); + } + + int get_gen_rate() + { + return CallT(base::CItem::get_gen_rate, this); + } + + int get_grade() + { + return CallT(base::CItem::get_grade, this); + } + + int get_index() + { + return CallT(base::CItem::get_index, this); + } + + int get_need_skill() + { + return CallT(base::CItem::get_need_skill, this); + } + + int get_price() + { + return CallT(base::CItem::get_price, this); + } + + int get_rarity() + { + return CallT(base::CItem::get_rarity, this); + } + + + + private: }; @@ -390,7 +580,8 @@ public: class Inven_Item { public: - unsigned char UnknownData_NUSL[0x3D]; + unsigned char package; + unsigned char UnknownData_NUSL[0x3C]; public: @@ -435,6 +626,17 @@ public: return CallT(base::Inven_Item::GetItemSpace, this); } + int SetReSealCount(uchar a2) + { + return CallT(base::Inven_Item::SetReSealCount, this, a2); + } + + int GetReSealCount() + { + return CallT(base::Inven_Item::GetReSealCount, this); + } + + }; class CDataManager @@ -458,7 +660,7 @@ class CInventory { public: - enum INVENTORY_TYPE : int + enum INVEN_TYPE : int { INVENTORY_TYPE_BODY = 0, //韬笂绌跨殑瑁呭 INVENTORY_TYPE_ITEM = 1, //鐗╁搧鏍 @@ -473,9 +675,9 @@ public: return ((__func)base::CInventory::GetAvatarItemMgrR)(this); } - int delete_item(INVENTORY_TYPE a2, int pos, int num, int a5, int a6 = 1) + int delete_item(INVEN_TYPE a2, int pos, int num, int a5, int a6 = 1) { - typedef int (*__func)(CInventory* a1, INVENTORY_TYPE a2, int a3, int a4, int a5, int a6); + typedef int (*__func)(CInventory* a1, INVEN_TYPE a2, int a3, int a4, int a5, int a6); return ((__func)base::CInventory::delete_item)(this, a2, pos, num, a5, a6); } @@ -494,19 +696,24 @@ public: } //鑾峰彇鑳屽寘妲戒腑鐨勯亾鍏 - Inven_Item* GetInvenRef(INVENTORY_TYPE a2, int a3) + Inven_Item* GetInvenRef(INVEN_TYPE a2, int a3) { - typedef Inven_Item* (*__func)(CInventory* a1, INVENTORY_TYPE a2, int a3); + typedef Inven_Item* (*__func)(CInventory* a1, INVEN_TYPE a2, int a3); return ((__func)base::CInventory::GetInvenRef)(this, a2, a3); } - Inven_Item* GetInvenSlot(Inven_Item* a2, INVENTORY_TYPE a3, int a4) + Inven_Item* GetInvenSlot(Inven_Item* a2, INVEN_TYPE a3, int a4) { typedef Inven_Item* (__attribute__((__stdcall__))* fnCInventory_GetInvenSlot)(Inven_Item* dest, CInventory* pThis, int space, int location); static fnCInventory_GetInvenSlot CInventory_GetInvenSlot = (fnCInventory_GetInvenSlot)(base::CInventory::GetInvenSlot); return CInventory_GetInvenSlot(a2, this, a3, a4); } + int update_item(INVEN_TYPE a2, int a3, Inven_Item a4) + { + return CallT(base::CInventory::update_item, this, a2, a3, a4); + } + }; class DB_UpdateAvatarJewelSlot @@ -522,6 +729,19 @@ public: class PacketBuf { public: + unsigned char UnknownData_0000[0x20000]; + +public: + PacketBuf() + { + memset(UnknownData_0000, 0, sizeof(UnknownData_0000)); + CallT(base::PacketBuf::PacketBuf_make, this); + } + + ~PacketBuf() + { + CallT(base::PacketBuf::PacketBuf_destroy, this); + } static PacketBuf* NewPacketBuf() { @@ -593,6 +813,11 @@ public: typedef int (*__func)(PacketBuf* a1, char* a2, int a3); return ((__func)base::PacketBuf::get_binary)(this, a2, a3); } + + void* copy(const PacketBuf* a2) + { + return CallT(base::PacketBuf::copy, this, a2); + } }; class InterfacePacketBuf @@ -743,5 +968,15 @@ public: } }; +class Dispatcher_ModItemAttr +{ +public: + int _SendResult(CUser* a2, ushort a3, ushort a4, ushort a5) + { + return CallT(base::Dispatcher_ModItemAttr::_SendResult, this, a2, a3, a4, a5); + } + +}; +#pragma pack(pop) #endif // __DXFBASE_H__ diff --git a/test/main.cc b/test/main.cc index 60a7dde..f829d94 100644 --- a/test/main.cc +++ b/test/main.cc @@ -7,1507 +7,53 @@ int main(int argc, char** argv) return 0; } -int __cdecl CUser::exchange_interspace( - CUser* this, - int type, - int equipment_pos, - unsigned int a4, - int a5, - int a6, - CInventory* empty_slot, - unsigned int a8, - int* a9) -{ - int v9; // ebx - CInventory* CurCharacInvenW; // eax - int CurCharacInvenR; // eax - int v12; // ebx - CDataManager* v13; // eax - CCargo* CurCharacCargoR; // eax - CCargo* v15; // eax - int v16; // ebx - CCargo* v17; // eax - CCargo* v18; // eax - CCargo* v19; // eax - CCargo* v20; // eax - CInventory* v21; // eax - CCargo* CurCharacCargoW; // eax - int v23; // eax - int add_info; // eax - char CurCharacNo; // bl - int v26; // ebx - CGameManager* v27; // eax - unsigned int acc_id; // eax - void* v29; // eax - int v30; // eax - CInventory* v31; // eax - int v32; // eax - int v33; // eax - CCargo* v34; // eax - int v35; // eax - unsigned int v36; // eax - char v37; // bl - char v38; // bl - CCargo* v39; // eax - int v40; // eax - CCargo* v41; // eax - int v42; // eax - int v43; // eax - int v45; // ebx - CGameManager* v46; // eax - GameWorld* v47; // eax - CInventory* v48; // eax - char* String; // eax - CInventory* v50; // eax - int v51; // ebx - CGameManager* v52; // eax - int v53; // eax - int v54; // eax - int v55; // eax - int v56; // eax - int v57; // eax - CInventory* v59; // eax - int v60; // ebx - CGameManager* v61; // eax - CGameManager* v62; // eax - GameWorld* v63; // eax - CInventory* v64; // eax - CInventory* v65; // eax - CInventory* v66; // eax - int v67; // ebx - CGameManager* v68; // eax - CGameManager* v69; // eax - void* v70; // eax - int v71; // eax - int v72; // eax - unsigned int v73; // eax - char v74; // bl - CCargo* v75; // eax - CCargo* v76; // eax - int v77; // ebx - CCargo* v78; // eax - CCargo* v79; // eax - CCargo* v80; // eax - CCargo* v81; // eax - CCargo* v82; // eax - unsigned int v83; // eax - char v84; // bl - int v86; // [esp+4h] [ebp-464h] - int v87; // [esp+4h] [ebp-464h] - int v88; // [esp+4h] [ebp-464h] - const Inven_Item* v89; // [esp+4h] [ebp-464h] - int v90; // [esp+4h] [ebp-464h] - const Inven_Item* v91; // [esp+4h] [ebp-464h] - int v92; // [esp+40h] [ebp-428h] - int v93; // [esp+40h] [ebp-428h] - long double v94; // [esp+50h] [ebp-418h] BYREF - int v95; // [esp+5Ch] [ebp-40Ch] - int v96; // [esp+60h] [ebp-408h] - int v97; // [esp+64h] [ebp-404h] - int v98; // [esp+68h] [ebp-400h] - int v99; // [esp+6Ch] [ebp-3FCh] - int v100; // [esp+70h] [ebp-3F8h] - int v101; // [esp+74h] [ebp-3F4h] - int v102; // [esp+78h] [ebp-3F0h] - int v103; // [esp+7Ch] [ebp-3ECh] - int v104; // [esp+80h] [ebp-3E8h] - int v105; // [esp+84h] [ebp-3E4h] - int v106; // [esp+88h] [ebp-3E0h] - char v107; // [esp+8Ch] [ebp-3DCh] - char v108[7]; // [esp+98h] [ebp-3D0h] BYREF - int v109; // [esp+9Fh] [ebp-3C9h] - char v110[7]; // [esp+D5h] [ebp-393h] BYREF - int v111; // [esp+DCh] [ebp-38Ch] - long double v112; // [esp+112h] [ebp-356h] BYREF - int v113; // [esp+11Eh] [ebp-34Ah] - int v114; // [esp+122h] [ebp-346h] - int v115; // [esp+126h] [ebp-342h] - int v116; // [esp+12Ah] [ebp-33Eh] - int v117; // [esp+12Eh] [ebp-33Ah] - int v118; // [esp+132h] [ebp-336h] - int v119; // [esp+136h] [ebp-332h] - int v120; // [esp+13Ah] [ebp-32Eh] - int v121; // [esp+13Eh] [ebp-32Ah] - int v122; // [esp+142h] [ebp-326h] - int v123; // [esp+146h] [ebp-322h] - int v124; // [esp+14Ah] [ebp-31Eh] - char v125; // [esp+14Eh] [ebp-31Ah] - int v126; // [esp+14Fh] [ebp-319h] BYREF - __int64 v127; // [esp+153h] [ebp-315h] - int v128; // [esp+15Bh] [ebp-30Dh] - int v129; // [esp+15Fh] [ebp-309h] - int v130; // [esp+163h] [ebp-305h] - int v131; // [esp+167h] [ebp-301h] - int v132; // [esp+16Bh] [ebp-2FDh] - int v133; // [esp+16Fh] [ebp-2F9h] - int v134; // [esp+173h] [ebp-2F5h] - int v135; // [esp+177h] [ebp-2F1h] - int v136; // [esp+17Bh] [ebp-2EDh] - int v137; // [esp+17Fh] [ebp-2E9h] - int v138; // [esp+183h] [ebp-2E5h] - int v139; // [esp+187h] [ebp-2E1h] - char v140; // [esp+18Bh] [ebp-2DDh] - int v141; // [esp+18Ch] [ebp-2DCh] BYREF - __int64 v142; // [esp+190h] [ebp-2D8h] - int v143; // [esp+198h] [ebp-2D0h] - int v144; // [esp+19Ch] [ebp-2CCh] - int v145; // [esp+1A0h] [ebp-2C8h] - int v146; // [esp+1A4h] [ebp-2C4h] - int v147; // [esp+1A8h] [ebp-2C0h] - int v148; // [esp+1ACh] [ebp-2BCh] - int v149; // [esp+1B0h] [ebp-2B8h] - int v150; // [esp+1B4h] [ebp-2B4h] - int v151; // [esp+1B8h] [ebp-2B0h] - int v152; // [esp+1BCh] [ebp-2ACh] - int v153; // [esp+1C0h] [ebp-2A8h] - int v154; // [esp+1C4h] [ebp-2A4h] - char v155; // [esp+1C8h] [ebp-2A0h] - char v156[7]; // [esp+1C9h] [ebp-29Fh] BYREF - WongWork::CAvatarItemMgr* v157; // [esp+1D0h] [ebp-298h] - char v158[7]; // [esp+206h] [ebp-262h] BYREF - WongWork::CAvatarItemMgr* v159; // [esp+20Dh] [ebp-25Bh] - char v160[2]; // [esp+243h] [ebp-225h] BYREF - int v161; // [esp+245h] [ebp-223h] - int v162; // [esp+24Ah] [ebp-21Eh] - long double v163; // [esp+280h] [ebp-1E8h] BYREF - int v164; // [esp+28Ch] [ebp-1DCh] - int v165; // [esp+290h] [ebp-1D8h] - int v166; // [esp+294h] [ebp-1D4h] - int v167; // [esp+298h] [ebp-1D0h] - int v168; // [esp+29Ch] [ebp-1CCh] - int v169; // [esp+2A0h] [ebp-1C8h] - int v170; // [esp+2A4h] [ebp-1C4h] - int v171; // [esp+2A8h] [ebp-1C0h] - int v172; // [esp+2ACh] [ebp-1BCh] - int v173; // [esp+2B0h] [ebp-1B8h] - int v174; // [esp+2B4h] [ebp-1B4h] - int v175; // [esp+2B8h] [ebp-1B0h] - char v176; // [esp+2BCh] [ebp-1ACh] - char v177[2]; // [esp+2BDh] [ebp-1ABh] BYREF - int v178; // [esp+2BFh] [ebp-1A9h] - int v179; // [esp+2C4h] [ebp-1A4h] - char v180[61]; // [esp+2FAh] [ebp-16Eh] BYREF - long double v181; // [esp+337h] [ebp-131h] BYREF - int v182; // [esp+343h] [ebp-125h] - int v183; // [esp+347h] [ebp-121h] - int v184; // [esp+34Bh] [ebp-11Dh] - int v185; // [esp+34Fh] [ebp-119h] - int v186; // [esp+353h] [ebp-115h] - int v187; // [esp+357h] [ebp-111h] - int v188; // [esp+35Bh] [ebp-10Dh] - int v189; // [esp+35Fh] [ebp-109h] - int v190; // [esp+363h] [ebp-105h] - int v191; // [esp+367h] [ebp-101h] - int v192; // [esp+36Bh] [ebp-FDh] - int v193; // [esp+36Fh] [ebp-F9h] - char v194; // [esp+373h] [ebp-F5h] - char v195[12]; // [esp+374h] [ebp-F4h] BYREF - int v196[4]; // [esp+380h] [ebp-E8h] BYREF - int v197[4]; // [esp+390h] [ebp-D8h] BYREF - int v198[4]; // [esp+3A0h] [ebp-C8h] BYREF - int v199[4]; // [esp+3B0h] [ebp-B8h] BYREF - int v200[4]; // [esp+3C0h] [ebp-A8h] BYREF - int v201[4]; // [esp+3D0h] [ebp-98h] BYREF - char v202[4]; // [esp+3E0h] [ebp-88h] - CTradeSpace* TradeSpace; // [esp+3E4h] [ebp-84h] - int v204; // [esp+3E8h] [ebp-80h] - int item; // [esp+3ECh] [ebp-7Ch] - CInventory* v207; // [esp+3F4h] [ebp-74h] - CParty* Party; // [esp+3F8h] [ebp-70h] - int v209; // [esp+3FCh] [ebp-6Ch] - CAccountCargo* AccountCargo; // [esp+400h] [ebp-68h] - int SpecificItemSlot; // [esp+408h] [ebp-60h] - int v214; // [esp+410h] [ebp-58h] - CAccountCargo* v215; // [esp+414h] [ebp-54h] - int v217; // [esp+41Ch] [ebp-4Ch] - int v218; // [esp+420h] [ebp-48h] - online_preliminary::COnlinePreliminary* InvenRef; // [esp+424h] [ebp-44h] - int v220; // [esp+428h] [ebp-40h] - int v221; // [esp+42Ch] [ebp-3Ch] - online_preliminary::COnlinePreliminary* v222; // [esp+430h] [ebp-38h] - int v223; // [esp+434h] [ebp-34h] - int v224; // [esp+438h] [ebp-30h] - CAccountCargo* v225; // [esp+43Ch] [ebp-2Ch] - CAccountCargo* v226; // [esp+440h] [ebp-28h] - CAccountCargo* v228; // [esp+448h] [ebp-20h] - CInventory* inserted; // [esp+488h] [ebp+20h] - CInventory* v231; // [esp+488h] [ebp+20h] - - PacketGuard::PacketGuard((PacketGuard*)v195); - Inven_Item::Inven_Item((Inven_Item*)&v181); - *(_DWORD*)v202 = 0; - if ((unsigned __int8)_checkItemMovable(this, type, equipment_pos, a4, a6, (int)empty_slot, a8) != 1) - { - *a9 = -1; - v9 = 21; - goto LABEL_303; - } - switch (type) - { - case 0: - switch (a6) - { - case 0: - v204 = 0; - CurCharacInvenW = (CInventory*)CUserCharacInfo::getCurCharacInvenW(this); - v204 = CInventory::move_item(CurCharacInvenW, 1, equipment_pos, 1, empty_slot); - if (v204) - { - v9 = v204; - } - else - { - *a9 = (int)empty_slot; - v9 = 0; - } - goto LABEL_303; - case 2: - if ((unsigned __int8)CUser::CheckInTrade(this)) - { - v9 = 19; - goto LABEL_303; - } - CurCharacInvenR = CUserCharacInfo::getCurCharacInvenR(this); - CInventory::GetInvenSlot((CInventory*)&v94, CurCharacInvenR, 1, equipment_pos); - v181 = v94; - v182 = v95; - v183 = v96; - v184 = v97; - v185 = v98; - v186 = v99; - v187 = v100; - v188 = v101; - v189 = v102; - v190 = v103; - v191 = v104; - v192 = v105; - v193 = v106; - v194 = v107; - v12 = *(_DWORD*)((char*)&v181 + 2); - v13 = (CDataManager*)G_CDataManager(); - item = CDataManager::find_item(v13, v12); - if (!item) - { - v9 = 23; - goto LABEL_303; - } - if ((*(unsigned __int8(__cdecl**)(int))(*(_DWORD*)item + 64))(item)) - { - v9 = 23; - goto LABEL_303; - } - if (*(_DWORD*)((char*)&v181 + 2) > 0x1963u && *(_DWORD*)((char*)&v181 + 2) <= 0x1B57u) - { - v9 = 23; - goto LABEL_303; - } - if (BYTE1(v181) == 1) - { - CurCharacCargoR = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - if ((unsigned __int8)CCargo::check_slot_empty(CurCharacCargoR, (int)empty_slot) != 1) - { - v15 = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - empty_slot = (CInventory*)CCargo::get_empty_slot(v15); - if ((int)empty_slot < 0) - { - v9 = 4; - goto LABEL_303; - } - } - } - else - { - if (BYTE1(v181) == 4) - { - v9 = 23; - goto LABEL_303; - } - if (Inven_Item::get_add_info((Inven_Item*)&v181) < a5) - { - v9 = 17; - goto LABEL_303; - } - Inven_Item::set_add_info((Inven_Item*)&v181, a5); - v207 = 0; - v16 = *(_DWORD*)((char*)&v181 + 2); - v17 = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - v207 = (CInventory*)CCargo::check_item_exist(v17, v16); - if ((int)v207 >= 0) - { - empty_slot = v207; - } - else - { - v18 = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - if ((unsigned __int8)CCargo::check_slot_empty(v18, (int)empty_slot) != 1) - { - v19 = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - empty_slot = (CInventory*)CCargo::get_empty_slot(v19); - if ((int)empty_slot < 0) - { - v9 = 4; - goto LABEL_303; - } - } - } - } - v20 = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - inserted = (CInventory*)CCargo::tryInsertItemSpecialSlot(v20, (const Inven_Item*)&v181, (int)empty_slot); - if ((int)inserted >= 0) - { - v21 = (CInventory*)CUserCharacInfo::getCurCharacInvenW(this); - if ((unsigned __int8)CInventory::delete_item(v21, 1, equipment_pos, a5, 7, 1)) - { - CurCharacCargoW = (CCargo*)CUserCharacInfo::getCurCharacCargoW(this); - *a9 = CCargo::insert_item_special_slot(CurCharacCargoW, (Inven_Item*)&v181, (int)inserted); - v23 = CUserCharacInfo::getCurCharacCargoR(this); - CCargo::get_cargo_slot((CCargo*)v180, v23); - if (v180[1] == 1) - { - cUserHistoryLog::ItemAddCargo((CUser*)((char*)this + 497408), *(int*)((char*)&v181 + 2), a5, 1); - } - else - { - add_info = Inven_Item::get_add_info((Inven_Item*)v180); - cUserHistoryLog::ItemAddCargo( - (CUser*)((char*)this + 497408), - *(int*)((char*)&v181 + 2), - a5, - add_info); - } - } - else - { - CurCharacNo = CUserCharacInfo::getCurCharacNo(this); - cMyTrace::cMyTrace( - (cMyTrace*)v196, - "int CUser::exchange_interspace(int, int, itemIndexOnlyServer_t, int, int, int, itemIndexOnlyServer_t, int*)", - 15137, - 5); - cMyTrace::operator()((int)v196, "delete_item failed %d %d %d", CurCharacNo); - } - goto LABEL_302; - } - v9 = 4; - goto LABEL_303; - case 3: - if ((unsigned __int8)CUser::CheckInTrade(this)) - { - v9 = 19; - } - else - { - *(_DWORD*)v202 = CUser::change_equip(this, type, equipment_pos, (int)empty_slot); - if (*(_DWORD*)v202) - { - v9 = *(_DWORD*)v202; - } - else - { - *a9 = (int)empty_slot; - Party = (CParty*)CUser::GetParty(this); - if (Party) - CParty::Reset_party_overlapped_drop_ratio(Party); - v9 = 0; - } - } - goto LABEL_303; - case 4: - v26 = *((__int16*)this + 288769); - v27 = (CGameManager*)G_CGameManager(); - TradeSpace = (CTradeSpace*)CGameManager::GetTradeSpace(v27, v26); - if (TradeSpace) - { - if ((unsigned __int8)CTradeSpace::is_empty(TradeSpace)) - { - *((_WORD*)this + 288769) = -1; - v9 = 21; - } - else - { - if ((unsigned __int8)CTradeSpace::check_trade_possibility(TradeSpace) != 1) - goto LABEL_234; - if ((unsigned __int8)CTradeSpace::IsLocked(TradeSpace)) - { - v9 = 17; - } - else - { - *(_DWORD*)v202 = CTradeSpace::regist_item(TradeSpace, this, 0, equipment_pos, a5); - if (*(int*)v202 >= 0) - { - *a9 = *(_DWORD*)v202; - goto LABEL_302; - } - CUserCharacInfo::getCurCharacNo(this); - acc_id = CUser::get_acc_id(this); - NumberToString(acc_id, 0); - cMyTrace::cMyTrace( - (cMyTrace*)v197, - "int CUser::exchange_interspace(int, int, itemIndexOnlyServer_t, int, int, int, itemIndexOnlyServer_t, int*)", - 15191, - 5); - cMyTrace::operator()( - (int)v197, - "(regist_item(): %d)(m_id: %s) (CharacNo: %d) (from_slot: %d) (item_count: %d)", - v202[0]); - if (*(_DWORD*)v202 == -4) - v9 = 94; - else - v9 = 17; - } - } - } - else - { - v9 = 1; - } - goto LABEL_303; - case 12: - if ((unsigned __int8)CUser::CheckInTrade(this)) - { - v9 = 19; - } - else - { - v29 = ARAD::Singleton::Get(); - if ((unsigned __int8)ServiceRestrictManager::isRestricted((int)v29, this, 1, 27)) - { - v9 = 209; - } - else - { - v209 = CSecu_ProtectionField::Check(GlobalData::s_pSecuProtectionField, this, 1); - if (v209) - { - v9 = v209; - } - else if ((unsigned __int8)CUser::IsExistAccountCargo(this) != 1) - { - v9 = 19; - } - else - { - AccountCargo = (CAccountCargo*)CUser::GetAccountCargo(this); - v30 = CUserCharacInfo::getCurCharacInvenR(this); - CInventory::GetInvenSlot((CInventory*)&v94, v30, 1, equipment_pos); - v181 = v94; - v182 = v95; - v183 = v96; - v184 = v97; - v185 = v98; - v186 = v99; - v187 = v100; - v188 = v101; - v189 = v102; - v190 = v103; - v191 = v104; - v192 = v105; - v193 = v106; - v194 = v107; - if ((unsigned __int8)IsTradeLimitAttachTypeItem((const Inven_Item*)&v181)) - { - v9 = 23; - } - else - { - if ((unsigned __int8)CAccountCargo::CheckInsertCondition(AccountCargo, (Inven_Item*)&v181) == 1) - { - if (BYTE1(v181) == 1) - { - if ((unsigned __int8)CAccountCargo::CheckSlotEmpty(AccountCargo, (int)empty_slot) != 1) - { - empty_slot = (CInventory*)CAccountCargo::GetEmptySlot(AccountCargo); - if ((int)empty_slot < 0) - { - v9 = 4; - goto LABEL_303; - } - } - } - else - { - if (Inven_Item::get_add_info((Inven_Item*)&v181) < a5) - { - v9 = 17; - goto LABEL_303; - } - Inven_Item::set_add_info((Inven_Item*)&v181, a5); - SpecificItemSlot = CAccountCargo::GetSpecificItemSlot(AccountCargo, *(int*)((char*)&v181 + 2)); - if (SpecificItemSlot < 0) - { - if ((unsigned __int8)CAccountCargo::CheckSlotEmpty(AccountCargo, (int)empty_slot) != 1) - { - empty_slot = (CInventory*)CAccountCargo::GetEmptySlot(AccountCargo); - if ((int)empty_slot < 0) - { - v9 = 4; - goto LABEL_303; - } - } - } - else - { - if ((unsigned __int8)CAccountCargo::CheckStackLimit( - AccountCargo, - SpecificItemSlot, - *(int*)((char*)&v181 + 2), - a5) != 1) - { - v9 = 4; - goto LABEL_303; - } - empty_slot = (CInventory*)SpecificItemSlot; - } - } - v31 = (CInventory*)CUserCharacInfo::getCurCharacInvenW(this); - if ((unsigned __int8)CInventory::delete_item(v31, 1, equipment_pos, a5, 37, 1)) - { - *a9 = CAccountCargo::InsertItem(AccountCargo, (Inven_Item*)&v181, (int)empty_slot); - CAccountCargo::GetSlot((CAccountCargo*)v177, (int)AccountCargo, *a9);// 获取金库位置 - if (v177[1] == 1) - cUserHistoryLog::AccountCargoAddItem((char*)this + 497408, v178, 1, 1, 45); - else - cUserHistoryLog::AccountCargoAddItem((char*)this + 497408, v178, v179, a5, 45); - } - goto LABEL_302; - } - v9 = 17; - } - } - } - } - break; - default: - v9 = 1; - goto LABEL_303; - } - goto LABEL_303; - case 1: - Inven_Item::Inven_Item((Inven_Item*)&v141); - Inven_Item::Inven_Item((Inven_Item*)&v126); - switch (a6) - { - case 3: - v53 = CUserCharacInfo::getCurCharacInvenR(this); - CInventory::GetInvenSlot((CInventory*)&v94, v53, 2, equipment_pos); - v126 = LODWORD(v94); - v127 = *(_QWORD*)((char*)&v94 + 4); - v128 = v95; - v129 = v96; - v130 = v97; - v131 = v98; - v132 = v99; - v133 = v100; - v134 = v101; - v135 = v102; - v136 = v103; - v137 = v104; - v138 = v105; - v139 = v106; - v140 = v107; - v54 = CUserCharacInfo::getCurCharacInvenR(this); - CInventory::GetInvenSlot((CInventory*)&v94, v54, 0, (int)empty_slot); - v141 = LODWORD(v94); - v142 = *(_QWORD*)((char*)&v94 + 4); - v143 = v95; - v144 = v96; - v145 = v97; - v146 = v98; - v147 = v99; - v148 = v100; - v149 = v101; - v150 = v102; - v151 = v103; - v152 = v104; - v153 = v105; - v154 = v106; - v155 = v107; - break; - case 4: - v57 = CUserCharacInfo::getCurCharacInvenR(this); - CInventory::GetInvenSlot((CInventory*)&v94, v57, 2, equipment_pos); - v126 = LODWORD(v94); - v127 = *(_QWORD*)((char*)&v94 + 4); - v128 = v95; - v129 = v96; - v130 = v97; - v131 = v98; - v132 = v99; - v133 = v100; - v134 = v101; - v135 = v102; - v136 = v103; - v137 = v104; - v138 = v105; - v139 = v106; - v140 = v107; - break; - case 1: - v55 = CUserCharacInfo::getCurCharacInvenR(this); - CInventory::GetInvenSlot((CInventory*)&v94, v55, 2, equipment_pos); - v126 = LODWORD(v94); - v127 = *(_QWORD*)((char*)&v94 + 4); - v128 = v95; - v129 = v96; - v130 = v97; - v131 = v98; - v132 = v99; - v133 = v100; - v134 = v101; - v135 = v102; - v136 = v103; - v137 = v104; - v138 = v105; - v139 = v106; - v140 = v107; - v56 = CUserCharacInfo::getCurCharacInvenR(this); - CInventory::GetInvenSlot((CInventory*)&v94, v56, 2, (int)empty_slot); - v141 = LODWORD(v94); - v142 = *(_QWORD*)((char*)&v94 + 4); - v143 = v95; - v144 = v96; - v145 = v97; - v146 = v98; - v147 = v99; - v148 = v100; - v149 = v101; - v150 = v102; - v151 = v103; - v152 = v104; - v153 = v105; - v154 = v106; - v155 = v107; - break; - } - if ((unsigned __int8)WongWork::CAvatarItemMgr::IsTempKey(*(WongWork::CAvatarItemMgr**)((char*)&v127 + 3), v86) - || (unsigned __int8)WongWork::CAvatarItemMgr::IsTempKey(*(WongWork::CAvatarItemMgr**)((char*)&v142 + 3), v90)) - { - v9 = 19; - goto LABEL_303; - } - switch (a6) - { - case 3: - *(_DWORD*)v202 = CUser::change_equip(this, type, equipment_pos, (int)empty_slot); - if (*(int*)v202 > 0) - { - v9 = *(_DWORD*)v202; - goto LABEL_303; - } - *a9 = (int)empty_slot; - break; - case 4: - v60 = *((__int16*)this + 288769); - v61 = (CGameManager*)G_CGameManager(); - TradeSpace = (CTradeSpace*)CGameManager::GetTradeSpace(v61, v60); - if (!TradeSpace) - { - v9 = 1; - goto LABEL_303; - } - if ((unsigned __int8)CTradeSpace::is_empty(TradeSpace)) - { - *((_WORD*)this + 288769) = -1; - v9 = 21; - goto LABEL_303; - } - if ((unsigned __int8)CTradeSpace::check_trade_possibility(TradeSpace) != 1) - { - CTradeSpace::cancel_trade(TradeSpace); - v62 = (CGameManager*)G_CGameManager(); - CGameManager::PutTradeSpace(v62, TradeSpace); - goto LABEL_302; - } - if ((unsigned __int8)CTradeSpace::IsLocked(TradeSpace)) - { - v9 = 17; - goto LABEL_303; - } - *(_DWORD*)v202 = CTradeSpace::regist_item(TradeSpace, this, 1, equipment_pos, a5); - if (*(int*)v202 < 0) - { - v9 = 17; - goto LABEL_303; - } - *a9 = *(_DWORD*)v202; - break; - case 1: - v220 = 0; - v59 = (CInventory*)CUserCharacInfo::getCurCharacInvenW(this); - v220 = CInventory::move_item(v59, 2, equipment_pos, 2, empty_slot); - if (v220) - { - v9 = v220; - goto LABEL_303; - } - *a9 = (int)empty_slot; - break; - default: - v9 = 1; - goto LABEL_303; - } - goto LABEL_302; - case 2: - switch (a6) - { - case 0: - if ((unsigned __int8)CUser::CheckInTrade(this)) - { - v9 = 19; - } - else - { - v32 = CUserCharacInfo::getCurCharacCargoR(this); - CCargo::get_cargo_slot((CCargo*)&v94, v32); - v181 = v94; - v182 = v95; - v183 = v96; - v184 = v97; - v185 = v98; - v186 = v99; - v187 = v100; - v188 = v101; - v189 = v102; - v190 = v103; - v191 = v104; - v192 = v105; - v193 = v106; - v194 = v107; - v163 = v94; - v164 = v95; - v165 = v96; - v166 = v97; - v167 = v98; - v168 = v99; - v169 = v100; - v170 = v101; - v171 = v102; - v172 = v103; - v173 = v104; - v174 = v105; - v175 = v106; - v176 = v107; - if (BYTE1(v94) != 1) - Inven_Item::set_add_info((Inven_Item*)&v163, a5); - v33 = CUserCharacInfo::getCurCharacInvenW(this); - if (CInventory::tryInsertItemIntoInventory( - v33, - LODWORD(v163), - DWORD1(v163), - HIDWORD(v163), - v164, - v165, - v166, - v167, - v168, - v169, - v170, - v171, - v172, - v173, - v174, - v175, - v176) != -1) - { - v34 = (CCargo*)CUserCharacInfo::getCurCharacCargoW(this); - if ((unsigned __int8)CCargo::delete_item(v34, equipment_pos, a5, 7)) - { - v35 = CUserCharacInfo::getCurCharacInvenW(this); - LOBYTE(v92) = v176; - *a9 = CInventory::insertItemIntoInventory( - v35, - LODWORD(v163), - DWORD1(v163), - HIDWORD(v163), - v164, - v165, - v166, - v167, - v168, - v169, - v170, - v171, - v172, - v173, - v174, - v175, - v92, - 7, - 1, - 0); - if (*a9 == -1) - { - CUserCharacInfo::getCurCharacNo(this); - v36 = CUser::get_acc_id(this); - v37 = NumberToString(v36, 0); - cMyTrace::cMyTrace( - (cMyTrace*)v198, - "int CUser::exchange_interspace(int, int, itemIndexOnlyServer_t, int, int, int, itemIndexOnlyServer_t, int*)", - 15333, - 5); - cMyTrace::operator()((int)v198, "insertItemIntoInventory failed %s %d %d %d", v37); - } - } - else - { - v38 = CUserCharacInfo::getCurCharacNo(this); - cMyTrace::cMyTrace( - (cMyTrace*)v199, - "int CUser::exchange_interspace(int, int, itemIndexOnlyServer_t, int, int, int, itemIndexOnlyServer_t, int*)", - 15338, - 5); - cMyTrace::operator()((int)v199, "delete_item failed %d %d %d", v38); - } - goto LABEL_302; - } - v9 = 17; - } - goto LABEL_303; - case 2: - v39 = (CCargo*)CUserCharacInfo::getCurCharacCargoW(this); - if ((unsigned __int8)CCargo::move_item(v39, equipment_pos, (int)empty_slot) != 1) - { - v9 = 17; - } - else - { - *a9 = (int)empty_slot; - v9 = 0; - } - goto LABEL_303; - case 3: - if ((unsigned __int8)CUser::CheckInTrade(this)) - v9 = 19; - else - v9 = 1; - goto LABEL_303; - case 7: - v9 = 1; - goto LABEL_303; - case 12: - if ((unsigned __int8)CUser::CheckInTrade(this)) - { - v9 = 19; - } - else - { - v214 = CSecu_ProtectionField::Check(GlobalData::s_pSecuProtectionField, this, 1); - if (v214) - { - v9 = v214; - } - else if ((unsigned __int8)CUser::IsExistAccountCargo(this) != 1) - { - v9 = 19; - } - else - { - v215 = (CAccountCargo*)CUser::GetAccountCargo(this); - v40 = CUserCharacInfo::getCurCharacCargoR(this); - CCargo::get_cargo_slot((CCargo*)&v94, v40); - v181 = v94; - v182 = v95; - v183 = v96; - v184 = v97; - v185 = v98; - v186 = v99; - v187 = v100; - v188 = v101; - v189 = v102; - v190 = v103; - v191 = v104; - v192 = v105; - v193 = v106; - v194 = v107; - if ((unsigned __int8)CAccountCargo::CheckInsertCondition(v215, (Inven_Item*)&v181) == 1) - { - if (BYTE1(v181) == 1) - { - if ((unsigned __int8)CAccountCargo::CheckSlotEmpty(v215, (int)empty_slot) != 1) - { - empty_slot = (CInventory*)CAccountCargo::GetEmptySlot(v215); - if ((int)empty_slot < 0) - { - v9 = 4; - goto LABEL_303; - } - } - } - else - { - if (Inven_Item::get_add_info((Inven_Item*)&v181) < a5) - { - v9 = 17; - goto LABEL_303; - } - Inven_Item::set_add_info((Inven_Item*)&v181, a5); - v217 = CAccountCargo::GetSpecificItemSlot(v215, *(int*)((char*)&v181 + 2)); - if (v217 < 0) - { - if ((unsigned __int8)CAccountCargo::CheckSlotEmpty(v215, (int)empty_slot) != 1) - { - empty_slot = (CInventory*)CAccountCargo::GetEmptySlot(v215); - if ((int)empty_slot < 0) - { - v9 = 4; - goto LABEL_303; - } - } - } - else - { - if ((unsigned __int8)CAccountCargo::CheckStackLimit(v215, v217, *(int*)((char*)&v181 + 2), a5) != 1) - { - v9 = 4; - goto LABEL_303; - } - empty_slot = (CInventory*)v217; - } - } - v41 = (CCargo*)CUserCharacInfo::getCurCharacCargoW(this); - if ((unsigned __int8)CCargo::delete_item(v41, equipment_pos, a5, 37)) - { - *a9 = CAccountCargo::InsertItem(v215, (Inven_Item*)&v181, (int)empty_slot); - CAccountCargo::GetSlot((CAccountCargo*)v160, (int)v215, *a9); - if (v160[1] == 1) - cUserHistoryLog::AccountCargoAddItem((char*)this + 497408, v161, 1, 1, 46); - else - cUserHistoryLog::AccountCargoAddItem((char*)this + 497408, v161, v162, a5, 46); - } - goto LABEL_302; - } - v9 = 17; - } - } - break; - default: - v9 = 1; - goto LABEL_303; - } - goto LABEL_303; - case 3: - switch (a6) - { - case 0: - if ((unsigned __int8)CUser::CheckInTrade(this)) - { - v9 = 19; - } - else - { - *(_DWORD*)v202 = CUser::change_equip(this, a6, (__int16)empty_slot, equipment_pos); - if (*(_DWORD*)v202) - { - v9 = *(_DWORD*)v202; - } - else - { - *a9 = equipment_pos; - v9 = 0; - } - } - break; - case 1: - v42 = CUserCharacInfo::getCurCharacInvenR(this); - CInventory::GetInvenSlot((CInventory*)v158, v42, 0, equipment_pos); - v43 = CUserCharacInfo::getCurCharacInvenR(this); - CInventory::GetInvenSlot((CInventory*)v156, v43, 2, (int)empty_slot); - if ((unsigned __int8)WongWork::CAvatarItemMgr::IsTempKey(v159, v87) - || (unsigned __int8)WongWork::CAvatarItemMgr::IsTempKey(v157, v88)) - { - v9 = 19; - } - else - { - *(_DWORD*)v202 = CUser::change_equip(this, type, equipment_pos, (int)empty_slot); - if (*(int*)v202 <= 0) - { - *a9 = (int)empty_slot; - v9 = 0; - } - else - { - v9 = *(_DWORD*)v202; - } - } - break; - case 2: - if ((unsigned __int8)CUser::CheckInTrade(this)) - v9 = 19; - else - v9 = 1; - break; - case 4: - v45 = *((__int16*)this + 288769); - v46 = (CGameManager*)G_CGameManager(); - TradeSpace = (CTradeSpace*)CGameManager::GetTradeSpace(v46, v45); - if (TradeSpace) - { - if ((unsigned __int8)CTradeSpace::is_empty(TradeSpace)) - { - *((_WORD*)this + 288769) = -1; - v9 = 21; - } - else - { - if ((unsigned __int8)CTradeSpace::check_trade_possibility(TradeSpace) != 1) - goto LABEL_234; - if ((unsigned __int8)CTradeSpace::IsLocked(TradeSpace)) - { - v9 = 17; - } - else - { - *(_DWORD*)v202 = CTradeSpace::regist_item(TradeSpace, this, 3, equipment_pos, a5); - if (*(int*)v202 >= 0) - { - *a9 = *(_DWORD*)v202; - CUser::send_equip(this, equipment_pos); - goto LABEL_302; - } - v9 = 17; - } - } - } - else - { - v9 = 1; - } - break; - case 7: - v47 = (GameWorld*)G_GameWorld(); - if ((unsigned __int8)GameWorld::IsCheckUnusableEquipmentChannel(v47)) - { - v48 = (CInventory*)CUserCharacInfo::getCurCharacInvenR(this); - InvenRef = (online_preliminary::COnlinePreliminary*)CInventory::GetInvenRef(v48, 3, (int)empty_slot); - if ((unsigned __int8)online_preliminary::COnlinePreliminary::CheckUnusableEquipment(InvenRef, v89) != 1) - goto LABEL_164; - } - v218 = 0; - v50 = (CInventory*)CUserCharacInfo::getCurCharacInvenW(this); - v218 = CInventory::move_item(v50, 0, equipment_pos, 3, empty_slot); - if (!v218) - goto LABEL_167; - v9 = v218; - break; - default: - v9 = 1; - break; - } - goto LABEL_303; - case 4: - if ((unsigned int)a6 > 7 || ((1 << a6) & 0x8B) == 0) - { - v9 = 1; - goto LABEL_303; - } - v51 = *((__int16*)this + 288769); - v52 = (CGameManager*)G_CGameManager(); - TradeSpace = (CTradeSpace*)CGameManager::GetTradeSpace(v52, v51); - if (!TradeSpace) - { - v9 = 1; - goto LABEL_303; - } - if ((unsigned __int8)CTradeSpace::is_empty(TradeSpace)) - { - *((_WORD*)this + 288769) = -1; - v9 = 21; - goto LABEL_303; - } - if ((unsigned __int8)CTradeSpace::check_trade_possibility(TradeSpace) != 1) - goto LABEL_234; - if ((unsigned __int8)CTradeSpace::IsLocked(TradeSpace)) - { - v9 = 17; - goto LABEL_303; - } - *(_DWORD*)v202 = CTradeSpace::remove_item(TradeSpace, this, equipment_pos, a6, (int)empty_slot, a5); - if (*(int*)v202 < 0) - { - v9 = 17; - goto LABEL_303; - } - *a9 = *(_DWORD*)v202; - if (a6 == 3) - CUser::send_equip(this, (int)empty_slot); - goto LABEL_302; - case 7: - switch (a6) - { - case 4: - v67 = *((__int16*)this + 288769); - v68 = (CGameManager*)G_CGameManager(); - TradeSpace = (CTradeSpace*)CGameManager::GetTradeSpace(v68, v67); - if (!TradeSpace) - { - v9 = 1; - break; - } - if ((unsigned __int8)CTradeSpace::is_empty(TradeSpace)) - { - *((_WORD*)this + 288769) = -1; - v9 = 21; - break; - } - if ((unsigned __int8)CTradeSpace::check_trade_possibility(TradeSpace) != 1) - { - LABEL_234: - CTradeSpace::cancel_trade(TradeSpace); - v69 = (CGameManager*)G_CGameManager(); - CGameManager::PutTradeSpace(v69, TradeSpace); - } - else - { - if ((unsigned __int8)CTradeSpace::IsLocked(TradeSpace)) - { - v9 = 17; - break; - } - *(_DWORD*)v202 = CTradeSpace::regist_item(TradeSpace, this, 7, equipment_pos, a5); - if (*(int*)v202 < 0) - { - v9 = 17; - break; - } - *a9 = *(_DWORD*)v202; - } - goto LABEL_302; - case 7: - v223 = 0; - v66 = (CInventory*)CUserCharacInfo::getCurCharacInvenW(this); - v223 = CInventory::move_item(v66, 3, equipment_pos, 3, empty_slot); - if (v223) - { - v9 = v223; - break; - } - *a9 = (int)empty_slot; - LABEL_302: - v9 = 0; - break; - case 3: - v63 = (GameWorld*)G_GameWorld(); - if ((unsigned __int8)GameWorld::IsCheckUnusableEquipmentChannel(v63) - && (v64 = (CInventory*)CUserCharacInfo::getCurCharacInvenR(this), - v222 = (online_preliminary::COnlinePreliminary*)CInventory::GetInvenRef(v64, 3, equipment_pos), - (unsigned __int8)online_preliminary::COnlinePreliminary::CheckUnusableEquipment(v222, v91) ^ 1)) - { - LABEL_164: - String = (char*)RDARScriptStringManager::findString( - (RDARScriptStringManager*)&g_scriptStringManager_, - 4, - "game_server_msg_146", - 0); - CUser::SendNotiPacketMessage(this, String, 0); - v9 = 1; - } - else - { - v221 = 0; - v65 = (CInventory*)CUserCharacInfo::getCurCharacInvenW(this); - v221 = CInventory::move_item(v65, 3, equipment_pos, 0, empty_slot); - if (v221) - { - v9 = v221; - } - else - { - LABEL_167: - *a9 = (int)empty_slot; - CUser::send_equip(this, (int)empty_slot); - v9 = 0; - } - } - break; - default: - v9 = 1; - break; - } - LABEL_303: - PacketGuard::~PacketGuard((PacketGuard*)v195); - return v9; - case 12: - v70 = ARAD::Singleton::Get(); - if ((unsigned __int8)ServiceRestrictManager::isRestricted((int)v70, this, 1, 27)) - { - v9 = 209; - goto LABEL_303; - } - v224 = CSecu_ProtectionField::Check(GlobalData::s_pSecuProtectionField, this, 1); - if (v224) - { - v9 = v224; - goto LABEL_303; - } - switch (a6) - { - case 0: - if ((unsigned __int8)CUser::CheckInTrade(this)) - { - v9 = 19; - } - else if ((unsigned __int8)CUser::IsExistAccountCargo(this) != 1) - { - v9 = 19; - } - else - { - v226 = (CAccountCargo*)CUser::GetAccountCargo(this); - CAccountCargo::GetSlot((CAccountCargo*)&v94, (int)v226, equipment_pos); - v181 = v94; - v182 = v95; - v183 = v96; - v184 = v97; - v185 = v98; - v186 = v99; - v187 = v100; - v188 = v101; - v189 = v102; - v190 = v103; - v191 = v104; - v192 = v105; - v193 = v106; - v194 = v107; - v112 = v94; - v113 = v95; - v114 = v96; - v115 = v97; - v116 = v98; - v117 = v99; - v118 = v100; - v119 = v101; - v120 = v102; - v121 = v103; - v122 = v104; - v123 = v105; - v124 = v106; - v125 = v107; - if (BYTE1(v94) != 1) - Inven_Item::set_add_info((Inven_Item*)&v112, a5); - v71 = CUserCharacInfo::getCurCharacInvenW(this); - if (CInventory::tryInsertItemIntoInventory( - v71, - LODWORD(v112), - DWORD1(v112), - HIDWORD(v112), - v113, - v114, - v115, - v116, - v117, - v118, - v119, - v120, - v121, - v122, - v123, - v124, - v125) != -1) - { - if ((unsigned __int8)CAccountCargo::DeleteItem(v226, equipment_pos, a5)) - { - v72 = CUserCharacInfo::getCurCharacInvenW(this); - LOBYTE(v93) = v125; - *a9 = CInventory::insertItemIntoInventory( - v72, - LODWORD(v112), - DWORD1(v112), - HIDWORD(v112), - v113, - v114, - v115, - v116, - v117, - v118, - v119, - v120, - v121, - v122, - v123, - v124, - v93, - 7, - 1, - 0); - if (*a9 == -1) - { - CUserCharacInfo::getCurCharacNo(this); - v73 = CUser::get_acc_id(this); - v74 = NumberToString(v73, 0); - cMyTrace::cMyTrace( - (cMyTrace*)v200, - "int CUser::exchange_interspace(int, int, itemIndexOnlyServer_t, int, int, int, itemIndexOnlyServer_t, int*)", - 16083, - 5); - cMyTrace::operator()((int)v200, "insertItemIntoInventory failed %s %d %d %d", v74); - } - CAccountCargo::GetSlot((CAccountCargo*)v110, (int)v226, equipment_pos); - if (v110[1] == 1) - cUserHistoryLog::AccountCargoDelItem((char*)this + 497408, *(_DWORD*)((char*)&v112 + 2), 0, 1, 38); - else - cUserHistoryLog::AccountCargoDelItem( - (char*)this + 497408, - *(_DWORD*)((char*)&v112 + 2), - v111, - a5, - 38); - } - goto LABEL_302; - } - v9 = 17; - } - goto LABEL_303; - case 2: - if ((unsigned __int8)CUser::CheckInTrade(this)) - { - v9 = 19; - goto LABEL_303; - } - if ((unsigned __int8)CUser::IsExistAccountCargo(this) != 1) - { - v9 = 19; - goto LABEL_303; - } - v228 = (CAccountCargo*)CUser::GetAccountCargo(this); - CAccountCargo::GetSlot((CAccountCargo*)&v94, (int)v228, equipment_pos); - v181 = v94; - v182 = v95; - v183 = v96; - v184 = v97; - v185 = v98; - v186 = v99; - v187 = v100; - v188 = v101; - v189 = v102; - v190 = v103; - v191 = v104; - v192 = v105; - v193 = v106; - v194 = v107; - if (*(_DWORD*)((char*)&v181 + 2) > 0x1963u && *(_DWORD*)((char*)&v181 + 2) <= 0x1B57u) - { - v9 = 23; - goto LABEL_303; - } - if (BYTE1(v181) == 4) - { - v9 = 23; - goto LABEL_303; - } - if (BYTE1(v181) == 1) - { - v75 = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - if ((unsigned __int8)CCargo::check_slot_empty(v75, (int)empty_slot) != 1) - { - v76 = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - empty_slot = (CInventory*)CCargo::get_empty_slot(v76); - if ((int)empty_slot < 0) - { - v9 = 4; - goto LABEL_303; - } - } - } - else - { - if (Inven_Item::get_add_info((Inven_Item*)&v181) < a5) - { - v9 = 17; - goto LABEL_303; - } - Inven_Item::set_add_info((Inven_Item*)&v181, a5); - v77 = *(_DWORD*)((char*)&v181 + 2); - v78 = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - if ((int)CCargo::check_item_exist(v78, v77) < 0) - { - v79 = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - if ((unsigned __int8)CCargo::check_slot_empty(v79, (int)empty_slot) != 1) - { - v80 = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - empty_slot = (CInventory*)CCargo::get_empty_slot(v80); - if ((int)empty_slot < 0) - { - v9 = 4; - goto LABEL_303; - } - } - } - } - v81 = (CCargo*)CUserCharacInfo::getCurCharacCargoR(this); - v231 = (CInventory*)CCargo::tryInsertItemSpecialSlot(v81, (const Inven_Item*)&v181, (int)empty_slot); - if ((int)v231 >= 0) - { - if ((unsigned __int8)CAccountCargo::DeleteItem(v228, equipment_pos, a5)) - { - v82 = (CCargo*)CUserCharacInfo::getCurCharacCargoW(this); - *a9 = CCargo::insert_item_special_slot(v82, (Inven_Item*)&v181, (int)v231); - if (*a9 == -1) - { - CUserCharacInfo::getCurCharacNo(this); - v83 = CUser::get_acc_id(this); - v84 = NumberToString(v83, 0); - cMyTrace::cMyTrace( - (cMyTrace*)v201, - "int CUser::exchange_interspace(int, int, itemIndexOnlyServer_t, int, int, int, itemIndexOnlyServer_t, int*)", - 16151, - 5); - cMyTrace::operator()((int)v201, "insertItemIntoInventory failed %s %d %d %d", v84); - } - CAccountCargo::GetSlot((CAccountCargo*)v108, (int)v228, equipment_pos); - if (v108[1] == 1) - cUserHistoryLog::AccountCargoDelItem((char*)this + 497408, *(_DWORD*)((char*)&v181 + 2), 0, 1, 39); - else - cUserHistoryLog::AccountCargoDelItem( - (char*)this + 497408, - *(_DWORD*)((char*)&v181 + 2), - v109, - a5, - 39); - } - goto LABEL_302; - } - v9 = 4; - break; - case 3: - if ((unsigned __int8)CUser::CheckInTrade(this)) - v9 = 19; - else - v9 = 1; - goto LABEL_303; - case 7: - v9 = 1; - goto LABEL_303; - case 12: - if ((unsigned __int8)CUser::CheckInTrade(this)) - { - v9 = 19; - } - else if ((unsigned __int8)CUser::IsExistAccountCargo(this) != 1) - { - v9 = 19; - } - else - { - v225 = (CAccountCargo*)CUser::GetAccountCargo(this); - if ((unsigned __int8)CAccountCargo::MoveItem(v225, equipment_pos, (int)empty_slot) == 1) - { - *a9 = (int)empty_slot; - goto LABEL_302; - } - v9 = 17; - } - goto LABEL_303; - default: - v9 = 1; - goto LABEL_303; - } - goto LABEL_303; - default: - v9 = 1; - goto LABEL_303; - } -} +PacketBuf::get_binary(char*, int) 0x0858D3B2 +PacketBuf::get_buf_ptr(int) 0x0858DA38 +PacketBuf::get_byte(char&) 0x0858CF22 +PacketBuf::get_byte(uchar&) 0x0858CF70 +PacketBuf::get_index(void) 0x08110B1C +PacketBuf::get_int(int&) 0x0858D0F0 +PacketBuf::get_int(uint&) 0x0858D240 +PacketBuf::get_int(ulong&) 0x0858D27E +PacketBuf::get_item_idx(ulong&) 0x0822B6E8 +PacketBuf::get_len(void) 0x0858DA52 +PacketBuf::get_packet(int) 0x0822B702 +PacketBuf::get_short(short&) 0x0858CFC0 +PacketBuf::get_short(ushort&) 0x0858D0B0 +PacketBuf::get_str(char*, int, int) 0x0858D2BC +CItem::GetAttachType(void).text =0x080F12E2; +CItem::GetCashPrice(void).text =0x0822C856; +CItem::GetDyeInfo(void).text =0x0822C86E; +CItem::GetExpertJobAdditionalExp(STItemScript::SEXPERTJOB::stExpertJobAdditionalExp&).text =0x0850D30E; +CItem::GetExpertJobCompoundMaterialVariation(void).text =0x0850D292; +CItem::GetExpertJobCompoundRateVariation(void).text =0x0850D2AA; +CItem::GetExpertJobCompoundResultVariation(STItemScript::SEXPERTJOB::stExpertCompoundResultVariation&).text =0x0850D2C2; +CItem::GetExpertJobSelfDisjointBigWinRate(void).text =0x0850D2DE; +CItem::GetExpertJobSelfDisjointResultVariation(void).text =0x0850D2F6; +CItem::GetFinishPointPrice(void).text =0x0822C83E; +CItem::GetIncreaseStatusIntData(int, int&).text =0x08694658; +CItem::GetIncreaseStatusType(void).text =0x086946B6; +CItem::GetItemIconName(void).text =0x085143EC; +CItem::GetItemName(void).text =0x0811ED82; +CItem::GetMedalPrice(void).text =0x0822C862; +CItem::GetNeedLevel(void).text =0x08545FDA; +CItem::GetNeedMaterial(void).text =0x0850D6F4; +CItem::GetQuestItemDropBouns(void).text =0x08514404; +CItem::GetRandomOptionGrade(void).text =0x0851441C; +CItem::GetSellPrice(void).text =0x08473612; +CItem::GetUpSkillType(void).text =0x08545FCC; +CItem::GetUsablePvPRank(void).text =0x086946C4; +CItem::getAdvanceAltarNeedGage(void).text =0x081347CA; +CItem::getExpirationDate(void).text =0x080F1306; +CItem::getFootControlRateLimit(void).text =0x0850D286; +CItem::getItemGroupName(void).text =0x080F1312; +CItem::getUsableLevel(void).text =0x080F12EE; +CItem::getUsablePeriod(void).text =0x08110C60; +CItem::get_gen_rate(void).text =0x0832E02A; +CItem::get_grade(void).text =0x08110C54; +CItem::get_index(void).text =0x08110C48; +CItem::get_need_skill(void).text =0x0850D27A; +CItem::get_price(void).text =0x0822C84A; +CItem::get_rarity(void).text =0x080F12D6; \ No newline at end of file