From 1528b66b94891cf0540afa0e90e8e5e39e8ebbb9 Mon Sep 17 00:00:00 2001 From: Ferris Date: Fri, 17 Jan 2025 10:24:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=AD=A3GetPIDForProcess=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=88=B0=E8=BF=9B=E7=A8=8BID=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/injector.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/injector.cc b/source/injector.cc index 8dcd67c..d3708b6 100644 --- a/source/injector.cc +++ b/source/injector.cc @@ -526,7 +526,7 @@ DWORD GetPIDForProcess(wchar_t* process) if (!hSnapshot) { return 0; } - pe32.dwSize = sizeof(PROCESSENTRY32); + pe32.dwSize = sizeof(PROCESSENTRY32W); for (working = Process32FirstW(hSnapshot, &pe32); working; working = Process32NextW(hSnapshot, &pe32)) { if (!wcscmp(pe32.szExeFile, process)) @@ -933,7 +933,7 @@ int InjectDll(wchar_t* szPName, wchar_t* szDllPath) result = 1; } else - { + { DWORD dErrorCode = GetLastError(); printf("dll inject fail"); printf("error code : %d ", dErrorCode);