@@ -67,6 +67,44 @@ public override void Terminate()
6767 class FrostBiteNodeInfoReader : INodeInfoReader
6868 {
6969 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 )
70108 {
71109 var getTypeFnPtr = memory . Process . ReadRemoteObject < IntPtr > ( value ) ;
72110 if ( getTypeFnPtr . MayBeValid ( ) )
@@ -85,7 +123,11 @@ public string ReadNodeInfo(BaseNode node, IntPtr value, MemoryBuffer memory)
85123 var namePtr = memory . Process . ReadRemoteObject < IntPtr > ( typeInfoDataPtr ) ;
86124 if ( namePtr . MayBeValid ( ) )
87125 {
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+ }
89131 }
90132 }
91133 }
0 commit comments