mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
fix: use SafeMemory for Util.DumpMemory
This commit is contained in:
parent
7d30a60a5e
commit
44551d43ae
1 changed files with 9 additions and 3 deletions
|
|
@ -50,9 +50,15 @@ namespace Dalamud
|
||||||
/// <param name="len">The length to read.</param>
|
/// <param name="len">The length to read.</param>
|
||||||
public static void DumpMemory(IntPtr offset, int len = 512)
|
public static void DumpMemory(IntPtr offset, int len = 512)
|
||||||
{
|
{
|
||||||
var data = new byte[len];
|
try
|
||||||
Marshal.Copy(offset, data, 0, len);
|
{
|
||||||
Log.Information(ByteArrayToHex(data));
|
SafeMemory.ReadBytes(offset, len, out var data);
|
||||||
|
Log.Information(ByteArrayToHex(data));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Error(ex, "Read failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue