1
0
mirror of synced 2025-01-31 20:15:26 +01:00

add update5 support!

This commit is contained in:
doomertheboomer 2022-10-09 00:01:25 +07:00
parent 4fdf5720e3
commit a555cb9e42
2 changed files with 18 additions and 5 deletions

View File

@ -19,6 +19,7 @@ static bool isFreePlay;
static bool isEventMode2P;
static bool isEventMode4P;
const char *ipaddrdxplus;
bool isUpdate5 = false;
// MUST DISABLE IC CARD, FFB MANUALLY N MT5DX+
@ -322,12 +323,19 @@ unsigned int WINAPI Hook_bind_w5p(SOCKET s, const sockaddr* addr, int namelen) {
}
}
// Wmmt5Func([]()): InitFunction
// Performs the initial startup tasks for
// maximum tune 5, including the starting
// of required subprocesses.
static InitFunction Wmmt5Func([]()
{
if (ToBool(config["Update5"]["Enable Update5"]))
{
isUpdate5 = true;
}
// Alloc debug console
FreeConsole();
AllocConsole();
@ -388,10 +396,15 @@ static InitFunction Wmmt5Func([]()
// Give me the HWND please maxitune
MH_CreateHookApi(L"user32", "ShowWindow", Hook_ShowWindow, reinterpret_cast<LPVOID*>(&pShowWindow));
pMaxituneWndProc = (WindowProcedure_t)(imageBasedxplus + 0xB78B90);
pMaxituneWndProc = (WindowProcedure_t)(hook::get_pattern("48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 83 EC 30 8B EA BA EB FF FF FF 49 8B F9 49 8B F0 48 8B D9 FF 15 ? ? ? 00 48 85 C0 74 1D 4C", 0));
//load banapass emu
auto mod = LoadLibraryA(".\\openBanaW5p.dll");
if (!isUpdate5) {
LoadLibraryA(".\\openBanaW5p.dll");
}
else {
LoadLibraryA(".\\openBanaW5p5.dll");
}
// Prevents game from setting time, thanks pockywitch!
MH_CreateHookApi(L"KERNEL32", "SetSystemTime", Hook_SetSystemTime, reinterpret_cast<LPVOID*>(&pSetSystemTime));
@ -423,7 +436,7 @@ static InitFunction Wmmt5Func([]()
// Terminal mode is off
if (!isTerminal)
{
injector::MakeNOP(imageBasedxplus + 0x9F2BB3, 2); //terminal on same machine patch
injector::MakeNOP(hook::get_pattern("74 ? 80 7B 31 00 75 ? 48 8B 43 10 80 78 31 00 75 1A 48 8B D8 48 8B 00 80 78 31 00 75 ? 48 8B D8"), 2); //terminal on same machine patch
// If terminal emulator is enabled
if (ToBool(config["General"]["TerminalEmulator"]))
@ -461,7 +474,7 @@ static InitFunction Wmmt5Func([]()
}
}
{
if (!isUpdate5) {
// Enable all print
injector::MakeNOP(imageBasedxplus + 0x898BD3, 6);

View File

@ -456,7 +456,7 @@ void GameDetect::DetectCurrentGame()
// PATCHES 10-21 & 5DX+
if (*(uint32_t*)(moduleBase + 0x2F00) == 0x084AFF48)
{
if (newCrcResult == 0x1BB6F051)
if (newCrcResult == 0x1BB6F051 || newCrcResult == 0x7E61F32D)
{
SetGameId(GameID::WMMT5DXPlus, "WMMT5DX+");
}