configs.h
// add into misc struct
// find 'bool anti_untrusted;'
// insert below
bool auto_accept_matchmaking;
configs.cpp
// insert wherever you please within this method 'void C_ConfigManager::setup()'
setup_item(&g_cfg.misc.auto_accept_matchmaking, false, crypt_str("Misc.auto_accept_matchmaking"));
hooks.hpp
//find 'extern C_HookedEvents hooked_events;'
// insert this code above that line
extern vmthook* enginesound_hook;
// find 'class c_baseplayeranimationstate;'
// insert this code below that line
struct SoundData {
std::byte pad[4];
int entityIndex;
int channel;
const char* soundEntry;
std::byte pad1[8];
float volume;
std::byte pad2[44];
};
// find 'LRESULT __stdcall Hooked_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);'
// insert this code above that line
void __stdcall hooked_emitsound(SoundData data);
// find 'extern SetMouseCodeState_t o_SetMouseCodeState;'
// insert this code below that line
using EmitSound_t = void(__stdcall*)(SoundData data);
inline EmitSound_t oEmitSound;
hooks.cpp
// find 'C_HookedEvents hooked_events;'
// insert this code above that line
vmthook* enginesound_hook;
// scroll to the bottom of hooks.cpp and paste this code
void __stdcall hooks::hooked_emitsound(SoundData data)
{
static auto original_fn = oEmitSound;
if (g_cfg.misc.auto_accept_matchmaking) {
if (!strcmp(data.soundEntry, "UIPanorama.popup_accept_match_beep")) {
static auto fnAccept = reinterpret_cast<bool(__stdcall*)(const char*)>(util::FindSignature("client.dll", "55 8B EC 83 E4 F8 8B 4D 08 BA ? ? ? ? E8 ? ? ? ? 85 C0 75 12"));
static HWND window = FindWindow(NULL, "Counter-Strike: Global Offensive");
if (fnAccept) {
fnAccept("");
FLASHWINFO fi;
fi.cbSize = sizeof(FLASHWINFO);
fi.hwnd = window;
fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
fi.uCount = 0;
fi.dwTimeout = 0;
FlashWindowEx(&fi);
}
}
}
original_fn(data);
}
// insert wherever you please within this method 'void C_ConfigManager::setup()'
setup_item(&g_cfg.misc.auto_accept_matchmaking, false, crypt_str("Misc.auto_accept_matchmaking"));
main.cpp
// below other includes at top of file
// make sure this leads to the location of your minhook files so it actually finds the header file lol
#include "minhook.h"
// above the 'enum error_type'
inline unsigned int get_virtual(void* _class, unsigned int index) { return static_cast<unsigned int>((*static_cast<int**>(_class))[index]); }
// find 'hooks::original_processinterpolatedlist'
// insert code below that line
MH_Initialize();
// find 'hooks::hooked_events.RegisterSelf();'
// insert code above that line
MH_EnableHook(MH_ALL_HOOKS);
// find 'while (!(INIT::Window = IFH(FindWindow)(crypt_str("Valve001"), nullptr)))'
// insert code above that line - just find somewhere along your other hooks to put this
hooks::enginesound_hook = new vmthook(reinterpret_cast<DWORD**>(m_enginesound()));
const auto emitsound_target = reinterpret_cast<void*>(get_virtual(m_enginesound(), 5));
MH_CreateHook(emitsound_target, &hooks::hooked_emitsound, reinterpret_cast<void**>(&hooks::oEmitSound));