@@ -67,6 +67,44 @@ public override void Terminate()
67
67
class FrostBiteNodeInfoReader : INodeInfoReader
68
68
{
69
69
public string ReadNodeInfo ( BaseNode node , IntPtr value , MemoryBuffer memory )
70
+ {
71
+ // 1. try the direct value
72
+ var info = ReadPtrInfo ( value , memory ) ;
73
+ if ( ! string . IsNullOrEmpty ( info ) )
74
+ {
75
+ return info ;
76
+ }
77
+
78
+ // 2. try indirect pointer
79
+ var indirectPtr = memory . Process . ReadRemoteObject < IntPtr > ( value ) ;
80
+ if ( indirectPtr . MayBeValid ( ) )
81
+ {
82
+ info = ReadPtrInfo ( indirectPtr , memory ) ;
83
+ if ( ! string . IsNullOrEmpty ( info ) )
84
+ {
85
+ return $ "Ptr -> { info } ";
86
+ }
87
+
88
+ // 3. try weak pointer
89
+ var weakTempPtr = indirectPtr - IntPtr . Size ;
90
+ if ( weakTempPtr . MayBeValid ( ) )
91
+ {
92
+ var weakPtr = memory . Process . ReadRemoteObject < IntPtr > ( weakTempPtr ) ;
93
+ if ( weakPtr . MayBeValid ( ) )
94
+ {
95
+ info = ReadPtrInfo ( weakPtr , memory ) ;
96
+ if ( ! string . IsNullOrEmpty ( info ) )
97
+ {
98
+ return $ "WeakPtr -> { info } ";
99
+ }
100
+ }
101
+ }
102
+ }
103
+
104
+ return null ;
105
+ }
106
+
107
+ private string ReadPtrInfo ( IntPtr value , MemoryBuffer memory )
70
108
{
71
109
var getTypeFnPtr = memory . Process . ReadRemoteObject < IntPtr > ( value ) ;
72
110
if ( getTypeFnPtr . MayBeValid ( ) )
@@ -85,7 +123,11 @@ public string ReadNodeInfo(BaseNode node, IntPtr value, MemoryBuffer memory)
85
123
var namePtr = memory . Process . ReadRemoteObject < IntPtr > ( typeInfoDataPtr ) ;
86
124
if ( namePtr . MayBeValid ( ) )
87
125
{
88
- return memory . Process . ReadRemoteString ( Encoding . UTF8 , namePtr , 64 ) ;
126
+ var info = memory . Process . ReadRemoteUTF8StringUntilFirstNullCharacter ( namePtr , 64 ) ;
127
+ if ( info . Length > 0 && info [ 0 ] . IsPrintable ( ) )
128
+ {
129
+ return info ;
130
+ }
89
131
}
90
132
}
91
133
}
0 commit comments