From 58c2b6608d7d56ec73d0a6ba43b6ec68ae7637c0 Mon Sep 17 00:00:00 2001 From: Nico Giansanti Date: Sun, 14 Apr 2019 00:20:33 +0300 Subject: [PATCH] Fix D: redirects and nop OutputDebugStringA --- .../Functions/Games/Nesica/NesicaGeneric.cpp | 31 +++++++++++++++++++ .../src/Functions/Nesica_Libs/FastIoEmu.cpp | 1 + 2 files changed, 32 insertions(+) diff --git a/OpenParrot/src/Functions/Games/Nesica/NesicaGeneric.cpp b/OpenParrot/src/Functions/Games/Nesica/NesicaGeneric.cpp index b1af3cc..0f38d3a 100644 --- a/OpenParrot/src/Functions/Games/Nesica/NesicaGeneric.cpp +++ b/OpenParrot/src/Functions/Games/Nesica/NesicaGeneric.cpp @@ -33,9 +33,40 @@ static InitFunction initFunction_GC2([]() init_RegHooks(); init_NesysEmu(); + // Patch D: references + //D: + injector::WriteMemoryRaw(imageBase + 0x33D344, ".", 2, true); + // D:/garbage%d.txt + injector::WriteMemoryRaw(imageBase + 0x2B6B08, "./garbage%d.txt", 16, true); + // D:/country.dat + injector::WriteMemoryRaw(imageBase + 0x2B4B68, "./country.dat", 14, true); + injector::WriteMemoryRaw(imageBase + 0x2B4B54, "./country.dat", 14, true); + // D:/NesysQueue_Error_%04d_%02d_%02d_%02d_%02d_%02d.txt + injector::WriteMemoryRaw(imageBase + 0x2B205C, "./NesysQueue_Error_%04d_%02d_%02d_%02d_%02d_%02d.txt", 53, true); + // D:/count.csv + injector::WriteMemoryRaw(imageBase + 0x2B1024, "./count.csv", 12, true); + injector::WriteMemoryRaw(imageBase + 0x2B0F40, "./count.csv", 12, true); + // D:\\%s/ + injector::WriteMemoryRaw(imageBase + 0x27AD80, "./%s/", 6, true); + // D:\\%s/* + injector::WriteMemoryRaw(imageBase + 0x27AD78, "./%s/*", 7, true); + // "D:\\%s/%s" + injector::WriteMemoryRaw(imageBase + 0x27AD6C, "./%s/%s", 8, true); + // "D:\\" + injector::WriteMemoryRaw(imageBase + 0x27AC44, "./", 3, true); + // D:\\%s%04d%02d%02d_%02d%02d%02d_ + injector::WriteMemoryRaw(imageBase + 0x27AC00, "./%s%04d%02d%02d_%02d%02d%02d_", 31, true); + // D:\\%s/%s/* + injector::WriteMemoryRaw(imageBase + 0x27AD60, "./%s/%s/*", 10, true); + // D:/PlayData/ + injector::WriteMemoryRaw(imageBase + 0x2A9CB8, "./PlayData/", 12, true); + // C:\\TypeXZEROTemp.dat check safeJMP(imageBase + 0xF81B0, ReturnTrue); + // Ignore stupid OutputDebugStringA Scheluder crap + injector::MakeNOP(imageBase + 0x2008CC, 7); + // Unstuck the game from some dumb mouse scanner func injector::MakeNOP(imageBase + 0xA3FF6, 2); #if _M_IX86 diff --git a/OpenParrot/src/Functions/Nesica_Libs/FastIoEmu.cpp b/OpenParrot/src/Functions/Nesica_Libs/FastIoEmu.cpp index b8ab3ec..21798b3 100644 --- a/OpenParrot/src/Functions/Nesica_Libs/FastIoEmu.cpp +++ b/OpenParrot/src/Functions/Nesica_Libs/FastIoEmu.cpp @@ -148,6 +148,7 @@ int __cdecl iDmacDrvRegisterRead(int DeviceId, DWORD CommandCode, LPVOID OutBuff break; // Packages that are ok to return 0 for now to prevent spam... case 0x4158: + case 0x4154: case 0x415C: case 0x41D0: case 0x41D4: