458 lines
10 KiB
C++
458 lines
10 KiB
C++
|
|
#ifndef USER_CLASS_H
|
||
|
|
#define USER_CLASS_H
|
||
|
|
#include "base.h"
|
||
|
|
#include "enum.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 PacketBuf;
|
||
|
|
class DB_UpdateAvatarJewelSlot;
|
||
|
|
class CInventory;
|
||
|
|
class CStackableItem;
|
||
|
|
class Inven_Item;
|
||
|
|
class CItem;
|
||
|
|
class CUserCharacInfo;
|
||
|
|
class CUser;
|
||
|
|
class PacketBuf;
|
||
|
|
class PacketGuard;
|
||
|
|
class InterfacePacketBuf;
|
||
|
|
|
||
|
|
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 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);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
class CUser : public CUserCharacInfo
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
int get_state()
|
||
|
|
{
|
||
|
|
typedef int (*__func)(CUser* a1);
|
||
|
|
return int(((__func)base::CUser::get_state)(this));
|
||
|
|
}
|
||
|
|
|
||
|
|
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 a2, unsigned char a3)
|
||
|
|
{
|
||
|
|
typedef int (*__func)(CUser* a1, int a2, unsigned char a3);
|
||
|
|
return int(((__func)base::CUser::SendCmdErrorPacket)(this, a2, 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));
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
class CStackableItem
|
||
|
|
{
|
||
|
|
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 CItem : public CStackableItem
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
//道具是否为消耗品
|
||
|
|
int is_stackable()
|
||
|
|
{
|
||
|
|
typedef int (*__func)(CItem* a1);
|
||
|
|
return ((__func)base::CItem::is_stackable)(this);
|
||
|
|
}
|
||
|
|
|
||
|
|
bool IsRoutingItem()
|
||
|
|
{
|
||
|
|
typedef bool (*__func)(CItem* a1);
|
||
|
|
return ((__func)base::CItem::IsRoutingItem)(this);
|
||
|
|
}
|
||
|
|
|
||
|
|
private:
|
||
|
|
};
|
||
|
|
|
||
|
|
class Inven_Item
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
//获取道具附加信息
|
||
|
|
WongWork::CAvatarItemMgr* get_add_info()
|
||
|
|
{
|
||
|
|
typedef WongWork::CAvatarItemMgr* (*__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);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
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);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
class CInventory
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
enum INVENTORY_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(int a2, int a3, int a4, int a5, int a6)
|
||
|
|
{
|
||
|
|
typedef int (*__func)(CInventory* a1, int a2, int a3, int a4, int a5, int a6);
|
||
|
|
return ((__func)base::CInventory::delete_item)(this, a2, a3, a4, 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(INVENTORY_TYPE a2, int a3)
|
||
|
|
{
|
||
|
|
typedef Inven_Item* (*__func)(CInventory* a1, INVENTORY_TYPE a2, int a3);
|
||
|
|
return ((__func)base::CInventory::GetInvenRef)(this, a2, a3);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
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 PacketBuf
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
//取大小
|
||
|
|
int get_len()
|
||
|
|
{
|
||
|
|
typedef int (*__func)(PacketBuf* a1);
|
||
|
|
return ((__func)base::PacketBuf::get_len)(this);
|
||
|
|
}
|
||
|
|
|
||
|
|
//取指针
|
||
|
|
int get_buf_ptr(int a2 = 0)
|
||
|
|
{
|
||
|
|
typedef int (*__func)(PacketBuf* a1, int a2);
|
||
|
|
return ((__func)base::PacketBuf::get_buf_ptr)(this, a2);
|
||
|
|
}
|
||
|
|
|
||
|
|
char get_byte()
|
||
|
|
{
|
||
|
|
char result;
|
||
|
|
typedef int (*__func)(PacketBuf* a1, char* a2);
|
||
|
|
if (((__func)base::PacketBuf::get_byte)(this, &result) == 1)
|
||
|
|
{
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
return 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
short get_short()
|
||
|
|
{
|
||
|
|
short result;
|
||
|
|
typedef int (*__func)(PacketBuf* a1, short* a2);
|
||
|
|
if (((__func)base::PacketBuf::get_short)(this, &result) == 1)
|
||
|
|
{
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
return 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
int get_int()
|
||
|
|
{
|
||
|
|
int result;
|
||
|
|
typedef int (*__func)(PacketBuf* a1, int* a2);
|
||
|
|
if (((__func)base::PacketBuf::get_int)(this, &result) == 1)
|
||
|
|
{
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
return 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
int get_binary(char* a2, int a3)
|
||
|
|
{
|
||
|
|
typedef int (*__func)(PacketBuf* a1, char* a2, int a3);
|
||
|
|
return ((__func)base::PacketBuf::get_binary)(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);
|
||
|
|
((__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);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#endif // __DXFBASE_H__
|