diff --git a/SpyCustom/EventListener.hpp b/SpyCustom/EventListener.hpp index 6538e6f..cdcd778 100644 --- a/SpyCustom/EventListener.hpp +++ b/SpyCustom/EventListener.hpp @@ -106,7 +106,7 @@ public: bool badInput = false; int i_dec = 0; - if (*g_Options.hitsound) { + if (*g_Options.hitsound) { try { i_dec = std::stoi(g_Options.hspath.value->mystring); @@ -368,7 +368,7 @@ public: int vote = event->GetInt("vote_option"); int id = event->GetInt("entityid"); short team = event->GetInt("team"); - if (iff.g_pChatElement) + if (iff.g_ClientMode->m_pChatElement) { player_info_t pinfo; iff.g_pEngineClient->GetPlayerInfo(id, &pinfo); @@ -382,7 +382,7 @@ public: memcpy(team_byte, " \x08", 3); //gray printfdbg("%d %s voted %d\n", team, pinfo.name, vote); - iff.g_pChatElement->ChatPrintf2(0, 0, std::string(""). + iff.g_ClientMode->m_pChatElement->ChatPrintf_v(0, 0, std::string(""). //append(" \x06"). append(team_byte). append(pinfo.name). diff --git a/SpyCustom/GetVfunc.hpp b/SpyCustom/GetVfunc.hpp index f6e2a5b..b515a75 100644 --- a/SpyCustom/GetVfunc.hpp +++ b/SpyCustom/GetVfunc.hpp @@ -28,7 +28,7 @@ Fn get_vfunc(void* class_base, const size_t index) #include #include -inline char* MakeControlChars(char str[1024]) { +inline char* MakeControlChars(char str[1024]) { char name[1024]; strcpy(name, str); for (int i = 0; i < 1024; i++) @@ -48,6 +48,7 @@ inline char* MakeControlChars(char str[1024]) { if (name[i] == 0x0) break; } + return name; } diff --git a/SpyCustom/Hooks.hpp b/SpyCustom/Hooks.hpp index 436f251..33b66e7 100644 --- a/SpyCustom/Hooks.hpp +++ b/SpyCustom/Hooks.hpp @@ -1,6 +1,7 @@ #pragma once #include "sdk/particles.h" +#include "ProtobuffMessages.h" VMTHook* SoundHook = nullptr; void __fastcall hkEmitSound1(void* _this, int edx, IRecipientFilter& filter, int iEntIndex, int iChannel, char* pSoundEntry, unsigned int nSoundEntryHash, const char* pSample, float flVolume, int nSeed, float flAttenuation, int iFlags, int iPitch, const Vector* pOrigin, const Vector* pDirection, void* pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity, int unk) { @@ -306,11 +307,13 @@ typedef const bool(__thiscall* pSendNetMsg)(void*, INetMessage*, bool, bool); pSendNetMsg oSendNetMsg; bool __fastcall hkSendNetMsg(void* channel, uint32_t, INetMessage* msg, bool reliable, bool voice) { -#ifdef DEBUG - int type = msg->GetType(); - if (type != net_Tick && type != svc_SendTable) - printfdbg("Packet %s %s\n", msg->GetName(), msg->ToString()); -#endif + if (*g_Options.debugstuff) + { + int type = msg->GetType(); + if (type != net_Tick && type != svc_SendTable) + //printfdbg("NetMessage %s %s\n", msg->GetName(), msg->ToString()); + iff.myConMsg("[Seaside] NetMessage %s %s\n", msg->GetName(), msg->ToString()); + } if (*g_Options.changing_name && msg->GetType() == net_SetConVar) { @@ -344,8 +347,28 @@ inline void HookNetchannel() opt.netchannedlhooked = 1; } + +float oldtick = 0; int c4id = 0; + +float scaleDamageArmor(float flDamage, int armor_value) +{ + float flArmorRatio = 0.5f; + float flArmorBonus = 0.5f; + if (armor_value > 0) { + float flNew = flDamage * flArmorRatio; + float flArmor = (flDamage - flNew) * flArmorBonus; + + if (flArmor > static_cast(armor_value)) { + flArmor = static_cast(armor_value) * (1.f / flArmorBonus); + flNew = flDamage - flArmor; + } + + flDamage = flNew; + } + return flDamage; +} + - bool __stdcall hkCreateMove(float frame_time, CUserCmd* pCmd) { static auto ofunc = ClientModeHook->GetOriginal(24); @@ -353,6 +376,8 @@ bool __stdcall hkCreateMove(float frame_time, CUserCmd* pCmd) C_BasePlayer* local = static_cast(iff.g_pEntityList->GetClientEntity(iff.g_pEngineClient->GetLocalPlayer())); const auto pre_flags = local->GetFlags(); + bool interval = (pCmd->tick_count + 1) % 23 == 0; + if (g_Options.slidewalk) pCmd->buttons ^= IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT; if (g_Options.fastduck) @@ -363,8 +388,150 @@ bool __stdcall hkCreateMove(float frame_time, CUserCmd* pCmd) { pCmd->buttons &= ~(IN_JUMP); } + + short localid = iff.g_pEngineClient->GetLocalPlayer(); + if (*g_Options.c4timer && *(C_GameRulesProxy**)iff.GameRulesProxy) { + C_BasePlayer* localplayer = static_cast(iff.g_pEntityList->GetClientEntity(localid)); + bool isbombplanted = (*(C_GameRulesProxy**)iff.GameRulesProxy)->IsBombPlanted(); + if (localplayer && isbombplanted) + { + float tick = localplayer->GetTickBase() * iff.g_pGlobals->interval_per_tick; + if (!c4id) + for (int i = iff.g_pEngineClient->GetMaxClients() + 1; i <= iff.g_pEntityList->GetHighestEntityIndex() + 1; i++) + { + auto entityList = iff.g_pEntityList->GetClientEntity(i); + if (entityList && _tcsstr(entityList->GetClientClass()->GetName(), "CPlantedC4") != NULL && tick < ((CPlantedC4*)entityList)->GetC4Blow()) + { + printfdbg("Found PlantedC4 %d (%f %f)\n", i, tick, ((CPlantedC4*)entityList)->GetC4Blow()); + c4id = i; + break; + } + } + + if (c4id) { + float C4Blow = ((CPlantedC4*)iff.g_pEntityList->GetClientEntity(c4id))->GetC4Blow(); + + if (interval) + { + //calc damage + const auto damagePercentage = 1.0f; + auto flDamage = 500.f; // 500 - default, if radius is not written on the map https://i.imgur.com/mUSaTHj.png + auto flBombRadius = flDamage * 3.5f; + auto flDistanceToLocalPlayer = ( + (iff.g_pEntityList->GetClientEntity(c4id)->GetAbsOrigin() + ((C_BaseEntity*)iff.g_pEntityList->GetClientEntity(c4id))->GetViewOffset()) - + (localplayer->GetAbsOrigin() + localplayer->GetViewOffset()) ).Length();// + auto fSigma = flBombRadius / 3.0f; + auto fGaussianFalloff = exp(-flDistanceToLocalPlayer * flDistanceToLocalPlayer / (2.0f * fSigma * fSigma)); + auto flAdjustedDamage = flDamage * fGaussianFalloff * damagePercentage; + flAdjustedDamage = scaleDamageArmor(flAdjustedDamage, localplayer->GetArmorValue()); + int healthleft = localplayer->GetHealth() - flAdjustedDamage; + + char str[0x100] = ""; + //snprintf(str, 0x100, "C4 %d HP %d", (int)(C4Blow - tick), healthleft < 1 ? "ff0000" : "00ff00", healthleft); + //iff.HudUniqueAlerts->GetPanel2D()->ShowAlert_v(str, false); + snprintf(str, 0x100, "C4 explode in %.*f sec\x0", healthleft < 1 ? "ff0000" : "ffff00", 1, C4Blow - tick); + TextMsg(str); + } + } + } + else if (c4id) c4id = 0; + } + + if (*g_Options.rankreveal && (pCmd->buttons & IN_SCORE) != 0) { + //credits https://www.unknowncheats.me/forum/counterstrike-global-offensive/331059-rank-reveal-sig-scanning.html + iff.g_pClient->DispatchUserMessage(CS_UM_ServerRankRevealAll, 0, 0, nullptr); + } + + if (g_Options.speclist && interval) + { + string spectatorList = "Spectating you:\n \n"; + bool isSomeoneSpectatingYou = false; + for (short i = 1; i < iff.g_pEngineClient->GetMaxClients() + 1; i++) + { + if (i == localid) continue; + + C_BasePlayer* Entity = (C_BasePlayer*)iff.g_pEntityList->GetClientEntity(i); + if (Entity && Entity->GetLifeState() == LIFE_DEAD && Entity->GetObserverTarget() == localid) + { + isSomeoneSpectatingYou = true; + + player_info_t pinfo; + iff.g_pEngineClient->GetPlayerInfo(i, &pinfo); + + spectatorList.append(pinfo.name).append("\n"); + } + } + if (isSomeoneSpectatingYou) ShowMenu(spectatorList); + } + pCmd->viewangles.Clamp(); - + return ofunc(frame_time, pCmd); +} + +typedef const __int64(__cdecl* pDevMsg)(_In_z_ _Printf_format_string_ char const* const _Format, ...); +pDevMsg oDevMsg; //(char* a1, int a2, char a3) +__int64 __cdecl hkDevMsg(_In_z_ _Printf_format_string_ char const* const _Format, ...) +{ + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + if (*g_Options.debugstuff) { + iff.myConMsg("[Seaside] DevMsg: "); + iff.myConMsg(_Format, _ArgList); + } + printfdbg("DevMsg: "); + _Result = _vfprintf_l(stdout, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return oDevMsg(_Format, NULL, _ArgList); } + +typedef const __int64(__cdecl* pDevWarningMsg)(_In_z_ _Printf_format_string_ char const* const _Format, ...); +pDevMsg oDevWarningMsg; +__int64 __cdecl hkDevWarningMsg(_In_z_ _Printf_format_string_ char const* const _Format, ...) +{ + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + if (*g_Options.debugstuff) { + iff.myConMsg("[Seaside] DevWarningMsg: "); + iff.myConMsg(_Format, _ArgList); + } + printfdbg("DevWarningMsg: "); + _Result = _vfprintf_l(stdout, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return oDevWarningMsg(_Format, NULL, _ArgList); +} + + + +int msgcount = 0; + +//sv_show_usermessage 2 //https://www.unknowncheats.me/forum/counterstrike-global-offensive/492173-dispatchusermessage-client-call.html +bool __fastcall hkDispatchUserMessage(void* thisptr, void*, int msg_type, int32 nFlags, int size, bf_read& msg_data) +{ + printfdbg("DispatchUserMessage %d %d %d %x\n", msg_type, nFlags, size, &msg_data); + static auto ofunc = ClientHook->GetOriginal(38); + + /* //read chat example + if (msg_type == CS_UM_SayText2) + { + bf_read read = bf_read(reinterpret_cast(&msg_data), size); + auto unk1 = read.ReadByte(); + auto ent_index = read.ReadByte(); + char databuf[1024]; + read.ReadBytes(databuf, 3); + char msg_name[1024] = ""; + read.ReadBytes(msg_name, read.ReadByte()); + read.ReadByte(); // \" + char player_name[1024] = ""; + read.ReadBytes(player_name, read.ReadByte()); + read.ReadByte(); // \" + char message[1024] = ""; + read.ReadBytes(message, read.ReadByte()); + } + */ + + return ofunc(thisptr,msg_type,nFlags,size, &msg_data); +} \ No newline at end of file diff --git a/SpyCustom/Interfaces.cpp b/SpyCustom/Interfaces.cpp index 37389ac..c58db2d 100644 --- a/SpyCustom/Interfaces.cpp +++ b/SpyCustom/Interfaces.cpp @@ -9,7 +9,7 @@ void* IF::GetInterface(const char* dllname, const char* interfacename) tCreateInterface CreateInterface = (tCreateInterface)GetProcAddress(GetModuleHandleA(dllname), "CreateInterface"); int returnCode = 0; void* ointerface = CreateInterface(interfacename, &returnCode); - printfdbg("%s = %x\n", interfacename, ointerface); + printfdbg("Interface %s: %x\n", interfacename, ointerface); return ointerface; } @@ -22,7 +22,10 @@ PVOID FindHudElement(const char* name) = reinterpret_cast( pointer2 ); - return (void*)find_hud_element(pThis, name); + + void* ret = (void*)find_hud_element(pThis, name); + printfdbg("HUD Element %s: %x\n", name, ret); + return ret; } @@ -59,6 +62,8 @@ void IF::Init() g_pEffects = (IEffects*)GetInterface("client.dll", "IEffects001"); g_pStudioRender = (IStudioRender*)GetInterface("studiorender.dll", "VStudioRender026"); g_pPrediction = (CPrediction*)GetInterface("client.dll", "VClientPrediction001"); + g_pGameTypes = (IGameTypes*)GetInterface("client.dll", "VENGINE_GAMETYPES_VERSION002"); + typedef PVOID(__cdecl* oKeyValuesSystem)(); oKeyValuesSystem pkeyValuesSystem = (oKeyValuesSystem)GetProcAddress(GetModuleHandleA("vstdlib.dll"), "KeyValuesSystem"); @@ -67,7 +72,7 @@ void IF::Init() printfdbg("KeyValuesSystem = %x\n", keyValuesSystem); myConMsg = (CONMSGPROC)GetProcAddress(GetModuleHandleA("tier0.dll"), "?ConMsg@@YAXPBDZZ"); - myConColorMsg = (CONCOLORMSGPROC)GetProcAddress(GetModuleHandleA("tier0.dll"), "?ConColorMsg@@YAXABVColor@@PBDZZ"); + myConColorMsg = (CONCOLORMSGPROC)GetProcAddress(GetModuleHandleA("tier0.dll"), "?ConColorMsg@@YAXABVColor@@PBDZZ"); g_pGlobals = **(CGlobalVarsBase***)(FindPatternV2("client.dll", "A1 ? ? ? ? 5E 8B 40 10") + 1); g_pInput = *(CInput**)(FindPatternV2("client.dll", "B9 ? ? ? ? F3 0F 11 04 24 FF 50 10") + 1); @@ -114,8 +119,8 @@ void IF::Init() printfdbg("Hud element %x\n", g_pHudElement); auto SteamClient = ((ISteamClient * (__cdecl*)(void))GetProcAddress(GetModuleHandleA("steam_api.dll"), "SteamClient"))(); - g_SteamGameCoordinator = (ISteamGameCoordinator*)SteamClient->GetISteamGenericInterface((void*)1, (void*)1, "SteamGameCoordinator001"); - g_SteamUser = SteamClient->GetISteamUser((void*)1, (void*)1, "SteamUser019"); + g_SteamGameCoordinator = (ISteamGameCoordinator*)SteamClient->GetISteamGenericInterface((HSteamUser)1, (HSteamPipe)1, "SteamGameCoordinator001"); + g_SteamUser = SteamClient->GetISteamUser((HSteamUser)1, (HSteamPipe)1, "SteamUser019"); printfdbg("SteamClient %X\n", SteamClient); printfdbg("g_SteamGameCoordinator %X\n", g_SteamGameCoordinator); @@ -142,13 +147,13 @@ void IF::Init() printfdbg("g_ViewRender %x\n", g_ViewRender); - g_ClientMode = **(IClientMode***)((*(DWORD**)g_pClient)[10] + 0x5); + g_ClientMode = **(ClientModeShared***)((*(DWORD**)g_pClient)[10] + 0x5); printfdbg("g_ClientMode %x\n", g_ClientMode); g_pInputSystem = (IInputSystem*)GetInterface("inputsystem.dll", "InputSystemVersion001"); g_pVGuiSurface = (vgui::ISurface*)GetInterface("vguimatsurface.dll", "VGUI_Surface031"); - + fn_get_account_data = relativeToAbsolute(FindPatternV2("client.dll", "E8 ? ? ? ? 85 C0 74 EE") + 1); printfdbg("fn_get_account_data %x\n", fn_get_account_data); @@ -157,7 +162,10 @@ void IF::Init() printfdbg("ParticleCollectionSimulateAdr %x\n", ParticleCollectionSimulateAdr); + HudUniqueAlerts = (CHudElement*)FindHudElement("CCSGO_HudUniqueAlerts"); + GameRulesProxy = *(C_GameRulesProxy**)(FindPatternV2("client.dll", "A1 ? ? ? ? 85 C0 0F 84 ? ? ? ? 80 B8 ? ? ? ? ? 74 7A")+1); //C_GameRulesProxy + dwRadarBase = FindPatternV2("client.dll", "A1 ? ? ? ? 8B 0C B0 8B 01 FF 50 ? 46 3B 35 ? ? ? ? 7C EA 8B 0D") + 1; //C_GameRulesProxy } @@ -246,3 +254,28 @@ void NETSetConVar(const char* cvarname, const char* cvarvalue) //__asm popad } +void TextMsg(std::string text) +{ + if (iff.g_pClient) { + char message[0x100] = "\x08\x04\x1A"; + BYTE textsize = (BYTE)text.length(); + memcpy(&message[3], &textsize, 1); + memcpy(&message[4], text.c_str(), textsize); + memcpy(&message[4 + textsize], "\x1A\x00\x1A\x00\x1A\x00\x1A\x00", 8); + iff.g_pClient->DispatchUserMessage(CS_UM_TextMsg, 0, textsize + 12, &message); + } +} + +void ShowMenu(std::string text) +{ + if (iff.g_pClient) { + char message[0x1000] = "\x08\x80\x02\x10\x0A\x1A"; + text.append("\x0A \x0A->\x00"); + BYTE textsize = (BYTE)text.length(); + memcpy(&message[6], &textsize, 1); + memcpy(&message[7], text.c_str(), textsize); + iff.g_pClient->DispatchUserMessage(CS_UM_ShowMenu, 0, textsize + 7, &message); + } +} + + \ No newline at end of file diff --git a/SpyCustom/Interfaces.hpp b/SpyCustom/Interfaces.hpp index 2141cc4..66cd595 100644 --- a/SpyCustom/Interfaces.hpp +++ b/SpyCustom/Interfaces.hpp @@ -47,8 +47,7 @@ #include "sdk/baseclientstate.h" #include "imgui/imgui_impl_dx9.h" #include "sdk/flashlighteffect.h" -#include "sdk/inetchannel.h" -#include "sdk/steam.h" +#include "sdk/inetchannel.h" #include "sdk/animationlayer.h" #include "sdk/clientleafsystem.h" #include "sdk/filesystem.h" @@ -67,6 +66,11 @@ #include "sdk/iprediction.h" #include "sdk/inetmessage.h" #include "sdk/ClientNetMessage.h" +#include "sdk/clientmode_shared.h" +#include "sdk/isteamclient.h" +#include "sdk/isteamgamecoordinator.h" +#include "sdk/gamerules.h" +#include "sdk/igametypes.h" #include "XorStr.hpp" @@ -137,13 +141,15 @@ public: IEngineSound* g_pEngineSound = nullptr; IClientShadowMgr* g_pClientShadowMgr = nullptr; CCSViewRender* g_ViewRender = nullptr; - IClientMode* g_ClientMode = nullptr; - CGlobalVarsBase* g_Globals = nullptr; + ClientModeShared* g_ClientMode = nullptr; IInputSystem* g_pInputSystem = nullptr; ITempEnts* g_pTempEnts = nullptr; DWORD ParticleCollectionSimulateAdr = 0; CPrediction* g_pPrediction = nullptr; - + IGameTypes* g_pGameTypes = nullptr; + CHudElement* HudUniqueAlerts = nullptr; + C_GameRulesProxy* GameRulesProxy = nullptr; //C_GameRulesProxy + DWORD dwRadarBase = NULL; }; extern IF iff; @@ -359,5 +365,8 @@ static __declspec(naked) void __cdecl Invoke_NET_SetConVar(void* pfn, const char void NETSetConVar(const char* name, const char* value); +void TextMsg(std::string text); +void ShowMenu(std::string text); +std::string GetName(int id); #endif diff --git a/SpyCustom/Options.hpp b/SpyCustom/Options.hpp index be00ca4..56fe669 100644 --- a/SpyCustom/Options.hpp +++ b/SpyCustom/Options.hpp @@ -693,6 +693,10 @@ public: OPTION(bool, slidewalk, 0); OPTION(bool, fastduck, 0); OPTION(int, changing_name, 0); + OPTION(bool, c4timer, 0); + OPTION(bool, rankreveal, 0); + OPTION(bool, speclist, 0); + OPTION(bool, debugstuff, 0); }; inline Options g_Options; diff --git a/SpyCustom/Other.cpp b/SpyCustom/Other.cpp index 25e6a29..064f481 100644 --- a/SpyCustom/Other.cpp +++ b/SpyCustom/Other.cpp @@ -93,7 +93,7 @@ void AngleVectors(const Vector& angles, Vector* forward, Vector* right, Vector* } -static bool ToggleButton(ButtonCode_t code) +static bool ssToggleButton(ButtonCode_t code) { static int buttonPressedTick = 0; if (iff.g_pInputSystem->IsButtonDown(code) && (GetTickCount64() - buttonPressedTick) > 300) @@ -115,7 +115,7 @@ void FlashlightRun(C_BasePlayer* local) opt.disconnected = 0; } - if (ToggleButton(KEY_L)) + if (ssToggleButton(KEY_L)) { if (!pFlashLight) { @@ -170,7 +170,7 @@ void NightvisionRun(C_BasePlayer* local) { static int m_flNightVisionAlpha = NetvarSys::Get().GetOffset("DT_CSPlayer", "m_flFlashDuration") - 0x1C; - if (ToggleButton(KEY_N) ) + if (ssToggleButton(KEY_N) ) { if (!local->GetNightvision()) { diff --git a/SpyCustom/ProtoParse.h b/SpyCustom/ProtoParse.h index c18f0b8..016300c 100644 --- a/SpyCustom/ProtoParse.h +++ b/SpyCustom/ProtoParse.h @@ -110,7 +110,7 @@ private: WIRETYPE_FIXED32 = 5, }; - constexpr static WireType kWireTypeForFieldType[MAX_FIELD_TYPE + 1] = { + constexpr static WireType kWireTypeForFieldType[FieldType::MAX_FIELD_TYPE + 1] = { static_cast(-1), WIRETYPE_FIXED64, WIRETYPE_FIXED32, diff --git a/SpyCustom/ProtobuffMessages.h b/SpyCustom/ProtobuffMessages.h index 5eb7868..a5334f8 100644 --- a/SpyCustom/ProtobuffMessages.h +++ b/SpyCustom/ProtobuffMessages.h @@ -1,6 +1,8 @@ #pragma once #include "pbwrap.hpp" +//https://github.com/SteamDatabase/Protobufs/blob/master/csgo/cstrike15_gcmessages.proto + #define k_EMsgGCCStrike15_v2_MatchmakingGC2ClientReserve 9107 #define k_EMsgGCClientWelcome 4004 #define k_EMsgGCClientHello 4006 @@ -102,4 +104,204 @@ struct CMsgAdjustItemEquippedState : pbmsg<4> { PBFIELD(2, types::Uint32, new_class); PBFIELD(3, types::Uint32, new_slot); PBFIELD(4, types::Bool, swap); -}; \ No newline at end of file +}; + +// https://github.com/SteamDatabase/Protobufs/blob/master/csgo/cstrike15_usermessages.proto + +struct CCSUsrMsg_HintText : pbmsg<1> { + PBMSG_CTOR; + PBFIELD(1, types::String, text); +}; + +struct CCSUsrMsg_KeyHintText : pbmsg<1> { + PBMSG_CTOR; + PBFIELD(1, types::String, hints); +}; + +struct CCSUsrMsg_HudText : pbmsg<1> { + PBMSG_CTOR; + PBFIELD(1, types::String, text); +}; + +struct CCSUsrMsg_TextMsg : pbmsg<3> { + PBMSG_CTOR; + PBFIELD(1, types::Int32, msg_dst); + PBFIELD(3, types::String, params); +}; + +struct CCSUsrMsg_SayText : pbmsg<4> { + PBMSG_CTOR; + PBFIELD(1, types::Int32, ent_idx); + PBFIELD(2, types::String, text); + PBFIELD(3, types::Bool, chat); + PBFIELD(4, types::Bool, textallchat); +}; + +struct CCSUsrMsg_SayText2 : pbmsg<5> { + PBMSG_CTOR; + PBFIELD(1, types::Int32, ent_idx); + PBFIELD(2, types::Bool, chat); + PBFIELD(3, types::String, msg_name); + PBFIELD(4, types::String, params); + PBFIELD(5, types::Bool, textallchat); +}; + +struct CCSUsrMsg_RadioText : pbmsg<4> { + PBMSG_CTOR; + PBFIELD(1, types::Int32, msg_dst); + PBFIELD(2, types::Int32, client); + PBFIELD(3, types::String, msg_name); + PBFIELD(4, types::String, params); +}; + +struct CMsgRGBA : pbmsg<4> { + PBMSG_CTOR; + PBFIELD(1, types::Int32, r); + PBFIELD(2, types::Int32, g); + PBFIELD(3, types::Int32, b); + PBFIELD(4, types::Int32, a); +}; + +struct CMsgVector2D : pbmsg<2> { + PBMSG_CTOR; + PBFIELD(1, types::Float, x); + PBFIELD(2, types::Float, y); +}; + +struct CCSUsrMsg_HudMsg : pbmsg<11> { + PBMSG_CTOR; + PBFIELD(1, types::Int32, channel); + PBFIELD(2, CMsgVector2D, pos); + PBFIELD(3, CMsgRGBA, clr1); + PBFIELD(4, CMsgRGBA, clr2); + PBFIELD(5, types::Int32, effect); + PBFIELD(6, types::Float, fade_in_time); + PBFIELD(7, types::Float, fade_out_time); + PBFIELD(9, types::Float, hold_time); + PBFIELD(10, types::Float, fx_time); + PBFIELD(11, types::String, text); +}; + +struct CCSUsrMsg_SendAudio : pbmsg<1> { + PBMSG_CTOR; + PBFIELD(1, types::String, radio_sound); +}; + +struct CMsgPlayerInfo : pbmsg<6> { + PBMSG_CTOR; + PBFIELD(1, types::String, name); + PBFIELD(2, types::Fixed64, xuid); + PBFIELD(3, types::Int32, userid); + PBFIELD(4, types::Fixed64, steamid); + PBFIELD(5, types::Bool, fakeplayer); + PBFIELD(6, types::Bool, ishltv); +}; + +struct CMsg_CVars : pbmsg<2> { + PBMSG_CTOR; + + struct CVar : pbmsg<2> { + PBMSG_CTOR; + PBFIELD(1, types::String, name); + PBFIELD(2, types::String, value); + }; + + PBFIELD(1, CMsg_CVars::CVar, cvars); +}; + +struct CNETMsg_SetConVar : pbmsg<1> { + PBMSG_CTOR; + PBFIELD(1, CMsg_CVars, convars); +}; + +struct CCSUsrMsg_ShowMenu : pbmsg<3> { + PBMSG_CTOR; + PBFIELD(1, types::Int32, bits_valid_slots); + PBFIELD(2, types::Int32, display_time); + PBFIELD(3, types::String, menu_string); +}; + +enum ECstrike15UserMessages { + CS_UM_VGUIMenu = 1, + CS_UM_Geiger = 2, + CS_UM_Train = 3, + CS_UM_HudText = 4, + CS_UM_SayText = 5, + CS_UM_SayText2 = 6, + CS_UM_TextMsg = 7, + CS_UM_HudMsg = 8, + CS_UM_ResetHud = 9, + CS_UM_GameTitle = 10, + CS_UM_Shake = 12, + CS_UM_Fade = 13, + CS_UM_Rumble = 14, + CS_UM_CloseCaption = 15, + CS_UM_CloseCaptionDirect = 16, + CS_UM_SendAudio = 17, + CS_UM_RawAudio = 18, + CS_UM_VoiceMask = 19, + CS_UM_RequestState = 20, + CS_UM_Damage = 21, + CS_UM_RadioText = 22, + CS_UM_HintText = 23, + CS_UM_KeyHintText = 24, + CS_UM_ProcessSpottedEntityUpdate = 25, + CS_UM_ReloadEffect = 26, + CS_UM_AdjustMoney = 27, + CS_UM_UpdateTeamMoney = 28, + CS_UM_StopSpectatorMode = 29, + CS_UM_KillCam = 30, + CS_UM_DesiredTimescale = 31, + CS_UM_CurrentTimescale = 32, + CS_UM_AchievementEvent = 33, + CS_UM_MatchEndConditions = 34, + CS_UM_DisconnectToLobby = 35, + CS_UM_PlayerStatsUpdate = 36, + CS_UM_DisplayInventory = 37, + CS_UM_WarmupHasEnded = 38, + CS_UM_ClientInfo = 39, + CS_UM_XRankGet = 40, + CS_UM_XRankUpd = 41, + CS_UM_CallVoteFailed = 45, + CS_UM_VoteStart = 46, + CS_UM_VotePass = 47, + CS_UM_VoteFailed = 48, + CS_UM_VoteSetup = 49, + CS_UM_ServerRankRevealAll = 50, + CS_UM_SendLastKillerDamageToClient = 51, + CS_UM_ServerRankUpdate = 52, + CS_UM_ItemPickup = 53, + CS_UM_ShowMenu = 54, + CS_UM_BarTime = 55, + CS_UM_AmmoDenied = 56, + CS_UM_MarkAchievement = 57, + CS_UM_MatchStatsUpdate = 58, + CS_UM_ItemDrop = 59, + CS_UM_GlowPropTurnOff = 60, + CS_UM_SendPlayerItemDrops = 61, + CS_UM_RoundBackupFilenames = 62, + CS_UM_SendPlayerItemFound = 63, + CS_UM_ReportHit = 64, + CS_UM_XpUpdate = 65, + CS_UM_QuestProgress = 66, + CS_UM_ScoreLeaderboardData = 67, + CS_UM_PlayerDecalDigitalSignature = 68, + CS_UM_WeaponSound = 69, + CS_UM_UpdateScreenHealthBar = 70, + CS_UM_EntityOutlineHighlight = 71, + CS_UM_SSUI = 72, + CS_UM_SurvivalStats = 73, + CS_UM_DisconnectToLobby2 = 74, + CS_UM_EndOfMatchAllPlayersData = 75, + CS_UM_RoundImpactScoreData = 79, + CS_UM_CurrentRoundOdds = 80, + CS_UM_DeepStats = 81, + CS_UM_UtilMsg = 82 +}; + +enum ECSUsrMsg_DisconnectToLobby_Action { + k_ECSUsrMsg_DisconnectToLobby_Action_Default = 0, + k_ECSUsrMsg_DisconnectToLobby_Action_GoQueue = 1 +}; + + \ No newline at end of file diff --git a/SpyCustom/Skinchanger.cpp b/SpyCustom/Skinchanger.cpp index 9593ccb..afdfafa 100644 --- a/SpyCustom/Skinchanger.cpp +++ b/SpyCustom/Skinchanger.cpp @@ -212,8 +212,7 @@ bool Changer() } - - + const auto m_hRagdoll = (C_BaseEntity*)iff.g_pEntityList->GetClientEntityFromHandle(localplayer->Ragdoll()); if (m_hRagdoll) @@ -233,19 +232,21 @@ bool Changer() } } return 0; - } + } player_info_t localplayer_info; if (!iff.g_pEngineClient->GetPlayerInfo(localplayer_index, &localplayer_info)) return 0; - + CBaseHandle viewmodelHandle = localplayer->GetViewModel(); + C_BaseViewModel* pViewModel = (C_BaseViewModel*)iff.g_pEntityList->GetClientEntityFromHandle(viewmodelHandle); + const auto view_model_weapon = (C_BaseAttributableItem*)iff.g_pEntityList->GetClientEntityFromHandle(pViewModel->GetWeapon()); - + int idi = view_model_weapon->GetItemDefinitionIndex(); if (idi == WEAPON_KNIFE) idi = WEAPON_KNIFE_T; - + int modelcfgindex = GetCfgIndex2(idi); if (modelcfgindex != -1 && g_Options.models.value->arr[modelcfgindex].active) { @@ -258,10 +259,10 @@ bool Changer() modelprecache->AddString(false, model); } } - + int seqact = opt.needtogetseqact; if (seqact) - { + { int oldmodelindex = pViewModel->GetModelIndex(); pViewModel->SetModelIndex(iff.g_pMdlInfo->GetModelIndex(g_Options.models.value->arr[seqact].vmodel_orig)); for (int i = 0; i < 20; i++) @@ -282,7 +283,7 @@ bool Changer() } if (g_Options.weapons.value->arr[1].active && g_Options.weapons.value->arr[1].modelactive) - { + { auto hWearables = localplayer->GetWearables(); static int glove_handle; @@ -300,30 +301,40 @@ bool Changer() } if (!glove) - { + { static std::add_pointer_t createWearable = nullptr; if (!createWearable) { createWearable = []() -> decltype(createWearable) { for (auto clientClass = iff.g_pClient->GetAllClasses(); clientClass; clientClass = clientClass->m_pNext) - if (clientClass->m_ClassID == 54) + //if (clientClass->m_ClassID == 54) + if (_tcsstr(clientClass->GetName(), _T("CEconWearable")) != NULL) { + printfdbg("CEconWearable found\n"); return (std::add_pointer_t)clientClass->m_pCreateFn; + } return nullptr; }(); } + + const auto serial = rand() % 0x1000; auto entry = iff.g_pEntityList->GetHighestEntityIndex() + 1; + + for (int i = 65; i < iff.g_pEntityList->GetHighestEntityIndex(); i++) { auto pEntity = iff.g_pEntityList->GetClientEntity(i); - if (pEntity && pEntity->GetClientClass()->m_ClassID == 70) + if (pEntity && _tcsstr(pEntity->GetClientClass()->GetName(), _T("CRopeKeyframe")) != NULL) { + printfdbg("CRopeKeyframe found %d\n", i); + entry = i; break; } } + createWearable(entry, serial); glove = (C_BaseAttributableItem*)iff.g_pEntityList->GetClientEntity(entry); @@ -338,21 +349,22 @@ bool Changer() } if (glove) - { + { glove->GetItemDefinitionIndex() = g_Options.weapons.value->arr[1].modeldefindex; glove->GetItemIDHigh() = -1; glove->GetAccountID() = localplayer_info.xuidlow; glove->GetFallbackPaintKit() = g_Options.weapons.value->arr[1].skinid; glove->GetFallbackSeed() = g_Options.weapons.value->arr[1].seed; glove->GetFallbackWear() = g_Options.weapons.value->arr[1].wear; - + static int(__thiscall* fnInitializeAttributes)(void* wearable) = reinterpret_cast(FindPatternV2("client.dll", "55 8B EC 83 E4 F8 83 EC 0C 53 56 8B F1 8B 86")); + fnInitializeAttributes(glove); + //iff.g_pClientLeafSystem->CreateRenderableHandle(glove); + //https://www.unknowncheats.me/forum/counterstrike-global-offensive/312102-itemschema-skins-glove-changer-stickers.html } } - if (g_Options.weapons.value->arr[0].active && g_Options.weapons.value->arr[0].modelactive) - { - + { //can cause crash idk why /* static int lastmdlindex = -1; @@ -371,8 +383,7 @@ bool Changer() } } - */ - + */ if (view_model_weapon && is_knife(view_model_weapon->GetItemDefinitionIndex())) { @@ -380,64 +391,59 @@ bool Changer() pViewModel->GetModelIndex() = override_model_index; } - } - - - auto& weapons = localplayer->GetWeapons(); + } + auto& weapons = localplayer->GetWeapons(); + for (auto weapon_handle : weapons) - { + { if (weapon_handle == INVALID_EHANDLE_INDEX) break; - + C_BaseAttributableItem* weapon = static_cast(iff.g_pEntityList->GetClientEntityFromHandle(weapon_handle)); - + if (!weapon) continue; - + short item_definition_index = weapon->GetItemDefinitionIndex(); - + if (item_definition_index == WEAPON_C4 && g_Options.weapons.value->arr[GetCfgIndex(item_definition_index)].active) weapon->body() = 2; - + if (item_definition_index == 42) item_definition_index = 59; - - int configindex = GetCfgIndex(item_definition_index); if (configindex == -1) continue; - + if (g_Options.weapons.value->arr[configindex].active) - { + { if (is_knife(item_definition_index) && g_Options.weapons.value->arr[0].modelactive) - { - weapon->GetItemDefinitionIndex() = g_Options.weapons.value->arr[0].modeldefindex; + { + weapon->GetItemDefinitionIndex() = g_Options.weapons.value->arr[0].modeldefindex; short mdlindex = iff.g_pMdlInfo->GetModelIndex(g_Options.weapons.value->arr[0].model); - weapon->GetModelIndex() = mdlindex; - auto m_pWorld = (C_BaseEntity*)iff.g_pEntityList->GetClientEntityFromHandle(weapon->GetWeaponWorldModel()); - m_pWorld->GetModelIndex() = mdlindex+1; - } + if (mdlindex) { + weapon->GetModelIndex() = mdlindex; + //auto m_pWorld = (C_BaseEntity*)iff.g_pEntityList->GetClientEntityFromHandle(weapon->GetWeaponWorldModel()); + //m_pWorld->GetModelIndex() = mdlindex + 1; + } + } weapon->GetItemIDHigh() = -1; - + if (!g_Options.weapons.value->arr[configindex].ownerunk) weapon->GetAccountID() = localplayer_info.xuidlow; weapon->GetEntityQuality() = g_Options.weapons.value->arr[configindex].quality; snprintf(weapon->GetCustomName(), 32, "%s", g_Options.weapons.value->arr[configindex].nametag); - + weapon->GetFallbackPaintKit() = g_Options.weapons.value->arr[configindex].skinid; weapon->GetFallbackSeed() = g_Options.weapons.value->arr[configindex].seed; weapon->GetFallbackWear() = g_Options.weapons.value->arr[configindex].wear; weapon->GetFallbackStatTrak() = g_Options.weapons.value->arr[configindex].stattrak; - - ApplyStickers(weapon); - + ApplyStickers(weapon); - } + } } - - - + if (*g_Options.nvgsON) NightvisionRun(localplayer); @@ -459,7 +465,7 @@ void __fastcall hkFrameStageNotify(IBaseClientDLL* thisptr, void* edx, ClientFra static auto oFrameStageNotify = ClientHook->GetOriginal(37); if ( (*g_Options.playerloop_count || *g_Options.entityloop_count) && stage == ClientFrameStage_t::FRAME_NET_UPDATE_POSTDATAUPDATE_END) - { + { for (int i = 1; i < 65; i++) { C_BasePlayer* pEntity = (C_BasePlayer*)iff.g_pEntityList->GetClientEntity(i); @@ -508,12 +514,9 @@ void __fastcall hkFrameStageNotify(IBaseClientDLL* thisptr, void* edx, ClientFra auto element = FindHudElement("CCSGO_HudWeaponSelection"); auto hud_weapons = reinterpret_cast(std::uintptr_t(element) - 0xA0); - - printfdbg("p clearHudWeapon %x hud_weapons %x c %d\n", clearHudWeapon, hud_weapons, *(hud_weapons + 32)); - + if (hud_weapons) { - for (int i = 0; i < *(hud_weapons + 32); i++) { - printfdbg("hud_weapons %d\n", i); + for (int i = 0; i < *(hud_weapons + 32); i++) { i = clearHudWeapon(hud_weapons, i); } } diff --git a/SpyCustom/SpyCustom.aps b/SpyCustom/SpyCustom.aps index f5460a9..7dff69b 100644 Binary files a/SpyCustom/SpyCustom.aps and b/SpyCustom/SpyCustom.aps differ diff --git a/SpyCustom/SpyCustom.vcxproj b/SpyCustom/SpyCustom.vcxproj index 40a2843..80d07b5 100644 --- a/SpyCustom/SpyCustom.vcxproj +++ b/SpyCustom/SpyCustom.vcxproj @@ -24,7 +24,7 @@ DynamicLibrary false - v142 + v143 true MultiByte @@ -168,7 +168,6 @@ - @@ -182,6 +181,7 @@ + @@ -204,6 +204,7 @@ + @@ -212,12 +213,14 @@ + + @@ -262,6 +265,7 @@ + @@ -273,12 +277,15 @@ + + + @@ -317,6 +324,7 @@ + @@ -338,6 +346,7 @@ + @@ -353,6 +362,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -364,6 +394,7 @@ + @@ -380,6 +411,7 @@ + @@ -399,9 +431,11 @@ + + @@ -422,6 +456,7 @@ + @@ -442,9 +477,13 @@ - + + + + + @@ -461,6 +500,7 @@ + @@ -470,6 +510,7 @@ + @@ -503,7 +544,9 @@ + + @@ -519,6 +562,7 @@ + @@ -543,7 +587,6 @@ - @@ -562,4 +605,4 @@ - + \ No newline at end of file diff --git a/SpyCustom/SpyCustom.vcxproj.filters b/SpyCustom/SpyCustom.vcxproj.filters index eba0026..6732397 100644 --- a/SpyCustom/SpyCustom.vcxproj.filters +++ b/SpyCustom/SpyCustom.vcxproj.filters @@ -39,9 +39,6 @@ Header Files - - Header Files - Header Files @@ -921,9 +918,6 @@ Header Files\sdk - - Header Files\sdk - Header Files\sdk @@ -1164,6 +1158,144 @@ Header Files\sdk + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + + + Header Files\sdk + @@ -1178,9 +1310,6 @@ Source Files - - Source Files - Source Files @@ -1237,4 +1366,4 @@ Resource Files - + \ No newline at end of file diff --git a/SpyCustom/VMT.hpp b/SpyCustom/VMT.hpp index 11d0ada..ae51d5b 100644 --- a/SpyCustom/VMT.hpp +++ b/SpyCustom/VMT.hpp @@ -31,10 +31,10 @@ public: } void SwapPointer(size_t index, void* new_function) - { + { printfdbg("Swapping pointer 0x%X to 0x%X\n", new_table_pointer[index], reinterpret_cast(new_function)); new_table_pointer[index] = reinterpret_cast(new_function); - printfdbg("Swapped pointer!\n"); + //printfdbg("Swapped pointer!\n"); } @@ -42,14 +42,14 @@ public: { printfdbg("Applying new table... (0x%X to 0x%X)\n", reinterpret_cast(*class_pointer), reinterpret_cast(new_table_pointer)); * class_pointer = new_table_pointer; - printfdbg("New table applyed!\n"); + //printfdbg("New table applyed!\n"); } void RestoreOldTable() { printfdbg("Restoring old table... (0x%X to 0x%X)\n", reinterpret_cast(*class_pointer), reinterpret_cast(original_pointer)); * class_pointer = original_pointer; - printfdbg("Old table restored!\n"); + //printfdbg("Old table restored!\n"); } template diff --git a/SpyCustom/dllmain.cpp b/SpyCustom/dllmain.cpp index 5b750e4..235354d 100644 --- a/SpyCustom/dllmain.cpp +++ b/SpyCustom/dllmain.cpp @@ -151,8 +151,9 @@ void OnLoadCfg() opt.loading = 0; } + + - DWORD WINAPI HackThread(HMODULE hModule) { @@ -165,13 +166,29 @@ DWORD WINAPI HackThread(HMODULE hModule) freopen_s(&f, "CONOUT$", "w", stdout); printfdbg("Cheat launched\n"); #endif - + iff.Init(); opt.hModuleGlobal = hModule; NetvarSys::Get().Initialize(); + void* ptrDevMsg = GetProcAddress(GetModuleHandleA("tier0.dll"), "?DevMsg@@YAXPBDZZ"); + printfdbg("DevMsg %x\n", ptrDevMsg); + + if (ptrDevMsg) + oDevMsg = (pDevMsg)DetourFunction( + (PBYTE)(ptrDevMsg), + (PBYTE)hkDevMsg); + + void* ptrDevWarningMsg = GetProcAddress(GetModuleHandleA("tier0.dll"), "?DevWarning@@YAXPBDZZ"); + printfdbg("DevWarningMsg %x\n", ptrDevWarningMsg); + + if (ptrDevWarningMsg) + oDevWarningMsg = (pDevWarningMsg)DetourFunction( + (PBYTE)(ptrDevWarningMsg), + (PBYTE)hkDevWarningMsg); + DMEHook = new VMTHook(iff.g_pMdlRender); DMEHook->SwapPointer(21, reinterpret_cast(DrawModelExecute)); DMEHook->ApplyNewTable(); @@ -226,18 +243,35 @@ DWORD WINAPI HackThread(HMODULE hModule) ClientHook = new VMTHook(iff.g_pClient); ClientHook->SwapPointer(37, reinterpret_cast(hkFrameStageNotify)); + ClientHook->SwapPointer(38, reinterpret_cast(hkDispatchUserMessage)); ClientHook->ApplyNewTable(); - + iff.g_pGameConsole->Clear(); EventListener* eventListener = new EventListener(); Color color = { 255,255,0,255 }; - iff.g_pCVar->ConsoleColorPrintf(color, "zdarova\n"); + iff.g_pCVar->ConsoleColorPrintf(color, "Seaside loaded!\n"); + - ConVar* sv_skyname = iff.g_pCVar->FindVar("sv_skyname"); + //testing stuff + auto hudradio = FindHudElement("CCSGO_HudRadio"); + printfdbg("hudradio %x\n", hudradio); + //static CGameRules* g_pGameRules = nullptr; + + //if (!g_pGameRules) + // g_pGameRules = *(CGameRules**)(FindPatternV2("client.dll", "8B 0D ?? ?? ?? ?? FF B3 70 04 ?? ?? FF 77 08 + 0x2") + 0x1); + //if (g_pGameRules) + // printf("g_pGameRules %x\n", g_pGameRules); + + // + + // + + ConVar* sv_skyname = iff.g_pCVar->FindVar("sv_skyname"); + int proxyindex = 0; for (ClientClass* pClass = iff.g_pClient->GetAllClasses(); pClass; pClass = pClass->m_pNext) { if (!strcmp(pClass->m_pNetworkName, "CBaseViewModel")) { @@ -302,7 +336,7 @@ DWORD WINAPI HackThread(HMODULE hModule) { opt.show = !opt.show; #ifdef DEBUG - cout << "Show " << opt.show << endl; + cout << "Show Menu: " << opt.show << endl; #endif if (!opt.show) iff.g_pInputSystem->EnableInput(1); @@ -332,6 +366,9 @@ DWORD WINAPI HackThread(HMODULE hModule) printfdbg("Model materials dumped\n"); *g_Options.dme_gettextures = true; } + + + } else { @@ -368,9 +405,11 @@ DWORD WINAPI HackThread(HMODULE hModule) iff.g_pCVar->FindVar("fog_override")->SetValue(0); iff.g_pCVar->FindVar("mat_force_tonemap_scale")->SetValue(0.0f); + SetValueUnrestricted("developer", 0); + SetValueUnrestricted("sv_show_usermessage", 0); + ResetMisc(); - - + DMEHook->RestoreOldTable(); D3DHook->RestoreOldTable(); ClientHook->RestoreOldTable(); @@ -389,6 +428,12 @@ DWORD WINAPI HackThread(HMODULE hModule) DetourRemove(reinterpret_cast(oGetAccountData), reinterpret_cast(hkGetAccountData)); DetourRemove(reinterpret_cast(oParticleCollectionSimulate), reinterpret_cast(hkParticleCollectionSimulate)); + if (ptrDevMsg) + DetourRemove(reinterpret_cast(oDevMsg), reinterpret_cast(hkDevMsg)); + if (ptrDevWarningMsg) + DetourRemove(reinterpret_cast(oDevWarningMsg), reinterpret_cast(hkDevWarningMsg)); + + ImGui_ImplDX9_Shutdown(); ImGui_ImplWin32_Shutdown(); ImGui::DestroyContext(); diff --git a/SpyCustom/protobuffs.cpp b/SpyCustom/protobuffs.cpp index 500f793..10ad845 100644 --- a/SpyCustom/protobuffs.cpp +++ b/SpyCustom/protobuffs.cpp @@ -131,7 +131,7 @@ bool Protobuffs::SendClientHello() ((uint32_t*)ptr)[1] = 0; memcpy((void*)((DWORD)ptr + 8), (void*)packet.data(), packet.size()); - bool result = iff.g_SteamGameCoordinator->GCSendMessage(k_EMsgGCClientHello | ((DWORD)1 << 31), ptr, packet.size() + 8) == k_EGCResultOK; + bool result = iff.g_SteamGameCoordinator->SendMessage(k_EMsgGCClientHello | ((DWORD)1 << 31), ptr, packet.size() + 8) == k_EGCResultOK; free(ptr); return result; @@ -150,7 +150,7 @@ bool Protobuffs::SendMatchmakingClient2GCHello() ((uint32_t*)ptr)[1] = 0; memcpy((void*)((DWORD)ptr + 8), (void*)packet.data(), packet.size()); - bool result = iff.g_SteamGameCoordinator->GCSendMessage(k_EMsgGCCStrike15_v2_MatchmakingClient2GCHello | ((DWORD)1 << 31), ptr, packet.size() + 8) == k_EGCResultOK; + bool result = iff.g_SteamGameCoordinator->SendMessage(k_EMsgGCCStrike15_v2_MatchmakingClient2GCHello | ((DWORD)1 << 31), ptr, packet.size() + 8) == k_EGCResultOK; free(ptr); return result; @@ -175,7 +175,7 @@ bool Protobuffs::SendClientGcRankUpdate() ((uint32_t*)ptr)[1] = 0; memcpy((void*)((DWORD)ptr + 8), (void*)packet.data(), packet.size()); - bool result = iff.g_SteamGameCoordinator->GCSendMessage(k_EMsgGCCStrike15_v2_ClientGCRankUpdate | ((DWORD)1 << 31), ptr, packet.size() + 8) == k_EGCResultOK; + bool result = iff.g_SteamGameCoordinator->SendMessage(k_EMsgGCCStrike15_v2_ClientGCRankUpdate | ((DWORD)1 << 31), ptr, packet.size() + 8) == k_EGCResultOK; free(ptr); return result; @@ -199,7 +199,7 @@ bool Protobuffs::EquipWeapon(int weaponid, int classid, int slotid) ((uint32_t*)ptr)[1] = 0; memcpy((void*)((DWORD)ptr + 8), (void*)packet.data(), packet.size()); - bool result = iff.g_SteamGameCoordinator->GCSendMessage(k_EMsgGCAdjustItemEquippedState | ((DWORD)1 << 31), ptr, packet.size() + 8) == k_EGCResultOK; + bool result = iff.g_SteamGameCoordinator->SendMessage(k_EMsgGCAdjustItemEquippedState | ((DWORD)1 << 31), ptr, packet.size() + 8) == k_EGCResultOK; free(ptr); return result; @@ -214,9 +214,9 @@ Protobuffs ProtoFeatures; -EGCResult __fastcall hkGCRetrieveMessage(void* ecx, void*, uint32_t* punMsgType, void* pubDest, uint32_t cubDest, uint32_t* pcubMsgSize) +EGCResults __fastcall hkGCRetrieveMessage(void* ecx, void*, uint32_t* punMsgType, void* pubDest, uint32_t cubDest, uint32_t* pcubMsgSize) { - static auto oGCRetrieveMessage = ProtoHook->GetOriginal(2); + static auto oGCRetrieveMessage = ProtoHook->GetOriginal(2); auto status = oGCRetrieveMessage(ecx, punMsgType, pubDest, cubDest, pcubMsgSize); @@ -235,9 +235,9 @@ EGCResult __fastcall hkGCRetrieveMessage(void* ecx, void*, uint32_t* punMsgType, return status; } -EGCResult __fastcall hkGCSendMessage(void* ecx, void*, uint32_t unMsgType, const void* pubData, uint32_t cubData) +EGCResults __fastcall hkGCSendMessage(void* ecx, void*, uint32_t unMsgType, const void* pubData, uint32_t cubData) { - static auto oGCSendMessage = ProtoHook->GetOriginal(0); + static auto oGCSendMessage = ProtoHook->GetOriginal(0); bool sendMessage = ProtoFeatures.PreSendMessage(unMsgType, const_cast(pubData), cubData); diff --git a/SpyCustom/protobuffs.hpp b/SpyCustom/protobuffs.hpp index 42e9da5..34c3acf 100644 --- a/SpyCustom/protobuffs.hpp +++ b/SpyCustom/protobuffs.hpp @@ -4,7 +4,9 @@ #include "VMT.hpp" -#include "sdk/steam.h" +//#include "sdk/steam.h" +#include "sdk/steam_api.h" +#include "sdk/isteamgamecoordinator.h" #include "intrin.h" extern VMTHook* ProtoHook; @@ -24,7 +26,7 @@ public: extern Protobuffs ProtoFeatures; -EGCResult __fastcall hkGCRetrieveMessage(void* ecx, void*, uint32_t* punMsgType, void* pubDest, uint32_t cubDest, uint32_t* pcubMsgSize); -EGCResult __fastcall hkGCSendMessage(void* ecx, void*, uint32_t unMsgType, const void* pubData, uint32_t cubData); +EGCResults __fastcall hkGCRetrieveMessage(void* ecx, void*, uint32_t* punMsgType, void* pubDest, uint32_t cubDest, uint32_t* pcubMsgSize); +EGCResults __fastcall hkGCSendMessage(void* ecx, void*, uint32_t unMsgType, const void* pubData, uint32_t cubData); diff --git a/SpyCustom/proxies.hpp b/SpyCustom/proxies.hpp index 57056fc..c4b8a38 100644 --- a/SpyCustom/proxies.hpp +++ b/SpyCustom/proxies.hpp @@ -180,13 +180,9 @@ void SetViewModelSequence(const CRecvProxyData* pDataConst, void* pStruct, void* } } - -#ifdef DEBUG - cout << "active " << (char*)pViewModel->GetSequenceActivity(m_nSequence); - printf(" ~new seq %d (%s)\n ", m_nSequence, szModel); -#endif - - + + printfdbg("Sequence %s %d (%s)\n", (char*)pViewModel->GetSequenceActivity(m_nSequence), m_nSequence, szModel); + pData->m_Value.m_Int = m_nSequence; } }