-
Notifications
You must be signed in to change notification settings - Fork 396
Expand file tree
/
Copy pathHex64Node.cs
More file actions
62 lines (48 loc) · 1.62 KB
/
Hex64Node.cs
File metadata and controls
62 lines (48 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Drawing;
using ReClassNET.Controls;
using ReClassNET.Memory;
using ReClassNET.UI;
namespace ReClassNET.Nodes
{
public class Hex64Node : BaseHexCommentNode
{
public override int MemorySize => 8;
public override void GetUserInterfaceInfo(out string name, out Image icon)
{
name = "Hex64";
icon = Properties.Resources.B16x16_Button_Hex_64;
}
public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address)
{
var value = ReadFromBuffer(spot.Memory, Offset);
address = value.IntPtr;
return spot.Process.GetSectionToPointer(value.IntPtr) != null;
}
public override string GetToolTipText(HotSpot spot)
{
var value = ReadFromBuffer(spot.Memory, Offset);
return $"Int64: {value.LongValue}\nUInt64: 0x{value.ULongValue:X016}\nFloat: {value.FloatValue:0.000}\nDouble: {value.DoubleValue:0.000}";
}
public override Size Draw(DrawContext context, int x, int y)
{
return Draw(context, x, y, context.Settings.ShowNodeText ? context.Memory.ReadString(context.Settings.RawDataEncoding, Offset, 8) + " " : null, 8);
}
public override void Update(HotSpot spot)
{
Update(spot, 8);
}
protected override int AddComment(DrawContext context, int x, int y)
{
x = base.AddComment(context, x, y);
var value = ReadFromBuffer(context.Memory, Offset);
x = AddComment(context, x, y, value.FloatValue, value.IntPtr, value.UIntPtr);
return x;
}
private static UInt64FloatDoubleData ReadFromBuffer(MemoryBuffer memory, int offset) => new UInt64FloatDoubleData
{
Raw1 = memory.ReadInt32(offset),
Raw2 = memory.ReadInt32(offset + sizeof(int))
};
}
}