From a7a19ef017e5e692673c20ffc6c0d803a9057f57 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sat, 19 Jan 2019 00:18:07 -0500 Subject: [PATCH] add srpg hook --- vnrhook/engine/engine.cc | 15 +++++++++++++++ vnrhook/engine/engine.h | 1 + vnrhook/engine/match.cc | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/vnrhook/engine/engine.cc b/vnrhook/engine/engine.cc index 0896d3a..f7472ee 100644 --- a/vnrhook/engine/engine.cc +++ b/vnrhook/engine/engine.cc @@ -11885,6 +11885,21 @@ bool InsertSilkysHook() return true; } +bool InsertSRPGHook() +{ + if (DWORD addr = (DWORD)GetProcAddress(GetModuleHandleW(L"oleaut32.dll"), "SysAllocString")) + { + HookParam hp = {}; + hp.offset = 4; + hp.address = addr; + hp.type = USING_STRING | USING_UNICODE | NO_CONTEXT; + NewHook(hp, "SRPG"); + return true; + } + ConsoleOutput("Textractor: SRPG: couldn't find function"); + return false; +} + /** jichi 6/1/2014 Eushully * Insert to the last GetTextExtentPoint32A * diff --git a/vnrhook/engine/engine.h b/vnrhook/engine/engine.h index 3004ee8..fd33dec 100644 --- a/vnrhook/engine/engine.h +++ b/vnrhook/engine/engine.h @@ -142,6 +142,7 @@ bool InsertScenarioPlayerHook();// sol-fa-soft: *.iar && *.sec5 bool InsertSiglusHook(); // SiglusEngine: SiglusEngine.exe bool InsertSideBHook(); // SideB: Copyright side-B bool InsertSilkysHook(); // SilkysPlus +bool InsertSRPGHook(); // SilverSoft SRPG studio: *.dts bool InsertSyuntadaHook(); // Syuntada: dSoh.dat bool InsertSystem43Hook(); // System43@AliceSoft: AliceStart.ini bool InsertSystemAoiHook(); // SystemAoi: *.vfs diff --git a/vnrhook/engine/match.cc b/vnrhook/engine/match.cc index 3e4a774..3b154a6 100644 --- a/vnrhook/engine/match.cc +++ b/vnrhook/engine/match.cc @@ -444,6 +444,12 @@ bool DetermineEngineByFile4() return true; } + // Artikash 1/18/2019: SRPG Studio sample game https://www.freem.ne.jp/win/game/16844 + if (Util::CheckFile(L"*.dts")) { + InsertSRPGHook(); + return true; + } + return false; }