From 61db60f8f0eaddefa124f70935d927dd5a5ba6b4 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Sat, 23 Sep 2023 03:53:58 +0200 Subject: [PATCH] Detect the engine version for "Ahriman's Prophecy" correctly It is RPG Maker 2003 1.0.8.0 but their exe file lacks a VERSIONINFO. The code segment size is checked instead to detect the version correctly. --- src/exe_reader.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/exe_reader.cpp b/src/exe_reader.cpp index a2925deabf..a9470ae547 100644 --- a/src/exe_reader.cpp +++ b/src/exe_reader.cpp @@ -327,7 +327,14 @@ int EXEReader::FileInfo::GetEngineType(bool& is_maniac_patch) const { // VALUE! or Rpg2k3 < 1.0.2.1 // Check CODE segment size to be sure if (code_size > 0xB0000) { - return Player::EngineRpg2k3; + if (code_size >= 0xC7400) { + // Code segment size for >= 1.0.5.0 + // In theory this check is unnecessary because this version has a VERSIONINFO. + // However the modified exe shipped with Ahriman's Prophecy is a 1.0.8.0 without a VERSIONINFO. + return Player::EngineRpg2k3 | Player::EngineMajorUpdated; + } else { + return Player::EngineRpg2k3; + } } return Player::EngineRpg2k | Player::EngineMajorUpdated;