修复徽章镶嵌

This commit is contained in:
小疯
2022-09-12 13:35:16 +08:00
parent f77da28439
commit 2ccdac8561
16 changed files with 1484 additions and 1190 deletions

145
src/sdk/AccountCargo.h Normal file
View File

@@ -0,0 +1,145 @@
#pragma once
#ifndef __ACCOUNTCARGO_H__
#define __ACCOUNTCARGO_H__
#pragma pack(push, 0x01)
class CAccountCargo
{
public:
int GetCapacity()
{
return CallT<int>(base::CAccountCargo::GetCapacity, this);
}
int GetMoney()
{
return CallT<int>(base::CAccountCargo::GetMoney, this);
}
int SetDBData(CUser* a2, Inven_Item* a3, uint a4, uint a5)
{
return CallT<int>(base::CAccountCargo::SetDBData, this, a2, a3, a4, a5);
}
int Clear()
{
return CallT<int>(base::CAccountCargo::Clear, this);
}
int ResetSlot(int a2)
{
return CallT<int>(base::CAccountCargo::ResetSlot, this, a2);
}
int* GetSlot(int a2)
{
return CallT<int*>(base::CAccountCargo::GetSlot, this, a2);
}
int GetSlotRef(int a2)
{
return CallT<int>(base::CAccountCargo::GetSlotRef, this, a2);
}
int CheckInsertCondition(Inven_Item* a2)
{
return CallT<int>(base::CAccountCargo::CheckInsertCondition, this, a2);
}
int InsertItem(Inven_Item* a2, int a3)
{
return CallT<int>(base::CAccountCargo::InsertItem, this, a2, a3);
}
int DeleteItem(int a2, int a3)
{
return CallT<int>(base::CAccountCargo::DeleteItem, this, a2, a3);
}
int MoveItem(int a2, int a3)
{
return CallT<int>(base::CAccountCargo::MoveItem, this, a2, a3);
}
int DepositMoney(uint a2)
{
return CallT<int>(base::CAccountCargo::DepositMoney, this, a2);
}
int WithdrawMoney(uint a2)
{
return CallT<int>(base::CAccountCargo::WithdrawMoney, this, a2);
}
int CheckMoneyLimit(uint a2)
{
return CallT<int>(base::CAccountCargo::CheckMoneyLimit, this, a2);
}
int CheckValidSlot(int a2)
{
return CallT<int>(base::CAccountCargo::CheckValidSlot, this);
}
int GetEmptySlot()
{
return CallT<int>(base::CAccountCargo::GetEmptySlot, this);
}
int CheckSlotEmpty(int a2)
{
return CallT<int>(base::CAccountCargo::CheckSlotEmpty, this, a2);
}
int GetSpecificItemSlot(int a2)
{
return CallT<int>(base::CAccountCargo::GetSpecificItemSlot, this, a2);
}
int CheckStackLimit(int a2, int a3, int a4)
{
return CallT<int>(base::CAccountCargo::CheckStackLimit, this);
}
int AddMoney(uint a2)
{
return CallT<int>(base::CAccountCargo::AddMoney, this, a2);
}
int SubMoney(uint a2)
{
return CallT<int>(base::CAccountCargo::SubMoney, this, a2);
}
int GetItemCount()
{
return CallT<int>(base::CAccountCargo::GetItemCount, this);
}
int SendNotifyMoney(int a2)
{
return CallT<int>(base::CAccountCargo::SendNotifyMoney, this, a2);
}
int SendItemList()
{
return CallT<int>(base::CAccountCargo::SendItemList, this);
}
int MakeItemPacket(PacketGuard* a2, int a3)
{
return CallT<int>(base::CAccountCargo::MakeItemPacket, this, a2, a3);
}
int CreateAccountCargo(CUser* a2)
{
return CallT<int>(base::CAccountCargo::CreateAccountCargo, this, a2);
}
int UpgradeAccountCargo(CUser* a2)
{
return CallT<int>(base::CAccountCargo::UpgradeAccountCargo, this, a2);
}
int SendNotifyRecipe(CUser* a2, int a3, bool a4)
{
return CallT<int>(base::CAccountCargo::SendNotifyRecipe, this, a2, a3, a4);
}
int DeleteAccountCargo(CUser* a2)
{
return CallT<int>(base::CAccountCargo::DeleteAccountCargo, this, a2);
}
int SetStable()
{
return CallT<int>(base::CAccountCargo::SetStable, this);
}
int SetCapacity(uint a2)
{
return CallT<int>(base::CAccountCargo::SetCapacity, this, a2);
}
int IsAlter(void)
{
return CallT<int>(base::CAccountCargo::IsAlter, this);
}
};
#pragma pack(pop)
#endif // __ACCOUNTCARGO_H__

28
src/sdk/DataManager.h Normal file
View File

@@ -0,0 +1,28 @@
#pragma once
#ifndef __DATAMANAGER_H__
#define __DATAMANAGER_H__
#pragma pack(push, 0x01)
class CDataManager
{
public:
static CDataManager* G_CDataManager(void)
{
typedef CDataManager* (*__func)(void);
return ((__func)base::CDataManager::G_CDataManager)();
}
//获取装备pvf数据
CItem* find_item(int a2)
{
typedef CItem* (*__func)(CDataManager* a1, int a2);
return ((__func)base::CDataManager::find_item)(this, a2);
}
};
#pragma pack(pop)
#endif // __DATAMANAGER_H__

71
src/sdk/Inventory.h Normal file
View File

@@ -0,0 +1,71 @@
#pragma once
#ifndef __INVENTORY_H__
#define __INVENTORY_H__
#pragma pack(push, 0x01)
class CInventory
{
public:
enum INVEN_TYPE : int
{
INVENTORY_TYPE_BODY = 0, //身上穿的装备
INVENTORY_TYPE_ITEM = 1, //物品栏
INVENTORY_TYPE_AVARTAR = 2, //时装栏
};
public:
//获取时装管理器
WongWork::CAvatarItemMgr* GetAvatarItemMgrR()
{
typedef WongWork::CAvatarItemMgr* (*__func)(void* a1);
return ((__func)base::CInventory::GetAvatarItemMgrR)(this);
}
int delete_item(INVEN_TYPE a2, int pos, int num, int a5, int a6 = 1)
{
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);
}
//使用金币
int use_money(int a2, int a3, char a4)
{
typedef int (*__func)(CInventory* a1, int a2, int a3, char a4);
return ((__func)base::CInventory::use_money)(this, a2, a3, a4);
}
//获得金币
int gain_money(unsigned int a2, int a3, char a4, int a5)
{
typedef int (*__func)(CInventory* a1, unsigned int a2, int a3, char a4, int a5);
return ((__func)base::CInventory::gain_money)(this, a2, a3, a4, a5);
}
//获取背包槽中的道具
Inven_Item* GetInvenRef(INVEN_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, 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<int>(base::CInventory::update_item, this, a2, a3, a4);
}
};
#pragma pack(pop)
#endif // __INVENTORY_H__

346
src/sdk/Item.h Normal file
View File

@@ -0,0 +1,346 @@
#pragma once
#ifndef __ITEM_H__
#define __ITEM_H__
#pragma pack(push, 0x01)
class CItem
{
public:
/**
* @brief 是否为消耗品
* @return
*/
bool is_stackable()
{
typedef bool (*__func)(CItem* a1);
return ((__func)base::CItem::is_stackable)(this);
}
bool IsRoutingItem()
{
typedef bool (*__func)(CItem* a1);
return ((__func)base::CItem::IsRoutingItem)(this);
}
/**
* @brief 取附加类型
* @return
*/
int GetAttachType()
{
return CallT<int>(base::CItem::GetAttachType, this);
}
int GetCashPrice()
{
return CallT<int>(base::CItem::GetCashPrice, this);
}
int GetDyeInfo()
{
return CallT<int>(base::CItem::GetDyeInfo, this);
}
int GetExpertJobAdditionalExp(int a2)
{
return CallT<int>(base::CItem::GetExpertJobAdditionalExp, this, a2);
}
int GetExpertJobCompoundMaterialVariation()
{
return CallT<int>(base::CItem::GetExpertJobCompoundMaterialVariation, this);
}
int GetExpertJobCompoundRateVariation()
{
return CallT<int>(base::CItem::GetExpertJobCompoundRateVariation, this);
}
int GetExpertJobCompoundResultVariation(int a2)
{
return CallT<int>(base::CItem::GetExpertJobCompoundResultVariation, this, a2);
}
int GetExpertJobSelfDisjointBigWinRate()
{
return CallT<int>(base::CItem::GetExpertJobSelfDisjointBigWinRate, this);
}
int GetExpertJobSelfDisjointResultVariation()
{
return CallT<int>(base::CItem::GetExpertJobSelfDisjointResultVariation, this);
}
int GetFinishPointPrice()
{
return CallT<int>(base::CItem::GetFinishPointPrice, this);
}
int GetIncreaseStatusIntData(int a2, int& a3)
{
return CallT<int>(base::CItem::GetIncreaseStatusIntData, this, a2, a3);
}
int GetIncreaseStatusType()
{
return CallT<int>(base::CItem::GetIncreaseStatusType, this);
}
int GetItemIconName()
{
return CallT<int>(base::CItem::GetItemIconName, this);
}
int GetItemName()
{
return CallT<int>(base::CItem::GetItemName, this);
}
int GetMedalPrice()
{
return CallT<int>(base::CItem::GetMedalPrice, this);
}
int GetNeedLevel()
{
return CallT<int>(base::CItem::GetNeedLevel, this);
}
int GetNeedMaterial()
{
return CallT<int>(base::CItem::GetNeedMaterial, this);
}
int GetQuestItemDropBouns()
{
return CallT<int>(base::CItem::GetQuestItemDropBouns, this);
}
int GetRandomOptionGrade()
{
return CallT<int>(base::CItem::GetRandomOptionGrade, this);
}
int GetSellPrice()
{
return CallT<int>(base::CItem::GetSellPrice, this);
}
int GetUpSkillType()
{
return CallT<int>(base::CItem::GetUpSkillType, this);
}
int GetUsablePvPRank()
{
return CallT<int>(base::CItem::GetUsablePvPRank, this);
}
int getAdvanceAltarNeedGage()
{
return CallT<int>(base::CItem::getAdvanceAltarNeedGage, this);
}
int getExpirationDate()
{
return CallT<int>(base::CItem::getExpirationDate, this);
}
int getFootControlRateLimit()
{
return CallT<int>(base::CItem::getFootControlRateLimit, this);
}
int getItemGroupName()
{
return CallT<int>(base::CItem::getItemGroupName, this);
}
int getUsableLevel()
{
return CallT<int>(base::CItem::getUsableLevel, this);
}
int getUsablePeriod()
{
return CallT<int>(base::CItem::getUsablePeriod, this);
}
int get_gen_rate()
{
return CallT<int>(base::CItem::get_gen_rate, this);
}
int get_grade()
{
return CallT<int>(base::CItem::get_grade, this);
}
int get_index()
{
return CallT<int>(base::CItem::get_index, this);
}
int get_need_skill()
{
return CallT<int>(base::CItem::get_need_skill, this);
}
int get_price()
{
return CallT<int>(base::CItem::get_price, this);
}
int get_rarity()
{
return CallT<int>(base::CItem::get_rarity, this);
}
private:
};
class CStackableItem : public CItem
{
public:
//获取消耗品类型
int GetItemType()
{
typedef int (*__func)(void* a1);
return ((__func)base::CStackableItem::GetItemType)(this);
}
//获取徽章支持的镶嵌槽类型
int getJewelTargetSocket()
{
typedef int (*__func)(CStackableItem* a1);
return ((__func)base::CStackableItem::getJewelTargetSocket)(this);
}
};
class CEquipItem : public CItem
{
public:
int GetItemType()
{
return CallT<int>(base::CEquipItem::GetItemType, this);
}
};
class Inven_Item
{
public:
unsigned char package;
unsigned char UnknownData_NUSL[0x3C];
public:
//获取道具附加信息
int get_add_info()
{
typedef int (*__func)(Inven_Item* a1);
return ((__func)base::Inven_Item::get_add_info)(this);
}
//检查背包中道具是否为空
bool isEmpty()
{
typedef bool (*__func)(Inven_Item* a1);
return ((__func)base::Inven_Item::isEmpty)(this);
}
//获取背包中道具item_id
int getKey()
{
typedef int (*__func)(Inven_Item* a1);
return ((__func)base::Inven_Item::getKey)(this);
}
//道具是否是装备
bool isEquipableItemType()
{
typedef bool (*__func)(Inven_Item* a1);
return ((__func)base::Inven_Item::isEquipableItemType)(this);
}
int get_ui_id()
{
return *(int*)(this + 0x7);
}
bool IsTradeLimitAttachTypeItem()
{
return CallT<bool>(base::Inven_Item::IsTradeLimitAttachTypeItem, this);
}
int GetItemSpace()
{
return CallT<int>(base::Inven_Item::GetItemSpace, this);
}
int SetReSealCount(uchar a2)
{
return CallT<int>(base::Inven_Item::SetReSealCount, this, a2);
}
int GetReSealCount()
{
return CallT<int>(base::Inven_Item::GetReSealCount, this);
}
};
class DB_UpdateAvatarJewelSlot
{
public:
static int makeRequest(int a1, unsigned int a2, void* src)
{
typedef int (*__func)(int a1, unsigned int a2, void* src);
return ((__func)base::DB_UpdateAvatarJewelSlot::makeRequest)(a1, a2, src);
}
};
class Dispatcher_ModItemAttr
{
public:
int _SendResult(CUser* a2, ushort a3, ushort a4, ushort a5)
{
return CallT<int>(base::Dispatcher_ModItemAttr::_SendResult, this, a2, a3, a4, a5);
}
};
class stMoveItemParam
{
public:
static stMoveItemParam* NewstMoveItemParam()
{
void* v62 = malloc(0x20000);
if (!v62) return NULL;
CallT<int>(base::stMoveItemParam::stMoveItemParam_make, v62);
return (stMoveItemParam*)v62;
}
static void DelstMoveItemParam(stMoveItemParam* a1)
{
CallT<int>(base::stMoveItemParam::stMoveItemParam_destroy, a1);
free(a1);
}
static void DelstMoveItemParam2(stMoveItemParam* a1)
{
CallT<int>(base::stMoveItemParam::stMoveItemParam_del, a1);
}
};
#pragma pack(pop)
#endif // __ITEM_H__

341
src/sdk/PacketBuf.h Normal file
View File

@@ -0,0 +1,341 @@
#pragma once
#ifndef __PACKETBUF_H__
#define __PACKETBUF_H__
#pragma pack(push, 0x01)
class PacketBuf
{
public:
unsigned char UnknownData_0000[0x20000];
public:
PacketBuf()
{
memset(UnknownData_0000, 0, sizeof(UnknownData_0000));
CallT<PacketBuf*>(base::PacketBuf::PacketBuf_make, this);
}
~PacketBuf()
{
CallT<int>(base::PacketBuf::PacketBuf_destroy, this);
}
static PacketBuf* NewPacketBuf()
{
void* v62 = malloc(0x20000);
if (!v62) return NULL;
return CallT<PacketBuf*>(base::PacketBuf::PacketBuf_make, v62);
}
static void DelPacketBuf(PacketBuf* a1)
{
CallT<int>(base::PacketBuf::PacketBuf_destroy, a1);
free(a1);
}
int at(int a2)
{
return CallT<int>(base::PacketBuf::at, this, a2);
}
int bind_packet(char* a2, int a3)
{
return CallT<int>(base::PacketBuf::bind_packet, this, a2, a3);
}
int clear()
{
return CallT<int>(base::PacketBuf::clear, this);
}
int clear_ptr()
{
return CallT<int>(base::PacketBuf::clear_ptr, this);
}
int compress_packet()
{
return CallT<int>(base::PacketBuf::compress_packet, this);
}
int copy(PacketBuf const& a2)
{
return CallT<int>(base::PacketBuf::copy, this, a2);
}
int encFinalize()
{
return CallT<int>(base::PacketBuf::encFinalize, this);
}
int encrypt_packet()
{
return CallT<int>(base::PacketBuf::encrypt_packet, this);
}
int finalize(bool a2)
{
return CallT<int>(base::PacketBuf::finalize, this, a2);
}
int getLastError()
{
return CallT<int>(base::PacketBuf::getLastError, this);
}
int get_binary(char* a2, int a3)
{
return CallT<int>(base::PacketBuf::get_binary, this, a2, a3);
}
int get_buf_ptr(int a2)
{
return CallT<int>(base::PacketBuf::get_buf_ptr, this, a2);
}
int get_byte(char* a2)
{
return CallT<int>(base::PacketBuf::get_byte, this, a2);
}
int get_byte_u(uchar* a2)
{
return CallT<int>(base::PacketBuf::get_byte_u, this, a2);
}
int get_index()
{
return CallT<int>(base::PacketBuf::get_index, this);
}
int get_int(int* a2)
{
return CallT<int>(base::PacketBuf::get_int, this, a2);
}
int get_int_u(uint* a2)
{
return CallT<int>(base::PacketBuf::get_int_u, this, a2);
}
int get_int_ul(ulong* a2)
{
return CallT<int>(base::PacketBuf::get_int_ul, this, a2);
}
int get_item_idx(ulong* a2)
{
return CallT<int>(base::PacketBuf::get_item_idx, this, a2);
}
int get_len()
{
return CallT<int>(base::PacketBuf::get_len, this);
}
int get_packet(int a2)
{
return CallT<int>(base::PacketBuf::get_packet, this, a2);
}
int get_short(short* a2)
{
return CallT<int>(base::PacketBuf::get_short, this, a2);
}
int get_short_u(ushort* a2)
{
return CallT<int>(base::PacketBuf::get_short_u, this, a2);
}
int get_str(char* a2, int a3, int a4)
{
return CallT<int>(base::PacketBuf::get_str, this, a2, a3, a4);
}
int isCompressRequired(char* a2)
{
return CallT<int>(base::PacketBuf::isCompressRequired, this, a2);
}
int isEncryptRequired()
{
return CallT<int>(base::PacketBuf::isEncryptRequired, this);
}
int is_finallized()
{
return CallT<int>(base::PacketBuf::is_finallized, this);
}
int is_len_end(int a2)
{
return CallT<int>(base::PacketBuf::is_len_end, this, a2);
}
int is_ptr_end(int a2, int a3)
{
return CallT<int>(base::PacketBuf::is_ptr_end, this, a2, a3);
}
int put_binary(char* a2, int a3)
{
return CallT<int>(base::PacketBuf::put_binary, this, a2, a3);
}
int put_binary_c(char const* a2, int a3)
{
return CallT<int>(base::PacketBuf::put_binary_c, this, a2, a3);
}
int put_byte(int a2)
{
return CallT<int>(base::PacketBuf::put_byte, this, a2);
}
int put_header(int a2, int a3)
{
return CallT<int>(base::PacketBuf::put_header, this, a2, a3);
}
int put_int(int a2)
{
return CallT<int>(base::PacketBuf::put_int, this, a2);
}
int put_item_idx(ulong a2)
{
return CallT<int>(base::PacketBuf::put_item_idx, this, a2);
}
int put_packet(Inven_Item const& a2)
{
return CallT<int>(base::PacketBuf::put_packet, this, a2);
}
int put_short(int a2)
{
return CallT<int>(base::PacketBuf::put_short, this, a2);
}
int put_str(char* a2, int a3)
{
return CallT<int>(base::PacketBuf::put_str, this, a2, a3);
}
int put_str_c(char const* a2, int a3)
{
return CallT<int>(base::PacketBuf::put_str_c, this, a2, a3);
}
int setLastError(int a2)
{
return CallT<int>(base::PacketBuf::setLastError, this, a2);
}
int set_index(int a2)
{
return CallT<int>(base::PacketBuf::set_index, this, a2);
}
int set_packet(char const* a2, int a3)
{
return CallT<int>(base::PacketBuf::set_packet, this, a2, a3);
}
};
class InterfacePacketBuf
{
public:
int put_header(int a2, int a3)
{
typedef int (*__func)(InterfacePacketBuf* a1, int a2, int a3);
return ((__func)base::InterfacePacketBuf::put_header)(this, a2, a3);
}
int put_byte(char a2)
{
typedef int (*__func)(InterfacePacketBuf* a1, char a2);
return ((__func)base::InterfacePacketBuf::put_byte)(this, a2);
}
int put_short(short a2)
{
typedef int (*__func)(InterfacePacketBuf* a1, short a2);
return ((__func)base::InterfacePacketBuf::put_short)(this, a2);
}
int put_int(int a2)
{
typedef int (*__func)(InterfacePacketBuf* a1, int a2);
return ((__func)base::InterfacePacketBuf::put_int)(this, a2);
}
int put_binary(char* a2, int a3)
{
typedef int (*__func)(InterfacePacketBuf* a1, char* a2, int a3);
return ((__func)base::InterfacePacketBuf::put_binary)(this, a2, a3);
}
int finalize(bool a2)
{
typedef int (*__func)(InterfacePacketBuf* a1, bool a2);
return ((__func)base::InterfacePacketBuf::finalize)(this, a2);
}
int put_str(const char* a2, int a3)
{
typedef int (*__func)(InterfacePacketBuf* a1, const char* a2, int a3);
return ((__func)base::InterfacePacketBuf::put_str)(this, a2, a3);
}
int put_packet(const Inven_Item* a2)
{
typedef int (*__func)(InterfacePacketBuf* a1, const Inven_Item* a2);
return ((__func)base::InterfacePacketBuf::put_packet)(this, a2);
}
};
class PacketGuard
{
public:
static PacketGuard* NewPacketGuard()
{
void* v62 = malloc(0x20000);
typedef int (*__func)(void* a1);
if (!v62) return NULL;
((__func)base::PacketGuard::PacketGuard_make)(v62);
return (PacketGuard*)v62;
}
static void DelPacketGuard(PacketGuard* a1)
{
typedef int (*__func)(void* a1);
((__func)base::PacketGuard::PacketGuard_destroy)(a1);
free(a1);
}
};
class PacketDispatcher
{
public:
int getDispatcher(int a2)
{
typedef int (*__func)(PacketDispatcher* a1, int a2);
return ((__func)base::PacketDispatcher::getDispatcher)(this, a2);
}
void** get_dispatcher(int a2)
{
typedef void** (*__func)(PacketDispatcher* a1, int a2);
return ((__func)base::PacketDispatcher::get_dispatcher)(this, a2);
}
};
#pragma pack(pop)
#endif // __PACKETBUF_H__

159
src/sdk/User.h Normal file
View File

@@ -0,0 +1,159 @@
#pragma once
#ifndef __CUSER_H__
#define __CUSER_H__
#pragma pack(push, 0x01)
class CUserCharacInfo
{
public:
//获取角色名字
std::string getCurCharacName()
{
typedef char* (*__func)(CUserCharacInfo* a1);
return std::string(((__func)base::CUserCharacInfo::getCurCharacName)(this));
}
//获取角色编号
int getCurCharacNo()
{
typedef int (*__func)(CUserCharacInfo* a1);
return int(((__func)base::CUserCharacInfo::getCurCharacNo)(this));
}
//获取角色上次退出游戏时间
int getCurCharacLastPlayTick()
{
typedef int (*__func)(CUserCharacInfo* a1);
return int(((__func)base::CUserCharacInfo::getCurCharacLastPlayTick)(this));
}
//获取角色等级
int get_level_up_exp(int a2)
{
typedef int (*__func)(CUserCharacInfo* a1, int a2);
return int(((__func)base::CUserCharacInfo::get_level_up_exp)(this, a2));
}
//获取角色背包
CInventory* getCurCharacInvenW()
{
typedef CInventory* (*__func)(CUserCharacInfo* a1);
return ((__func)base::CUserCharacInfo::getCurCharacInvenW)(this);
}
bool _checkItemMovable(int a2, int a3, int a4, int a5, int a6, int a7)
{
CallT<bool>(base::CUserCharacInfo::_checkItemMovable, this, a2, a3, a4, a5, a6, a7);
}
CInventory* getCurCharacInvenR()
{
return CallT<CInventory*>(base::CUserCharacInfo::getCurCharacInvenR, this);
}
int getCurCharacR()
{
return CallT<int>(base::CUserCharacInfo::getCurCharacR, this);
}
};
class CUser : public CUserCharacInfo
{
public:
int get_state()
{
typedef int (*__func)(CUser* a1);
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);
return int(((__func)base::CUser::CheckItemLock)(this, a2, a3));
}
int SendNotiPacketMessage(char* a2, int a3)
{
typedef bool (*__func)(CUser* a1, char* a2, int a3);
return int(((__func)base::CUser::SendNotiPacketMessage)(this, a2, a3));
}
//角色增加经验
int gain_exp_sp(unsigned int a2, int a3, int a4, int a5, int a6, int a7)
{
typedef int (*__func)(CUserCharacInfo* a1, unsigned int a2, int a3, int a4, int a5, int a6, int a7);
return int(((__func)base::CUser::gain_exp_sp)(this, a2, a3, a4, a5, a6, a7));
}
//发送道具
int AddItem(int a2, int a3, int a4, int a5, int a6)
{
typedef int (*__func)(CUser* a1, int a2, int a3, int a4, int a5, int a6);
return int(((__func)base::CUser::AddItem)(this, a2, a3, a4, a5, a6));
}
//通知客户端道具更新(客户端指针, 通知方式[仅客户端=1, 世界广播=0, 小队=2, war room=3], itemSpace[装备=0, 时装=1], 道具所在的背包槽)
int SendUpdateItemList(int a2, int a3, int a4)
{
typedef int (*__func)(CUserCharacInfo* a1, int a2, int a3, int a4);
return int(((__func)base::CUser::SendUpdateItemList)(this, a2, a3, a4));
}
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, packet_id, a3));
}
int isEnableAvatarSocketAction()
{
typedef int (*__func)(CUser* a1);
return int(((__func)base::CUser::isEnableAvatarSocketAction)(this));
}
int Send(PacketGuard* a2)
{
typedef int (*__func)(CUser* a1, PacketGuard* a2);
return int(((__func)base::CUser::Send)(this, a2));
}
CUser* setLastPacketID(int a2)
{
return CallT<CUser*>(base::CUser::setLastPacketID, this, a2);
}
CAccountCargo* GetAccountCargo()
{
return CallT<CAccountCargo*>(base::CUser::GetAccountCargo, this);
}
int CheckInTrade()
{
return CallT<int>(base::CUser::CheckInTrade, this);
}
bool IsExistAccountCargo()
{
return CallT<bool>(base::CUser::IsExistAccountCargo, this);
}
int send_itemspace(int a2)
{
return CallT<bool>(base::CUser::send_itemspace, this, a2);
}
};
#pragma pack(pop)
#endif // __CUSER_H__

367
src/sdk/base.h Normal file
View File

@@ -0,0 +1,367 @@
#pragma once
namespace base
{
namespace CGameManager
{
const int G_CGameManager = 0x080CC18E;
}
namespace Dispatcher_UseJewel
{
const int dispatch_sig = 0x8217BD6;
}
namespace GlobalData
{
const int Init = 0x08299FA0;
const int Init_fix_1 = 0x0829C075;
//base
const int s_pSecuProtectionField = 0x0941F7CC;
}
namespace CParty
{
const int addDungeonClear = 0x085BDDFC;
const int addDungeonClear_fix_1 = 0x085BDE9D; //ÆÕͨ±»»÷
const int addDungeonClear_fix_2 = 0x085BDF30; //Ô¶¹Å±»»÷
const int addDungeonClear_fix_3 = 0x085BDFC3; //Òì½ç±»»÷
}
namespace CUserCharacInfo
{
const int getCurCharacName = 0x8101028;
const int getCurCharacNo = 0x080CBC4E;
const int getCurCharacLastPlayTick = 0x82A66AA;
const int get_level_up_exp = 0x0864E3BA;
const int getCurCharacInvenW = 0x80DA28E;
const int _checkItemMovable = 0x0865F1E1;
const int getCurCharacInvenR = 0x080DA27E;
const int getCurCharacR = 0x08120432;
}
namespace CUser
{
const int get_acc_id = 0x080DA36E;
const int get_state = 0x080DA38C;
const int CheckItemLock = 0x8646942;
const int SendNotiPacketMessage = 0x86886CE;
const int gain_exp_sp = 0x866A3FE;
const int AddItem = 0x867B6D4;
const int SendUpdateItemList = 0x867C65A;
const int SendCmdErrorPacket = 0x0867BF42;
const int isEnableAvatarSocketAction = 0x086810A8;
const int Send = 0x86485BA;
const int setCharacInfoDetail = 0x0864AC1A;
const int IsGameMasterMode = 0x0811EDEE;
const int isGMUser = 0x0814589C;
const int exchange_interspace = 0x0865F7B0;
const int setLastPacketID = 0x0867CBC4;
const int GetAccountCargo = 0x0822FC22;
const int CheckInTrade = 0x080DA2FE;
const int IsExistAccountCargo = 0x0822FC30;
const int send_itemspace = 0x0865DB6C;
}
namespace CStackableItem
{
const int GetItemType = 0x8514A84;
const int getJewelTargetSocket = 0x0822CA28;
}
namespace CItem
{
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
{
const int GetItemType = 0x08514D26;
}
namespace Inven_Item
{
const int get_add_info = 0x80F783A;
const int isEmpty = 0x811ED66;
const int getKey = 0x850D14E;
const int isEquipableItemType = 0x08150812;
const int IsTradeLimitAttachTypeItem = 0x081201DC;
const int GetItemSpace = 0x083481E2;
const int SetReSealCount = 0x0822B466;
const int GetReSealCount = 0x0822B456;
}
namespace CDataManager
{
const int G_CDataManager = 0x80CC19B;
const int find_item = 0x835FA32;
}
namespace CInventory
{
const int GetAvatarItemMgrR = 0x80DD576;
const int delete_item = 0x850400C;
const int use_money = 0x84FF54C;
const int gain_money = 0x84FF29C;
const int GetInvenRef = 0x84FC1DE;
const int GetInvenSlot = 0x084FB918;
const int update_item = 0x085000AE;
}
namespace DB_UpdateAvatarJewelSlot
{
const int makeRequest = 0x843081C;
}
namespace PacketBuf
{
const int PacketBuf_make = 0x0858C8C0;
const int PacketBuf_destroy = 0x0858C8DC;
const int at = 0x0822B6D4;
const int bind_packet = 0x0858D4DE;
const int clear = 0x0858C8E2;
const int clear_ptr = 0x0858C93A;
const int compress_packet = 0x0858DAA2;
const int copy = 0x0858DCD2;
const int encFinalize = 0x0858DF30;
const int encrypt_packet = 0x0858D86A;
const int finalize = 0x0858D548;
const int getLastError = 0x086D18E2;
const int get_binary = 0x0858D3B2;
const int get_buf_ptr = 0x0858DA38;
const int get_byte = 0x0858CF22;
const int get_byte_u = 0x0858CF70;
const int get_index = 0x08110B1C;
const int get_int = 0x0858D0F0;
const int get_int_u = 0x0858D240;
const int get_int_ul = 0x0858D27E;
const int get_item_idx = 0x0822B6E8;
const int get_len = 0x0858DA52;
const int get_packet = 0x0822B702;
const int get_short = 0x0858CFC0;
const int get_short_u = 0x0858D0B0;
const int get_str = 0x0858D2BC;
const int isCompressRequired = 0x0858E248;
const int isEncryptRequired = 0x0858DA28;
const int is_finallized = 0x0848F390;
const int is_len_end = 0x0858CEFC;
const int is_ptr_end = 0x0858CEC4;
const int put_binary = 0x0811DEDC;
const int put_binary_c = 0x0815093E;
const int put_byte = 0x080CB89E;
const int put_header = 0x0858C94A;
const int put_int = 0x080CB8C2;
const int put_item_idx = 0x0822B6B0;
const int put_packet = 0x0858DC2E;
const int put_short = 0x080D9E80;
const int put_str = 0x081B73B8;
const int put_str_c = 0x0822B684;
const int setLastError = 0x0858E286;
const int set_index = 0x081252BA;
const int set_packet = 0x0858D462;
}
namespace InterfacePacketBuf
{
const int put_header = 0x080CB8FC;
const int put_byte = 0x080CB920;
const int put_short = 0x80D9EA4;
const int put_int = 0x80CB93C;
const int put_binary = 0x811DF08;
const int finalize = 0x80CB958;
const int put_str = 0x0822B770;
const int put_packet = 0x0822B794;
}
namespace PacketGuard
{
const int PacketGuard_make = 0x0858DD4C;
const int PacketGuard_destroy = 0x0858DE80;
}
namespace PacketDispatcher
{
const int getDispatcher = 0x08231F2E;
const int server_load_monitoring = 0x0825F658;
const int log_recv_packet = 0x0825F72E;
const int PacketDispatcher_make = 0x08590A2E;
const int PacketDispatcher_destroy = 0x08594840;
const int get_dispatcher = 0x085948E2;
const int doDispatch = 0x08594922;
const int dispatch = 0x08594E52;
}
namespace WongWork
{
namespace CHackAnalyzer
{
const int addServerHackCnt = 0x080F8C7E;
}
namespace CGMAccounts
{
const int isGM = 0x08109346;
}
namespace CAvatarItemMgr
{
const int getJewelSocketData = 0x82F98F8;
}
}
namespace CGM_Manager
{
const int isGM = 0x0829948C;
}
namespace CDataManager
{
const int GetPvPTeamCount = 0x08568CE0;
}
namespace DisPatcher_MoveItem
{
const int process = 0x081C5904; //int __cdecl DisPatcher_MoveItem::process(DisPatcher_MoveItem *this, CUser *a2, MSG_BASE *a3, ParamBase *a4)
}
namespace cMyTrace
{
const int cMyTrace_make = 0x0854F746;
const int operator_ = 0x0854F788;
const int cMyTrace_destroy = 0x0854F746;
}
namespace IPacketDispatcher
{
namespace ParamBase
{
const int dispatch_template = 0x081258B6;
}
}
namespace CSecu_ProtectionField
{
const int Check = 0x08288A02;
}
namespace CAccountCargo
{
const int GetCapacity = 0x0822F012;
const int GetMoney = 0x0822F020;
const int CAccountCargo = 0x08289794;
const int SetDBData = 0x08289816;
const int Clear = 0x0828986C;
const int ResetSlot = 0x082898C0;
const int GetSlot = 0x082898F8;
const int GetSlotRef = 0x08289A0C;
const int CheckInsertCondition = 0x08289A4A;
const int InsertItem = 0x08289C82;
const int DeleteItem = 0x08289E3C;
const int MoveItem = 0x08289F26;
const int DepositMoney = 0x0828A12A;
const int WithdrawMoney = 0x0828A2F6;
const int CheckMoneyLimit = 0x0828A4CA;
const int CheckValidSlot = 0x0828A554;
const int GetEmptySlot = 0x0828A580;
const int CheckSlotEmpty = 0x0828A5D4;
const int GetSpecificItemSlot = 0x0828A61A;
const int CheckStackLimit = 0x0828A670;
const int AddMoney = 0x0828A742;
const int SubMoney = 0x0828A764;
const int GetItemCount = 0x0828A794;
const int SendNotifyMoney = 0x0828A7DC;
const int SendItemList = 0x0828A88A;
const int MakeItemPacket = 0x0828AB1C;
const int CreateAccountCargo = 0x0828AD72;
const int UpgradeAccountCargo = 0x0828B0B2;
const int SendNotifyRecipe = 0x0828B3D0;
const int DeleteAccountCargo = 0x0828B4EC;
const int SetStable = 0x0844DC16;
const int SetCapacity = 0x084EBE46;
const int IsAlter = 0x08695A0C;
}
namespace stMoveItemParam
{
const int stMoveItemParam_make = 0x08230CD4;
const int stMoveItemParam_destroy = 0x08248062;
const int stMoveItemParam_del = 0x08248092;
}
namespace cUserHistoryLog
{
const int AccountCargoAddItem = 0x086868B4;
}
namespace AvatarRechargeServer
{
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;
}
}

31
src/sdk/enum.h Normal file
View File

@@ -0,0 +1,31 @@
#pragma once
enum ENUM_PACKET_ID
{
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
{
PAK_OK = 0,
PAK_IGNORE = 1,
PAK_ERROR = 2,
};
enum ENUM_ITEM_TYPE
{
ITEM_TYPE_EQUIPMENT = 0,
ITEM_TYPE_CONSUMABLES = 11,
ITEM_TYPE_JEWEL = 20,
};
enum ENUM_ITEM_ID
{
ITEM_ID_YIJIRUHUN = 2660238, //一击入魂蜜蜡
ITEM_ID_KUAJIESHI = 20220831, //测试跨界石
};

300
src/sdk/ida_sdk.h Normal file
View File

@@ -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<class T> int16 __PAIR__(int8 high, T low) { return (((int16)high) << sizeof(high) * 8) | uint8(low); }
template<class T> int32 __PAIR__(int16 high, T low) { return (((int32)high) << sizeof(high) * 8) | uint16(low); }
template<class T> int64 __PAIR__(int32 high, T low) { return (((int64)high) << sizeof(high) * 8) | uint32(low); }
template<class T> uint16 __PAIR__(uint8 high, T low) { return (((uint16)high) << sizeof(high) * 8) | uint8(low); }
template<class T> uint32 __PAIR__(uint16 high, T low) { return (((uint32)high) << sizeof(high) * 8) | uint16(low); }
template<class T> uint64 __PAIR__(uint32 high, T low) { return (((uint64)high) << sizeof(high) * 8) | uint32(low); }
// rotate left
template<class T> 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<class T> 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<class T> 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<class T> int8 __MKCSHR__(T value, uint count)
{
return (value >> (count - 1)) & 1;
}
// sign flag
template<class T> 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<class T, class U> 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<class T, class U> 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<class T, class U> 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<class T, class U> 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)<<sizeof(high)*8) | low)
// For C, we just provide macros, they are not quite correct.
#define __ROL__(x, y) __rotl__(x, y) // Rotate left
#define __ROR__(x, y) __rotr__(x, y) // Rotate right
#define __CFSHL__(x, y) invalid_operation // Generate carry flag for (x<<y)
#define __CFSHR__(x, y) invalid_operation // Generate carry flag for (x>>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

120
src/sdk/sdk_class.h Normal file
View File

@@ -0,0 +1,120 @@
#ifndef USER_CLASS_H
#define USER_CLASS_H
#include "base.h"
#include "enum.h"
#include "ida_sdk.h"
#include <string>
template<typename R, typename A, typename ... ARG> R CallT(A call_addr, const ARG ... arguments)
{
if (!call_addr)
{
return R();
}
const auto control = reinterpret_cast<R(*)(ARG...)>(call_addr);
try
{
return control(arguments ...);
}
catch (...)
{
}
return R();
}
class CAccountCargo;
class DB_UpdateAvatarJewelSlot;
class CInventory;
class CStackableItem;
class Inven_Item;
class CItem;
class CUserCharacInfo;
class CUser;
class PacketBuf;
class PacketGuard;
class InterfacePacketBuf;
class Dispatcher_ModItemAttr;
#pragma pack(push, 0x01)
namespace WongWork
{
class CAvatarItemMgr
{
public:
//获取时装插槽数据
int getJewelSocketData(WongWork::CAvatarItemMgr* a2)
{
typedef int (*__func)(WongWork::CAvatarItemMgr* a1, void* a2);
return ((__func)base::WongWork::CAvatarItemMgr::getJewelSocketData)(this, a2);
}
};
class CHackAnalyzer
{
public:
int addServerHackCnt(CUserCharacInfo* a2, int a3, int a4, int a5, int a6)
{
typedef int (*__func)(WongWork::CHackAnalyzer* a1, CUserCharacInfo* a2, int a3, int a4, int a5, int a6);
return CallT<int>(base::WongWork::CHackAnalyzer::addServerHackCnt, this, a2, a3, a4, a5, a6);
return ((__func)base::WongWork::CHackAnalyzer::addServerHackCnt)(this, a2, a3, a4, a5, a6);
}
};
}
class CSecu_ProtectionField
{
public:
static CSecu_ProtectionField* Get()
{
return (CSecu_ProtectionField*)(*(int*)base::GlobalData::s_pSecuProtectionField);
}
int Check(CUser* a2, int a3)
{
return CallT<int>(base::CSecu_ProtectionField::Check, this, a2, a3);
}
};
class cUserHistoryLog
{
public:
};
class AvatarRechargeServer
{
public:
static AvatarRechargeServer* Get()
{
return CallT<AvatarRechargeServer*>(base::AvatarRechargeServer::Get);
}
char SendDurability(CUser* a2, char a3, short a4, char a5, int a6)
{
return CallT<char>(base::AvatarRechargeServer::SendDurability, this, a2, a3, a4, a5, a6);
}
};
#pragma pack(pop)
#include "User.h"
#include "AccountCargo.h"
#include "Item.h"
#include "DataManager.h"
#include "Inventory.h"
#include "PacketBuf.h"
#endif // __DXFBASE_H__