83 lines
1.8 KiB
C++
83 lines
1.8 KiB
C++
#include "pch.h"
|
|
#include "sock.h"
|
|
|
|
extern std::map<std::string, std::string>Json_STL;
|
|
|
|
|
|
void sock::Pack_Control(int idx, int code, void* p3, void* p4)
|
|
{
|
|
DWORD Size;
|
|
Net_Get_Dword(Size);
|
|
char* Buffer = new char[Size + 1];
|
|
Net_Get_Buffer(Buffer, Size);
|
|
Buffer[Size] = '\0';
|
|
|
|
rapidjson::Document Dom;
|
|
Dom.Parse(Buffer);//속潼 俚륜눔
|
|
int Op = Dom["op"].GetInt();//털뙤잚謹
|
|
|
|
|
|
uint32_t v = GetSqVm();
|
|
SQPushRootTable(v);
|
|
SQPushString(v, L"Sq_Pack_Control", -1);
|
|
SQ_Get(v, -2);
|
|
SQPushRootTable(v);
|
|
SQPushString(v, DNFTOOL::charTowchar_t(Buffer), -1);
|
|
SQ_Call(v, 2, 0, 0);
|
|
SQPop(v, 2);
|
|
|
|
|
|
//질분
|
|
#if defined DRAGONBOX_SWITCH
|
|
if (Op >= 0 && Op <= 10)Json_STL["DragonBox"] = Buffer;
|
|
#endif
|
|
|
|
//各썹Boss
|
|
#if defined WORLDBOSS_SWITCH
|
|
if (Op >= 10 && Op <= 20)Json_STL["WorldBoss"] = Buffer;
|
|
#endif
|
|
|
|
#if defined LOCALHOSTS_SWITCH
|
|
std::cout << "130뵀澗관냥묘" << std::endl;
|
|
std::cout << "관코휭" << Buffer << std::endl;
|
|
#endif
|
|
}
|
|
|
|
|
|
|
|
void sock::R_Register_Pack()
|
|
{
|
|
auto Registerfunc = reinterpret_cast<register_pack_handler_t>(0x7186D0);
|
|
|
|
Registerfunc(130, Pack_Control, 0);
|
|
}
|
|
|
|
bool sock::Net_Get_Byte(BYTE& v)
|
|
{
|
|
typedef bool(__cdecl* func_t)(BYTE*);
|
|
return reinterpret_cast<func_t>(0x011AEA00)(&v);
|
|
}
|
|
|
|
bool sock::Net_Get_Short(short int& v)
|
|
{
|
|
typedef bool(__cdecl* func_t)(short int*);
|
|
return reinterpret_cast<func_t>(0x011AEA30)(&v);
|
|
}
|
|
|
|
bool sock::Net_Get_Dword(DWORD& v)
|
|
{
|
|
typedef bool(__cdecl* func_t)(DWORD*);
|
|
return reinterpret_cast<func_t>(0x011AEA60)(&v);
|
|
}
|
|
|
|
bool sock::Net_Get_Buffer(char* v, int sz)
|
|
{
|
|
typedef bool(__cdecl* func_t)(char*, int);
|
|
return reinterpret_cast<func_t>(0x011AEA90)(v, sz);
|
|
}
|
|
/*
|
|
bool sock::HookRegistPackHandler(int idx, pack_handler_t handler)
|
|
{
|
|
return handleTable.emplace(idx, handler).second;
|
|
}
|
|
*/ |