92 lines
2.3 KiB
C++
92 lines
2.3 KiB
C++
#include "pch.h"
|
|
#include "sock.h"
|
|
|
|
#include "rapidjson/document.h"
|
|
#include "rapidjson/writer.h"
|
|
#include "rapidjson/stringbuffer.h"
|
|
#include "rapidjson/filereadstream.h"
|
|
#include "rapidjson/filewritestream.h"
|
|
#include "rapidjson/istreamwrapper.h"
|
|
#include "STL.h"
|
|
|
|
|
|
|
|
|
|
void sock::Pack_녜쉽(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);
|
|
|
|
|
|
//뭐芚질분 친駕
|
|
//DargonModel_STL.emplace("op", Dom["op"].GetInt());
|
|
DargonModel_STL["op"] = Dom["op"].GetInt();
|
|
std::cout << DargonModel_STL["op"] << std::endl;
|
|
/*
|
|
if (DargonModel_STL["op"] == 4 || DargonModel_STL["op"] == 6)
|
|
{
|
|
//뭐芚res관 써뭐竟
|
|
Dargonresult Res_Buffer[10];
|
|
for (int i = 0; i < 10; ++i)
|
|
{
|
|
Res_Buffer[i].ItemIndex = Dom["result"][i]["item"].GetInt();
|
|
Res_Buffer[i].ItemNum = Dom["result"][i]["num"].GetInt();
|
|
Res_Buffer[i].ItemGrade = Dom["result"][i]["grade"].GetInt();
|
|
}
|
|
//뭐芚질분悧 써뭐竟
|
|
DargonMap M_Buffer;
|
|
M_Buffer.LuckyValue = Dom["luckyvalue"].GetInt();
|
|
for (int b = 0; b < 10; ++b)
|
|
{
|
|
M_Buffer.Result[b] = Res_Buffer[b];
|
|
}
|
|
//뭐芚 질분 쉽쟨鑒앴
|
|
DargonState_STL["dargonmap"] = M_Buffer;
|
|
}
|
|
*/
|
|
std::cout << u8"130뵀澗관냥묘" << std::endl;
|
|
|
|
}
|
|
|
|
void sock::R_Register_Pack()
|
|
{
|
|
auto Registerfunc = reinterpret_cast<register_pack_handler_t>(0x7186D0);
|
|
|
|
Registerfunc(130, Pack_녜쉽, 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;
|
|
}
|
|
*/ |