1
0
mirror of synced 2025-01-20 17:48:51 +01:00

Merge pull request #18 from Boomslangnz/master

Added system taskkill for InpWrapper
This commit is contained in:
Reaver 2018-12-14 22:43:35 +02:00 committed by GitHub
commit 00a49ca1e1
3 changed files with 36 additions and 15 deletions

View File

@ -256,6 +256,7 @@ static InitFunction Daytona3Func([]()
injector::WriteMemoryRaw(imageBase + 0xDD697, "\x90\x90\x90\x90\x90\x90\x38\x05\xC8\xF9\x5A\x01\x90\x90\x90\x90\x90\x90", 18, true);
injector::WriteMemoryRaw(imageBase + 0x12958F, "\x33\xC0\x8A\x45\x08\x90\x90\x90\x90\x72\x08\x66\xA3\x46\xFC\x5A\x01\xEB\x06\x66\xA3\x44\xFC\x5A\x01\x31\xFF\x31\xF6\x47\xBE\x0F\x00\x00\x00\xEB\x4C\x90\x90\x90\x90", 41, true);
injector::WriteMemoryRaw(imageBase + 0xD8616C, "\x2E\x2E\x2F\x73\x68\x65\x6C\x6C\x00\x00\x00\x00\x00\x00\x00\x00\x2E\x2E\x2F\x73\x68\x65\x6C\x6C\x5C\x49\x6E\x70\x57\x72\x61\x70\x70\x65\x72\x2E\x65\x78\x65\x00\x00\x00\x00\x00\x00\x00\x00\x00", 48, true);
injector::WriteMemoryRaw(imageBase + 0x7D087, "\x85\xFF\x0F\x84\xE9\x01\x00\x00\x6A\x00\x8B\xCF\xE8\xC8\xD2\x21\x00\x8D\x80\x00\x80\x00\x00\x89\x46\x40\x6A\x05\x8B\xCF\xE8\xB6\xD2\x21\x00\xC1\xE0\x08\x89\x46\x44\x6A\x04\x8B\xCF\xE8\xA7\xD2\x21\x00\xC1\xE0\x08\x89\x46\x48\x90\xEB\x2E\xE8\xE9\xD4\x21\x00\x8B\x5E\x04\x8B\xF8\x8B\xCF\xE8\x2D\xD5\x21\x00\x8D\x4B\x01\x3B\xC1\x0F\x8C\x9A\x01\x00\x00\x53\x8B\xCF\xE8\xDA\xD4\x21\x00\x8B\xF8\xEB\x9D\x90\x90\x90\x90\x90\x90", 105, true);
injector::MakeNOP(imageBase + 0x1DDDFA, 5);
injector::MakeNOP(imageBase + 0x1DDE1E, 6);
injector::MakeNOP(imageBase + 0x1DDE45, 6);
@ -266,6 +267,10 @@ static InitFunction Daytona3Func([]()
{
injector::WriteMemoryRaw(imageBase + 0x17CD3D, "\x00", 1, true);
}
if (ToBool(config["General"]["Hide Cursor"]))
{
SetCursorPos(2000, 2000);
}
MH_Initialize();
MH_CreateHook((void*)(imageBase + 0x1E9280), ControlsFunction, (void**)&g_origControlsFunction);
MH_EnableHook(MH_ALL_HOOKS);

View File

@ -1,6 +1,7 @@
#include <StdInc.h>
#include <Utility/InitFunction.h>
#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 */

View File

@ -57,6 +57,7 @@ int iround(double num) {
}
extern int* ffbOffset;
extern int* ffbOffset2;
DWORD WINAPI XInputGetState
(
@ -81,6 +82,10 @@ DWORD WINAPI XInputGetState
{
gamepadState.bRightTrigger = daytonaPressStart ? 0xFF : 0x00;
}
if (GameDetect::currentGame == GameID::Daytona3)
{
gamepadState.sThumbLX |= (-(33024 - *ffbOffset2) * 255);
}
#endif
if (pState->dwPacketNumber == UINT_MAX)
pState->dwPacketNumber = 0;
@ -285,8 +290,11 @@ DWORD WINAPI XInputGetStateEx
{
gamepadState.bRightTrigger = daytonaPressStart ? 0xFF : 0x00;
}
if (GameDetect::currentGame == GameID::Daytona3)
{
gamepadState.sThumbLX |= (-(33024 - *ffbOffset2) * 255);
}
#endif
if (pState->dwPacketNumber == UINT_MAX)
pState->dwPacketNumber = 0;
else