From 245a95b15bef379b5b978f3647156cf0b0d895aa Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Thu, 13 Feb 2020 18:22:38 +0100 Subject: [PATCH] IL2CPP: Allow code at address zero to be evaluated (part of #21) --- Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs b/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs index 3a9b64f..eda8513 100644 --- a/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs +++ b/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs @@ -141,16 +141,15 @@ namespace Il2CppInspector Debug.WriteLine("Function table:"); Debug.WriteLine(string.Join(", ", from a in addrs select string.Format($"0x{a:X8}"))); - foreach (var loc in addrs) - if (loc != 0) { - var (code, metadata) = ConsiderCode(subImage, loc); - if (code != 0) { - RegistrationFunctionPointer = loc + subImage.GlobalOffset; - Console.WriteLine("Required structures acquired from code heuristics. Initialization function: 0x{0:X16}", RegistrationFunctionPointer); - Configure(subImage, code, metadata); - return true; - } + foreach (var loc in addrs) { + var (code, metadata) = ConsiderCode(subImage, loc); + if (code != 0) { + RegistrationFunctionPointer = loc + subImage.GlobalOffset; + Console.WriteLine("Required structures acquired from code heuristics. Initialization function: 0x{0:X16}", RegistrationFunctionPointer); + Configure(subImage, code, metadata); + return true; } + } Console.WriteLine("No matches via code heuristics"); return false;