state("AGLS-Win64-Shipping") { } startup { Assembly.Load(File.ReadAllBytes("Components/asl-help")).CreateInstance("Basic"); vars.Helper.GameName = "Spector 01"; vars.Helper.AlertLoadless(); } init { IntPtr fNames = IntPtr.Zero; // --- FNamePool --- try { fNames = vars.Helper.ScanRel(5, "74 09 48 8D 15 ???????? EB 16"); } catch { } if (fNames == IntPtr.Zero) try { fNames = vars.Helper.ScanRel(3, "48 8D 05 ???????? EB ?? 48 8D 0D ???????? E8 ???????? C6 05"); } catch { } if (fNames == IntPtr.Zero) throw new Exception("FNamePool sig scan failed."); // --- GEngine --- IntPtr gEngine = IntPtr.Zero; try { gEngine = vars.Helper.ScanRel(3, "48 8B 05 ???????? 48 85 C0 74 ?? F6 80"); } catch { } if (gEngine == IntPtr.Zero) try { gEngine = vars.Helper.ScanRel(3, "48 8B 05 ???????? 48 85 C0 0F 84 ???????? 48 8B 88"); } catch { } if (gEngine == IntPtr.Zero) try { gEngine = vars.Helper.ScanRel(3, "48 8B 05 ???????? 48 85 C0 74 ?? 80 B8"); } catch { } if (gEngine == IntPtr.Zero) throw new Exception("GEngine sig scan failed."); // GEngine -> +0xC10 (GameViewport) -> +0x78 (World) -> +0x18 (FName) vars.Helper["MapName"] = vars.Helper.Make(gEngine, 0xC10, 0x78, 0x18); // GEngine -> +0xC10 (GameViewport) -> +0x78 (World ptr, NULL during loads) vars.Helper["WorldPtr"] = vars.Helper.Make(gEngine, 0xC10, 0x78); // FName to string resolution via UE5 FNamePool vars.FNameToString = (Func)(fName => { var nameIdx = (fName & 0x000000000000FFFF); var chunkIdx = (fName & 0x00000000FFFF0000) >> 0x10; var number = (fName & 0xFFFFFFFF00000000) >> 0x20; IntPtr chunk = vars.Helper.Read(fNames + 0x10 + (int)chunkIdx * 0x8); IntPtr entry = chunk + (int)nameIdx * sizeof(short); int length = vars.Helper.Read(entry) >> 6; string name = vars.Helper.ReadString(length, ReadStringType.UTF8, entry + sizeof(short)); return number == 0 ? name : name + "_" + number; }); current.World = ""; current.WorldPtr = (long)0; } update { vars.Helper.Update(); vars.Helper.MapPointers(); try { var world = vars.FNameToString(current.MapName); if (!string.IsNullOrEmpty(world) && world != "None") current.World = world; } catch { } if (old.World != current.World) print("World: " + old.World + " -> " + current.World); } isLoading { return (long)current.WorldPtr == 0; } // MainMenu -> Level2 -> BlueTunnels -> Level1 -> OpenWorldLevel start { return old.World == "MainMenu" && current.World == "Level2"; } split { return current.World != old.World && old.World != "MainMenu"; } reset { return current.World == "MainMenu" && old.World != "MainMenu" && old.World != "OpenWorldLevel"; }