Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Вопрос Как реализовать auto accept в кс 2?

does anyone know that you need to hook for autoaception and how to implement it in general?
This is the function that tells the GC "I'm ready." Find it in client.dll by searching for string xrefs to "prematch:" or "deferred" in IDA.

Signature:
Code:
  1. bool(__fastcall* SetPlayerReady)(void* thisptr, const char* szReadyType);
Pattern:
Code:
  1. 40 53 48 83 EC 20 48 8B DA 48 8D 15 ???? 48 8B CB FF 15? ??? 85 C0 75 14 BA 02 00
The "deferred" Trap
SetPlayerReady takes a string that controls which code path runs:

"deferred" → goes through an internal point that is of ten NULL. Accept silently fails. You'll sit there wonderful why nothing happens.
"accept" (or any string that isn't "deferred") → takes the working path, sets ready state to 2, senses accept to GC.
The strcmp against "deferred" is the branch point. If it matches, broken path. Anything else, working path. First arg is nullptr — function doesn't use this in the accept path.

Code:
  1. SetPlayerReady(nullptr, "deferred"); //WRONG — broken path, silently fails SetPlayerReady(nullptr, "accept"); //CORRECT — senses accept to GC
Hook 1: MatchFoundHandler (primary — instant accept)
Fires when the GC tells the client a match was found. Match data is already stored at this point so you can call SetPlayerReady immediately. No delay needed.

Pattern (client.dll):
Code:
  1. 48 83 EC 28 48 8B 0D?? ?? 48 85 C9 74 ? 48 8B 01 48 89 7C 24 20 FF 50 78
Implementation:
Code:
  1. void __fastcall hkMatchFoundHandler() { if (g_bAutoAccept) { SetPlayerReady(nullptr, "accept");
  2. FLASHWINFO fi = {}; fi.cbSize = sizeof(fi); fi.hwnd = g_hWindow; fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; FlashWindowEx(&fi); } oOriginalMatchFoundHandler();
  3. }
Hook 2: Panorama Event (backup — with delay)
The Panorama event "popup_accept_match_found" fires when the accept popup shows, but BEFORE the GC handler finishes storing match data. If you call SetPlayerReady imperfectly here, you read a null point and nothing happens (or you crash).

Fix: 1.5 second delay.

Pattern (client.dll):
Code:
  1. 40 56 57 41 57 48 83 EC 40 48 8B 3D???? 4D 85 C0 48 8B 35? ??? 4C 8B FA 49 0F 45 F8
Implementation:
Code:
  1. __int64 __fastcall hkPanoramaEvent(void* pUnk, const char* szEventName, void* pUnk1, float flUnk) { if (szEventName && strcmp(szEventName, "popup_accept_match_found") == 0) { if (g_bAutoAccept) { FLASHWINFO fi = {}; fi.cbSize = sizeof(fi); fi.hwnd = g_hWindow; fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; FlashWindowEx(&fi);
  2. std::thread( {Sleep(1500); SetPlayerReady(nullptr, "accept"); }).detach(); } } return oOriginalPanoramaEvent(pUnk, szEventName, pUnk1, flUnk);
  3. }
 
This is the function that tells the GC "I'm ready." Find it in client.dll by searching for string xrefs to "prematch:" or "deferred" in IDA.

Signature:
Code:
  1. bool(__fastcall* SetPlayerReady)(void* thisptr, const char* szReadyType);
Pattern:
Code:
  1. 40 53 48 83 EC 20 48 8B DA 48 8D 15 ???? 48 8B CB FF 15? ??? 85 C0 75 14 BA 02 00
The "deferred" Trap
SetPlayerReady takes a string that controls which code path runs:

"deferred" → goes through an internal point that is of ten NULL. Accept silently fails. You'll sit there wonderful why nothing happens.
"accept" (or any string that isn't "deferred") → takes the working path, sets ready state to 2, senses accept to GC.
The strcmp against "deferred" is the branch point. If it matches, broken path. Anything else, working path. First arg is nullptr — function doesn't use this in the accept path.

Code:
  1. SetPlayerReady(nullptr, "deferred"); //WRONG — broken path, silently fails SetPlayerReady(nullptr, "accept"); //CORRECT — senses accept to GC
Hook 1: MatchFoundHandler (primary — instant accept)
Fires when the GC tells the client a match was found. Match data is already stored at this point so you can call SetPlayerReady immediately. No delay needed.

Pattern (client.dll):
Code:
  1. 48 83 EC 28 48 8B 0D?? ?? 48 85 C9 74 ? 48 8B 01 48 89 7C 24 20 FF 50 78
Implementation:
Code:
  1. void __fastcall hkMatchFoundHandler() { if (g_bAutoAccept) { SetPlayerReady(nullptr, "accept");

  2. FLASHWINFO fi = {}; fi.cbSize = sizeof(fi); fi.hwnd = g_hWindow; fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; FlashWindowEx(&fi); } oOriginalMatchFoundHandler();

  3. }
Hook 2: Panorama Event (backup — with delay)
The Panorama event "popup_accept_match_found" fires when the accept popup shows, but BEFORE the GC handler finishes storing match data. If you call SetPlayerReady imperfectly here, you read a null point and nothing happens (or you crash).

Fix: 1.5 second delay.

Pattern (client.dll):
Code:
  1. 40 56 57 41 57 48 83 EC 40 48 8B 3D???? 4D 85 C0 48 8B 35? ??? 4C 8B FA 49 0F 45 F8
Implementation:
Code:
  1. __int64 __fastcall hkPanoramaEvent(void* pUnk, const char* szEventName, void* pUnk1, float flUnk) { if (szEventName && strcmp(szEventName, "popup_accept_match_found") == 0) { if (g_bAutoAccept) { FLASHWINFO fi = {}; fi.cbSize = sizeof(fi); fi.hwnd = g_hWindow; fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; FlashWindowEx(&fi);

  2. std::thread( {Sleep(1500); SetPlayerReady(nullptr, "accept"); }).detach(); } } return oOriginalPanoramaEvent(pUnk, szEventName, pUnk1, flUnk);

  3. }
Are the patterns current?
 
Назад
Сверху Снизу