From 177f9f9f90b4be6bc28dc1eed21e15c34adfc396 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sun, 17 Jul 2022 22:51:50 +0200 Subject: [PATCH] chore: throw when address is negative --- Dalamud/Hooking/Internal/HookManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dalamud/Hooking/Internal/HookManager.cs b/Dalamud/Hooking/Internal/HookManager.cs index b87ab1796..51047b97e 100644 --- a/Dalamud/Hooking/Internal/HookManager.cs +++ b/Dalamud/Hooking/Internal/HookManager.cs @@ -68,6 +68,9 @@ namespace Dalamud.Hooking.Internal return address; } + if (address.ToInt64() <= 0) + throw new InvalidOperationException($"Address was <= 0, this can't be happening?! ({address:X})"); + var bytes = MemoryHelper.ReadRaw(address, 8); var codeReader = new ByteArrayCodeReader(bytes);