1
1
using System ;
2
2
using System . Drawing ;
3
+ using System . Globalization ;
3
4
using ReClassNET . Memory ;
4
5
using ReClassNET . UI ;
6
+ using ReClassNET . Util ;
5
7
6
8
namespace ReClassNET . Nodes
7
9
{
@@ -46,6 +48,11 @@ public override Size Draw(ViewInfo view, int x, int y)
46
48
x = AddText ( view , x , y , view . Settings . ValueColor , HotSpot . NoneId , $ "<{ InnerNode . Name } >") + view . Font . Width ;
47
49
x = AddIcon ( view , x , y , Icons . Change , 4 , HotSpotType . ChangeType ) + view . Font . Width ;
48
50
51
+ var ptr = view . Memory . ReadIntPtr ( Offset ) ;
52
+
53
+ x = AddText ( view , x , y , view . Settings . OffsetColor , HotSpot . NoneId , "->" ) + view . Font . Width ;
54
+ x = AddText ( view , x , y , view . Settings . ValueColor , 0 , "0x" + ptr . ToString ( Constants . AddressHexFormat ) ) + view . Font . Width ;
55
+
49
56
x = AddComment ( view , x , y ) ;
50
57
51
58
AddTypeDrop ( view , y ) ;
@@ -57,8 +64,6 @@ public override Size Draw(ViewInfo view, int x, int y)
57
64
58
65
if ( levelsOpen [ view . Level ] )
59
66
{
60
- var ptr = view . Memory . ReadIntPtr ( Offset ) ;
61
-
62
67
memory . Size = InnerNode . MemorySize ;
63
68
memory . Process = view . Memory . Process ;
64
69
memory . Update ( ptr ) ;
@@ -90,5 +95,24 @@ public override int CalculateDrawnHeight(ViewInfo view)
90
95
}
91
96
return height ;
92
97
}
98
+
99
+ public override void Update ( HotSpot spot )
100
+ {
101
+ base . Update ( spot ) ;
102
+
103
+ if ( spot . Id == 0 )
104
+ {
105
+ if ( spot . Text . TryGetHexString ( out var hexValue ) && long . TryParse ( hexValue , NumberStyles . HexNumber , null , out var val ) )
106
+ {
107
+ #if RECLASSNET64
108
+ var address = ( IntPtr ) val ;
109
+ #else
110
+ var address = ( IntPtr ) unchecked ( ( int ) val ) ;
111
+ #endif
112
+
113
+ spot . Memory . Process . WriteRemoteMemory ( spot . Address , address ) ;
114
+ }
115
+ }
116
+ }
93
117
}
94
118
}
0 commit comments