-
Notifications
You must be signed in to change notification settings - Fork 396
Expand file tree
/
Copy pathInt64Node.cs
More file actions
44 lines (38 loc) · 1.09 KB
/
Int64Node.cs
File metadata and controls
44 lines (38 loc) · 1.09 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
using System.Drawing;
using System.Globalization;
using ReClassNET.Controls;
using ReClassNET.Extensions;
using ReClassNET.Memory;
using ReClassNET.UI;
namespace ReClassNET.Nodes
{
public class Int64Node : BaseNumericNode
{
public override int MemorySize => 8;
public override void GetUserInterfaceInfo(out string name, out Image icon)
{
name = "Int64";
icon = Properties.Resources.B16x16_Button_Int_64;
}
public override Size Draw(DrawContext context, int x, int y)
{
var value = ReadValueFromMemory(context.Memory);
return DrawNumeric(context, x, y, context.IconProvider.Signed, "Int64", value.ToString(), $"0x{value:X}");
}
public override void Update(HotSpot spot)
{
base.Update(spot);
if (spot.Id == 0 || spot.Id == 1)
{
if (long.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && long.TryParse(hexValue, NumberStyles.HexNumber, null, out val))
{
spot.Process.WriteRemoteMemory(spot.Address, val);
}
}
}
public long ReadValueFromMemory(MemoryBuffer memory)
{
return memory.ReadInt64(Offset);
}
}
}