File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public class MemoryBuffer
1212
1313 private byte [ ] data ;
1414 private byte [ ] historyData ;
15+ private bool hasHistory ;
1516
1617 public int Size
1718 {
@@ -25,6 +26,8 @@ public int Size
2526 {
2627 data = new byte [ value ] ;
2728 historyData = new byte [ value ] ;
29+
30+ hasHistory = false ;
2831 }
2932 }
3033 }
@@ -55,6 +58,7 @@ public MemoryBuffer(MemoryBuffer other)
5558
5659 data = other . data ;
5760 historyData = other . historyData ;
61+ hasHistory = other . hasHistory ;
5862 }
5963
6064 public MemoryBuffer Clone ( )
@@ -80,6 +84,8 @@ public void Update(IntPtr address, bool setHistory)
8084 if ( setHistory )
8185 {
8286 Array . Copy ( data , historyData , data . Length ) ;
87+
88+ hasHistory = true ;
8389 }
8490
8591 Process . ReadRemoteMemoryIntoBuffer ( address , ref data ) ;
@@ -254,6 +260,11 @@ public bool HasChanged(IntPtr offset, int length)
254260
255261 public bool HasChanged ( int offset , int length )
256262 {
263+ if ( hasHistory )
264+ {
265+ return false ;
266+ }
267+
257268 if ( Offset + offset + length > data . Length )
258269 {
259270 return false ;
You can’t perform that action at this time.
0 commit comments