From ae096413002f8267de4804fa84d6dea8859e90dc Mon Sep 17 00:00:00 2001 From: "Dr.Abc" Date: Thu, 19 Dec 2024 19:08:38 +0800 Subject: [PATCH] ClExtrasInfo --- src/Header/Var/local.h | 1 + src/Source/HUD/CCustomHud.cpp | 30 ++++++++++++++++++++++++++++++ src/Source/exportfuncs.cpp | 2 ++ 3 files changed, 33 insertions(+) diff --git a/src/Header/Var/local.h b/src/Header/Var/local.h index e26dcabd..c885955c 100644 --- a/src/Header/Var/local.h +++ b/src/Header/Var/local.h @@ -68,6 +68,7 @@ using cl_refHookfunc_t = struct{ void(__fastcall* CBasePanel_PaintBackground)(void* pthis, int dummy); void(__fastcall* CGameUI_Start)(void* pthis, int dummy, void* engfuncs, int idoncare, void* ibasesystem); + byte* (__fastcall* Crypto_GenerateKey)(void* pthis, int dummy, size_t param1, bool param2); void (*pfnPlaybackEvent) (int flags, const struct edict_s* pInvoker, unsigned short eventindex, float delay, float* origin, float* angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); //VGUI2 diff --git a/src/Source/HUD/CCustomHud.cpp b/src/Source/HUD/CCustomHud.cpp index ea6402cb..6a36f6ab 100644 --- a/src/Source/HUD/CCustomHud.cpp +++ b/src/Source/HUD/CCustomHud.cpp @@ -71,6 +71,7 @@ static pfnUserMsgHook m_pfnTextMsg; static pfnUserMsgHook m_pfnMetaHook; static pfnUserMsgHook m_pfnDamage; static pfnUserMsgHook m_pfnBattery; +static pfnUserMsgHook m_pfnClExtrasInfo; #pragma endregion #pragma region UserMsg Hooks @@ -432,6 +433,34 @@ static int __MsgFunc_TextMsg(const char* pszName, int iSize, void* pbuf) { return m_pfnTextMsg(pszName, iSize, pbuf); } +static int __MsgFunc_ClExtrasInfo(const char* pszName, int iSize, void* pbuf) { + //Why Encrypt it? is it aes? + //Funny Encrypt here, plain text length 33, sent length 105 + //x3 Network traffic, lets fuck more server operator + BEGIN_READ(pbuf, iSize); + int plainDataLength = READ_LONG(); + int ivLength = READ_LONG(); + std::vector iv{}; + for (int i = 0; i < ivLength; i++) { + iv.push_back(READ_BYTE()); + } + int encryptLength = READ_LONG(); + std::vector encrypt{}; + for (int i = 0; i < encryptLength; i++) { + encrypt.push_back(READ_BYTE()); + } + int enctryptDigestLength = READ_LONG(); + std::vector digest{}; + for (int i = 0; i < enctryptDigestLength; i++) { + digest.push_back(READ_BYTE()); + } + extern PVOID g_dwClientBase; + //Funny Stack Object; + auto pCryptoObj = reinterpret_cast(g_dwClientBase) + 0xBE0; + byte* key = gHookFuncs.Crypto_GenerateKey(pCryptoObj, 0, 1, false); + + return m_pfnClExtrasInfo(pszName, iSize, pbuf); +} static int __MsgFunc_MetaHook(const char* pszName, int iSize, void* pbuf) { BEGIN_READ(pbuf, iSize); int type = READ_BYTE(); @@ -612,6 +641,7 @@ void CCustomHud::HUD_Init(void){ m_pfnFlashlight = HOOK_MESSAGE(Flashlight); m_pfnTextMsg = HOOK_MESSAGE(TextMsg); m_pfnMetaHook = HOOK_MESSAGE(MetaHook); + m_pfnClExtrasInfo = HOOK_MESSAGE(ClExtrasInfo); if(!m_pfnMetaHook) gEngfuncs.pfnHookUserMsg("MetaHook", __MsgFunc_MetaHook); diff --git a/src/Source/exportfuncs.cpp b/src/Source/exportfuncs.cpp index 94c86a2c..90f3e7a6 100644 --- a/src/Source/exportfuncs.cpp +++ b/src/Source/exportfuncs.cpp @@ -242,6 +242,8 @@ void FillAddress() { Fill_Sig(Client_SoundEngine_PlayFMODSound_SIG, g_dwClientBase, g_dwClientSize, CClient_SoundEngine_PlayFMODSound); #define V_PunchAxis_SIG "\x8B\x44\x24\x04\xF3\x0F\x10\x44\x24\x08\xF3\x0F\x11\x04\x85\x2A\x2A\x2A\x2A\xC3\xCC" Fill_Sig(V_PunchAxis_SIG, g_dwClientBase, g_dwClientSize, V_PunchAxis); +#define Crypto_GenerateKey_SIG "\x81\xEC\x8C\x08\x00\x00\xA1\x2A\x2A\x2A\x2A\x33\xC4\x89\x84\x24\x88\x08\x00\x00\x53\x8B\x9C\x24\x94" + Fill_Sig(Crypto_GenerateKey_SIG, g_dwClientBase, g_dwClientSize, Crypto_GenerateKey); PUCHAR addr; if (1) {