Skip to content

Commit b727425

Browse files
committed
Heap visualizer progress
1 parent f792274 commit b727425

File tree

10 files changed

+854
-111
lines changed

10 files changed

+854
-111
lines changed

Twilight/Properties/Settings.Designer.cs

Lines changed: 122 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Twilight.Properties" GeneratedClassName="Settings">
3+
<Profiles />
4+
<Settings>
5+
<Setting Name="ShowHeap0" Type="System.Boolean" Scope="User">
6+
<Value Profile="(Default)">False</Value>
7+
</Setting>
8+
<Setting Name="ShowHeap1" Type="System.Boolean" Scope="User">
9+
<Value Profile="(Default)">False</Value>
10+
</Setting>
11+
<Setting Name="ShowHeap2" Type="System.Boolean" Scope="User">
12+
<Value Profile="(Default)">True</Value>
13+
</Setting>
14+
<Setting Name="ShowHeap3" Type="System.Boolean" Scope="User">
15+
<Value Profile="(Default)">True</Value>
16+
</Setting>
17+
<Setting Name="ShowHeap4" Type="System.Boolean" Scope="User">
18+
<Value Profile="(Default)">True</Value>
19+
</Setting>
20+
<Setting Name="ShowHeap5" Type="System.Boolean" Scope="User">
21+
<Value Profile="(Default)">False</Value>
22+
</Setting>
23+
<Setting Name="ShowHeap6" Type="System.Boolean" Scope="User">
24+
<Value Profile="(Default)">False</Value>
25+
</Setting>
26+
<Setting Name="ShowHeap7" Type="System.Boolean" Scope="User">
27+
<Value Profile="(Default)">False</Value>
28+
</Setting>
29+
</Settings>
30+
</SettingsFile>

Twilight/Source/ActorReferenceCountVisualizer/ActorReferenceCountVisualizerViewModel.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,22 @@ private void RunUpdateLoop()
103103
{
104104
while (this.CanUpdate)
105105
{
106-
try
106+
if (this.IsVisible)
107107
{
108-
if (SessionManager.Session.OpenedProcess != null)
108+
try
109109
{
110-
Application.Current.Dispatcher.Invoke(() =>
110+
if (SessionManager.Session.OpenedProcess != null)
111111
{
112-
UpdateActorSlots();
113-
});
112+
Application.Current.Dispatcher.Invoke(() =>
113+
{
114+
UpdateActorSlots();
115+
});
116+
}
117+
}
118+
catch (Exception ex)
119+
{
120+
Logger.Log(LogLevel.Error, "Error updating the Heap Visualizer", ex);
114121
}
115-
}
116-
catch(Exception ex)
117-
{
118-
Logger.Log(LogLevel.Error, "Error updating the Heap Visualizer", ex);
119122
}
120123

121124
await Task.Delay(250);

Twilight/Source/HeapVisualizer/HeapCheck.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ public class HeapCheck
2424
[MarshalAs(UnmanagedType.I4)]
2525
public UInt32 maxTotalFreeSize;
2626

27-
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
28-
public Byte[] unknownBuffer;
27+
[MarshalAs(UnmanagedType.I4)]
28+
public UInt32 unknownPtr1;
29+
30+
[MarshalAs(UnmanagedType.I4)]
31+
public UInt32 unknownPtr2;
2932

3033
[MarshalAs(UnmanagedType.I4)]
3134
public UInt32 heapSize;
@@ -49,7 +52,8 @@ public static HeapCheck FromByteArray(byte[] bytes)
4952
result.heapPointer = BinaryPrimitives.ReverseEndianness(result.heapPointer);
5053
result.maxTotalUsedSize = BinaryPrimitives.ReverseEndianness(result.maxTotalUsedSize);
5154
result.maxTotalFreeSize = BinaryPrimitives.ReverseEndianness(result.maxTotalFreeSize);
52-
// result.unknownBuffer = BinaryPrimitives.ReverseEndianness(result.unknownBuffer);
55+
result.unknownPtr1 = BinaryPrimitives.ReverseEndianness(result.unknownPtr1);
56+
result.unknownPtr2 = BinaryPrimitives.ReverseEndianness(result.unknownPtr2);
5357
result.heapSize = BinaryPrimitives.ReverseEndianness(result.heapSize);
5458
result.usedCount = BinaryPrimitives.ReverseEndianness(result.usedCount);
5559
result.totalUsedSize = BinaryPrimitives.ReverseEndianness(result.totalUsedSize);

0 commit comments

Comments
 (0)