64 lines
1.4 KiB
C++
64 lines
1.4 KiB
C++
#include "pch.h"
|
|
#include "sock.h"
|
|
|
|
#include "STL.h"
|
|
#include "DNFTOOL.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';
|
|
|
|
STL::DrawDargonBox_STL(Buffer);
|
|
/*
|
|
char* a = (char*)"{\"uid\":2,\"cid\":36,\"op\":1}";
|
|
_SendpacksType(*_SendClass, 0, 130);
|
|
_SendPacksChar(*_SendClass, 0, a,strlen(a));
|
|
_SendPacks();
|
|
*/
|
|
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;
|
|
}
|
|
*/ |