chore: throw when address is negative

This commit is contained in:
goat 2022-07-17 22:51:50 +02:00
parent 264adf6ee7
commit 177f9f9f90
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5

View file

@ -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);