I don't have the necessary programs on this pc but can someone compile it as a DLL
its an auto accepter for Matchmking CSGO
its an auto accepter for Matchmking CSGO
Code
#include <stdint.h>
#include <string.h>
#include <windows.h>
static void *g_surface = nullptr;
typedef void (__thiscall *pfnPlaySound) (void *, const char *);
pfnPlaySound fnPlaySound;
static __forceinline is_main_window(void)
{
static HWND csgoWindow = 0;
if (!csgoWindow)
do
csgoWindow = FindWindowA("Counter-Strike: Global Offensive");
while (!csgoWindow)
return GetWindow(csgoWindow, GW_OWNER) == (HWND)0 && IsWindowVisible(csgoWindow)
&& GetForegroundWindow() == csgoWindow && !IsIconic(csgoWindow);
}
static void __stdcall playSoundHooked(const char *sample)
{
fnPlaySound(g_surface, sample);
if (strstr(sample, "inposition02.wav")) {
while (!is_main_window()) {
ShowWindow(csgoWindow, SW_RESTORE);
SetActiveWindow(csgoWindow);
Sleep(1000);
}
}
}
static void derp(HINSTANCE voidwhereprohibited)
{
uintptr_t matsurface;
while (!(matsurface = (uintptr_t)GetModuleHandleA("vguimatsurface.dll")))
Sleep(10);
typedef void *(*ciface_t) (const char *, int *);
ciface_t create_iface;
do {
create_iface = (ciface_t)GetProcAddress((HMODULE)matsurface, "CreateInterface");
Sleep(10);
} while (!create_iface);
g_surface = create_iface("VGUI_Surface031", nullptr);
uintptr_t p = *(uintptr_t *)g_surface;
fnPlaySound = (pfnPlaySound)(p + 81 * 4);
*(uintptr_t *)(p + 81 * 4) = (uintptr_t)playSoundHooked;
}
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)derp, hInstance, 0, nullptr);
return true;
}