mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +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>
|
||||
public static void DumpMemory(IntPtr offset, int len = 512)
|
||||
{
|
||||
var data = new byte[len];
|
||||
Marshal.Copy(offset, data, 0, len);
|
||||
Log.Information(ByteArrayToHex(data));
|
||||
try
|
||||
{
|
||||
SafeMemory.ReadBytes(offset, len, out var data);
|
||||
Log.Information(ByteArrayToHex(data));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "Read failed");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue