From cd4d06d9b3f7129a89d3cd5929b927156931e19e Mon Sep 17 00:00:00 2001 From: Perfare Date: Fri, 3 Feb 2023 10:18:25 +0800 Subject: [PATCH] Fixed #646 --- Il2CppDumper/Il2Cpp/Il2Cpp.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Il2CppDumper/Il2Cpp/Il2Cpp.cs b/Il2CppDumper/Il2Cpp/Il2Cpp.cs index 28441fe..8286533 100644 --- a/Il2CppDumper/Il2Cpp/Il2Cpp.cs +++ b/Il2CppDumper/Il2Cpp/Il2Cpp.cs @@ -52,12 +52,13 @@ namespace Il2CppDumper { if (codeRegistration != 0) { + var limit = this is WebAssemblyMemory ? 0x35000 : 0x50000; //TODO if (Version >= 24.2) { pCodeRegistration = MapVATR(codeRegistration); if (Version == 29) { - if (pCodeRegistration.genericMethodPointersCount > 0x50000) //TODO + if (pCodeRegistration.genericMethodPointersCount > limit) { Version = 29.1; codeRegistration -= PointerSize * 2; @@ -66,7 +67,7 @@ namespace Il2CppDumper } if (Version == 27) { - if (pCodeRegistration.reversePInvokeWrapperCount > 0x50000) //TODO + if (pCodeRegistration.reversePInvokeWrapperCount > limit) { Version = 27.1; codeRegistration -= PointerSize; @@ -76,7 +77,7 @@ namespace Il2CppDumper if (Version == 24.4) { codeRegistration -= PointerSize * 2; - if (pCodeRegistration.reversePInvokeWrapperCount > 0x50000) //TODO + if (pCodeRegistration.reversePInvokeWrapperCount > limit) { Version = 24.5; codeRegistration -= PointerSize; @@ -107,7 +108,8 @@ namespace Il2CppDumper public virtual void Init(ulong codeRegistration, ulong metadataRegistration) { pCodeRegistration = MapVATR(codeRegistration); - if (Version == 27 && pCodeRegistration.invokerPointersCount > 0x50000) //TODO + var limit = this is WebAssemblyMemory ? 0x35000 : 0x50000; //TODO + if (Version == 27 && pCodeRegistration.invokerPointersCount > limit) { Version = 27.1; Console.WriteLine($"Change il2cpp version to: {Version}"); @@ -122,7 +124,7 @@ namespace Il2CppDumper if (codeGenModule.rgctxsCount > 0) { var rgctxs = MapVATR(codeGenModule.rgctxs, codeGenModule.rgctxsCount); - if (rgctxs.All(x => x.data.rgctxDataDummy > 0x50000)) + if (rgctxs.All(x => x.data.rgctxDataDummy > limit)) { Version = 27.2; Console.WriteLine($"Change il2cpp version to: {Version}"); @@ -131,7 +133,7 @@ namespace Il2CppDumper } } } - if (Version == 24.4 && pCodeRegistration.invokerPointersCount > 0x50000) //TODO + if (Version == 24.4 && pCodeRegistration.invokerPointersCount > limit) { Version = 24.5; Console.WriteLine($"Change il2cpp version to: {Version}");