From bf2e810657b0413aa01290d06b8fc104626e7502 Mon Sep 17 00:00:00 2001 From: Boomslangnz Date: Fri, 16 Nov 2018 08:36:29 +1300 Subject: [PATCH] Added system taskkill for InpWrapper --- OpenParrot/src/Functions/Global.cpp | 36 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/OpenParrot/src/Functions/Global.cpp b/OpenParrot/src/Functions/Global.cpp index 09536fd..e752fb6 100644 --- a/OpenParrot/src/Functions/Global.cpp +++ b/OpenParrot/src/Functions/Global.cpp @@ -1,6 +1,7 @@ #include #include #include "Global.h" +#include "Utility/GameDetect.h" #pragma optimize("", off) void *__cdecl memcpy_0(void *a1, const void *a2, size_t a3) @@ -35,20 +36,27 @@ std::wstring utf8_decode(const std::string &str) return wstrTo; } -DWORD WINAPI QuitGameThread(__in LPVOID lpParameter) -{ - while (true) - { - if (GetAsyncKeyState(VK_ESCAPE)) - { -#ifndef _DEBUG - TerminateProcess(GetCurrentProcess(), 0); -#endif - //ExitProcess(0); - } - - Sleep(300); - } +DWORD WINAPI QuitGameThread(__in LPVOID lpParameter) +{ + while (true) + { + if ((GameDetect::currentGame == GameID::Daytona3) && (GetAsyncKeyState(VK_ESCAPE))) + { +#ifndef _DEBUG + system("taskkill /f /im InpWrapper.exe"); + TerminateProcess(GetCurrentProcess(), 0); +#endif + } + else if (GetAsyncKeyState(VK_ESCAPE)) + { +#ifndef _DEBUG + TerminateProcess(GetCurrentProcess(), 0); +#endif + //ExitProcess(0); + } + + Sleep(300); + } } /* WINDOW HOOKS */