-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathTArrayNode.cs
More file actions
60 lines (48 loc) · 1.37 KB
/
TArrayNode.cs
File metadata and controls
60 lines (48 loc) · 1.37 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
using System;
using System.Drawing;
using ReClassNET.Controls;
using ReClassNET.Extensions;
using ReClassNET.Memory;
using ReClassNET.Nodes;
namespace UnrealEngineClassesPlugin.Nodes
{
public class TArrayNode : BaseWrapperArrayNode
{
private readonly MemoryBuffer memory = new MemoryBuffer();
public override int MemorySize => IntPtr.Size + sizeof(int) * 2;
protected override bool PerformCycleCheck => false;
public TArrayNode()
{
IsReadOnly = true;
}
public override void GetUserInterfaceInfo(out string name, out Image icon)
{
name = "TArray";
icon = null;
}
public override void Initialize()
{
var node = IntPtr.Size == 4 ? (BaseNode)new Hex32Node() : new Hex64Node();
ChangeInnerNode(node);
}
public override Size Draw(DrawContext context, int x, int y)
{
Count = context.Memory.ReadInt32(Offset + IntPtr.Size);
return Draw(context, x, y, "TArray");
}
protected override Size DrawChild(DrawContext context, int x, int y)
{
var ptr = context.Memory.ReadIntPtr(Offset);
if (!ptr.IsNull())
{
ptr = context.Process.ReadRemoteIntPtr(ptr + CurrentIndex * IntPtr.Size);
}
memory.Size = InnerNode.MemorySize;
memory.UpdateFrom(context.Process, ptr);
var innerContext = context.Clone();
innerContext.Address = ptr;
innerContext.Memory = memory;
return InnerNode.Draw(innerContext, x, y);
}
}
}