From a571fcb7b41abac07027bbfbc1fb8ace68af4360 Mon Sep 17 00:00:00 2001 From: ds5678 <49847914+ds5678@users.noreply.github.com> Date: Tue, 24 Dec 2024 04:42:00 -0800 Subject: [PATCH] Fix overflow in TryGetLiteralAt --- Cpp2IL.Core/Utils/MiscUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cpp2IL.Core/Utils/MiscUtils.cs b/Cpp2IL.Core/Utils/MiscUtils.cs index 1aba4242..df0e89d9 100644 --- a/Cpp2IL.Core/Utils/MiscUtils.cs +++ b/Cpp2IL.Core/Utils/MiscUtils.cs @@ -101,7 +101,7 @@ internal static string[] GetGenericParams(string input) public static string? TryGetLiteralAt(Il2CppBinary theDll, ulong rawAddr) { - if (theDll.RawLength <= (long)rawAddr) + if ((ulong)theDll.RawLength <= rawAddr) return null; var c = Convert.ToChar(theDll.GetByteAtRawAddress(rawAddr));