diff --git a/Il2CppInterop.Common/XrefScans/XrefScanUtilFinder.cs b/Il2CppInterop.Common/XrefScans/XrefScanUtilFinder.cs index 319a5a2e..4e4d1424 100644 --- a/Il2CppInterop.Common/XrefScans/XrefScanUtilFinder.cs +++ b/Il2CppInterop.Common/XrefScans/XrefScanUtilFinder.cs @@ -34,7 +34,7 @@ public static IntPtr FindLastRcxReadAddressBeforeCallTo(IntPtr codeStart, IntPtr if (instruction.Op0Kind == OpKind.Register && instruction.Op0Register == Register.ECX && instruction.Op1Kind == OpKind.Memory && instruction.IsIPRelativeMemoryOperand) { - var movTarget = (IntPtr)instruction.IPRelativeMemoryAddress; + var movTarget = unchecked((IntPtr)instruction.IPRelativeMemoryAddress); if (instruction.MemorySize != MemorySize.UInt32 && instruction.MemorySize != MemorySize.Int32) continue; @@ -72,7 +72,7 @@ public static IntPtr FindByteWriteTargetRightAfterCallTo(IntPtr codeStart, IntPt if (instruction.Mnemonic == Mnemonic.Mov && seenCall) if (instruction.Op0Kind == OpKind.Memory && (instruction.MemorySize == MemorySize.Int8 || instruction.MemorySize == MemorySize.UInt8)) - return (IntPtr)instruction.IPRelativeMemoryAddress; + return unchecked((IntPtr)instruction.IPRelativeMemoryAddress); } }