From f353a90f36dd5d797f043165e23b148981f1e89f Mon Sep 17 00:00:00 2001 From: maowenrui <3505719167@qq.com> Date: Thu, 8 Oct 2026 09:53:14 +0800 Subject: [PATCH] fix QueryServerAlreadyOpen func error ret --- Anit-Cheat_DLL/client_palpit.cpp | 87 -------------------------------- Anit-Cheat_DLL/client_palpit.h | 14 ----- Anit-Cheat_DLL/client_pipe.cpp | 20 +++++++- 3 files changed, 19 insertions(+), 102 deletions(-) delete mode 100644 Anit-Cheat_DLL/client_palpit.cpp delete mode 100644 Anit-Cheat_DLL/client_palpit.h diff --git a/Anit-Cheat_DLL/client_palpit.cpp b/Anit-Cheat_DLL/client_palpit.cpp deleted file mode 100644 index 9f10681..0000000 --- a/Anit-Cheat_DLL/client_palpit.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "client_palpit.h" -#include "client_comm_shared.h" - -namespace client_palpit -{ - DWORD WINAPI palpit_thread(LPVOID parmar) - { - static int break_count_fail = 0; - - while (TRUE) - { - auto mapping_data = reinterpret_cast(parmar); - - /*strcpy_s(mapping_data->str, "fail"); - mapping_data->add_index_code = TRUE; - - auto val = 100; - mapping_data->Index = val; - - while (strcmp(mapping_data->str, "ok")) { - - if (break_count_fail > 5) { - MessageBoxA(NULL, "[client] 请求超时 错误代码:-502", NULL, NULL); - exit(0); - } - - break_count_fail++; - - Sleep(1000); - - } - - if ((val + 1) != mapping_data->Index) - { - MessageBoxA(NULL, "[client] 组件发生异常 错误代码:-501", NULL, NULL); - exit(0); - } - - break_count_fail = 0;*/ - - // - // 检测进程是否退出 - // - if (!mapping_data->client_pid) - mapping_data->client_pid = GetCurrentProcessId(); - - //static int fail_index = 0; - //static HANDLE hProcess = 0; - - //auto server_pid = mapping_data->server_pid; - //if (hProcess == NULL) - //{ - // if (fail_index > 3) { - // exit(0); - // } - // - - // hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, server_pid); - // fail_index++; - // continue; - //} - - //// - ////监控客户端进程是否退出 - //// - //DWORD exitCode; - //if (GetExitCodeProcess(hProcess, &exitCode)) { - // if (exitCode != STILL_ACTIVE) { - // exit(0); - // } - //} - - - Sleep(1000); - } - - - return 0; - } - - - auto create_papit_thread(LPVOID parmar) -> void - { - CloseHandle(CreateThread(nullptr, 0, palpit_thread, parmar, 0, nullptr)); - } - -} \ No newline at end of file diff --git a/Anit-Cheat_DLL/client_palpit.h b/Anit-Cheat_DLL/client_palpit.h deleted file mode 100644 index 57447c2..0000000 --- a/Anit-Cheat_DLL/client_palpit.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once -#ifndef CHLENT_PALPIT -#define CHLENT_PALPIT -#include "Base.h" - - -namespace client_palpit -{ - auto create_papit_thread(LPVOID parmar) -> void; - -} - - -#endif // !client_palpit diff --git a/Anit-Cheat_DLL/client_pipe.cpp b/Anit-Cheat_DLL/client_pipe.cpp index 8229a21..7bb0a1a 100644 --- a/Anit-Cheat_DLL/client_pipe.cpp +++ b/Anit-Cheat_DLL/client_pipe.cpp @@ -189,6 +189,12 @@ static bool ConnectToServer(HANDLE& pipe) DWORD err = GetLastError(); if (err == ERROR_PIPE_BUSY) { + LogA( + "[dll-client] CreateFileW(%ls) failed: %lu\n", + kPipeName, + err); + + if (!WaitNamedPipeW(kPipeName, 1000)) Sleep(250); continue; @@ -540,9 +546,21 @@ BOOL QueryServerAlreadyOpen() 0, nullptr); - if (pipe == INVALID_HANDLE_VALUE) + + + + if (pipe == INVALID_HANDLE_VALUE) { + + + DWORD err = GetLastError(); + + LogA("[dll-client] CreateFileW failed, err=%lu\n", err); + return FALSE; + } + + DWORD mode = PIPE_READMODE_MESSAGE; SetNamedPipeHandleState(pipe, &mode, nullptr, nullptr);