From c17f47cb714b82b6a33a392ecce3d7462e39e073 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Sun, 27 Oct 2019 22:39:09 +0100 Subject: [PATCH] ARM64: Pre-v21 support --- Il2CppInspector/Il2CppBinaryARM64.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Il2CppInspector/Il2CppBinaryARM64.cs b/Il2CppInspector/Il2CppBinaryARM64.cs index 8db2d5f..c3b70ba 100644 --- a/Il2CppInspector/Il2CppBinaryARM64.cs +++ b/Il2CppInspector/Il2CppBinaryARM64.cs @@ -165,12 +165,13 @@ namespace Il2CppInspector } // Is it Il2CppCodegenRegistration(void)? - // X0-X2 will be set and they will be the only registers set - if (regs.Count == 3 && regs.TryGetValue(0, out ulong x0) && - regs.TryGetValue(1, out x1) && - regs.TryGetValue(2, out ulong _)) { + // In v21 and later, X0-X2 will be set and they will be the only registers set + // Pre-v21, X0-X1 will be the only registers set + if (image.Version >= 21 && regs.Count == 3 && regs.TryGetValue(0, out ulong x0) && regs.TryGetValue(1, out x1) && regs.TryGetValue(2, out ulong _)) + return (x0, x1); + + if (image.Version < 21 && regs.Count == 2 && regs.TryGetValue(0, out x0) && regs.TryGetValue(1, out x1)) return (x0, x1); - } return (0, 0); }