// Created by ISO2768mK // Version detection from the Death Stranding and Alan Wake ASL state("HorizonForbiddenWest", "v1.5.80.0-Steam") { uint loading : 0x08983150, 0x4B4; } state("HorizonForbiddenWest", "v1.5.80.0-Epic") { uint loading : 0x0895EF50, 0x4B4; } /* Getting address for new game version: Value (HEX) 48 8B 05 ?? ?? ?? ?? 48 85 C0 74 15 83 B8 B4 04 00 00 00 75 0C 83 B8 74 06 00 00 02 74 03 B0 01 C3 32 C0 Alternatively, giving multiple results: 83 B8 B4 04 00 00 00 (hard coded for RAX register) 83 ?? B4 04 00 00 00 (matches any register) Options: In static memory (HFW in the process dropdown) Clear Writable, Check Executable flags Clear Fast Scan (we probably don't have alignment) Perform Scan Right Click -> Disassemble this memory region Get the value after "HorizonForbiddenWest+" -> this is the offset we need */ startup { Action<string> DebugOutput = (text) => { if (false) { print("[HFW Load Remover Debug] " + text); } }; vars.DebugOutput = DebugOutput; Action<string> InfoOutput = (text) => { print("[HFW Load Remover] " + text); }; vars.InfoOutput = InfoOutput; Func<ProcessModuleWow64Safe, string> CalcModuleHash = (module) => { byte[] exeHashBytes = new byte[0]; using (var sha = System.Security.Cryptography.SHA256.Create()) { using (var s = File.Open(module.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { exeHashBytes = sha.ComputeHash(s); } } var hash = exeHashBytes.Select(x => x.ToString("X2")).Aggregate((a, b) => a + b); return hash; }; vars.CalcModuleHash = CalcModuleHash; } init { var module = modules.Single(x => String.Equals(x.ModuleName, "HorizonForbiddenWest.exe", StringComparison.OrdinalIgnoreCase)); // No need to catch anything here because LiveSplit wouldn't have attached itself to the process if the name wasn't present var moduleSize = module.ModuleMemorySize; var hash = vars.CalcModuleHash(module); vars.DebugOutput(module.ModuleName + ": Module Size " + moduleSize + ", SHA256 Hash " + hash); version = ""; if (hash == "9CEC6626AB60059D186EDBACCA4CE667573E8B28C916FCA1E07072002055429E") { version = "v1.5.80.0-Steam"; } else if (hash == "8274587FA89612ADF904BDB2554DEA84D718B84CF691CCA9D2FB7D8D5D5D659B") { version = "v1.5.80.0-Epic"; } if (version != "") { vars.InfoOutput("Recognized version: " + version); } else { vars.InfoOutput("Unrecognized version of the game."); } } isLoading { return (current.loading >= 1); } exit { timer.IsGameTimePaused = false; }