From 90d32c011d0ab557d6f14f0e75ce9c1a1cbdb76d Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Thu, 29 Nov 2018 14:12:59 -0500 Subject: [PATCH] fix scenarioplayer --- vnrhook/engine/engine.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/vnrhook/engine/engine.cc b/vnrhook/engine/engine.cc index 39ab2ba..01bad0e 100644 --- a/vnrhook/engine/engine.cc +++ b/vnrhook/engine/engine.cc @@ -11336,24 +11336,22 @@ bool InsertScenarioPlayerHook() } HookParam hp = {}; - //hp.address = addr; + hp.address = addr; hp.length_offset = 1; hp.offset = 4; - //if (addr - start == addr_offset_W) { - // Artikash 8/18/2018: can't figure out how to tell apart which hook is needed, so just insert both xD + if (addr - start == addr_offset_W) { + // Artikash 8/18/2018: can't figure out how to tell apart which hook is needed, so alert user // (The method used to tell the hooks apart previously fails on https://vndb.org/v19713) - HookParam hp2 = hp; hp.type = USING_UNICODE; - hp.address = addr; ConsoleOutput("vnreng: INSERT ScenarioPlayerW"); NewHook(hp, "ScenarioPlayerW"); - //} else { - hp2.type = BIG_ENDIAN; // 4 - hp2.address = addr + 5; + } else { + hp.type = BIG_ENDIAN; // 4 ConsoleOutput("vnreng: INSERT ScenarioPlayerA"); - NewHook(hp2, "ScenarioPlayerA"); - //} + NewHook(hp, "ScenarioPlayerA"); + } + ConsoleOutput("Text encoding might be wrong: try changing it if this hook finds garbage!"); return true; }