Hack Forums
[C] Need Compile to .DLL Auto Accepter - MatchMaking CSGO - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C] Need Compile to .DLL Auto Accepter - MatchMaking CSGO (/showthread.php?tid=4722165)



Need Compile to .DLL Auto Accepter - MatchMaking CSGO - keepitlseezy1 - Mar 8, 2015

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
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;
}



* - P3TE - Mar 8, 2015

Not trying to bash you but is it that hard to click "Accept" when you're about to play anyways?


* - keepitlseezy1 - Mar 8, 2015

(Mar 8, 2015 06:04 PM)P3TE Wrote:  Not trying to bash you but is it that hard to click "Accept" when you're about to play anyways?
its different when your at lem with high elo queues are forever and some ppl wanna smoke fap etc and i want to be able to alt tab and still have autoaccept


* - P3TE - Mar 8, 2015

(Mar 8, 2015 06:05 PM)keepitlseezy1 Wrote:  its different when your at lem with high elo queues are forever and some ppl wanna smoke fap etc and i want to be able to alt tab and still have autoaccept

Ah okay that makes sense then dude.

👍