File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public class MemoryBuffer
12
12
13
13
private byte [ ] data ;
14
14
private byte [ ] historyData ;
15
+ private bool hasHistory ;
15
16
16
17
public int Size
17
18
{
@@ -25,6 +26,8 @@ public int Size
25
26
{
26
27
data = new byte [ value ] ;
27
28
historyData = new byte [ value ] ;
29
+
30
+ hasHistory = false ;
28
31
}
29
32
}
30
33
}
@@ -55,6 +58,7 @@ public MemoryBuffer(MemoryBuffer other)
55
58
56
59
data = other . data ;
57
60
historyData = other . historyData ;
61
+ hasHistory = other . hasHistory ;
58
62
}
59
63
60
64
public MemoryBuffer Clone ( )
@@ -80,6 +84,8 @@ public void Update(IntPtr address, bool setHistory)
80
84
if ( setHistory )
81
85
{
82
86
Array . Copy ( data , historyData , data . Length ) ;
87
+
88
+ hasHistory = true ;
83
89
}
84
90
85
91
Process . ReadRemoteMemoryIntoBuffer ( address , ref data ) ;
@@ -254,6 +260,11 @@ public bool HasChanged(IntPtr offset, int length)
254
260
255
261
public bool HasChanged ( int offset , int length )
256
262
{
263
+ if ( hasHistory )
264
+ {
265
+ return false ;
266
+ }
267
+
257
268
if ( Offset + offset + length > data . Length )
258
269
{
259
270
return false ;
You can’t perform that action at this time.
0 commit comments