File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -182,12 +182,26 @@ private void ReadSymbolTable()
182
182
{
183
183
LibLogger . Verbose ( $ "\t Reading NSO symbol table...") ;
184
184
185
- var hash = GetDynamicEntry ( ElfDynamicType . DT_HASH ) ?? throw new ( "No hash table found in NSO" ) ;
185
+ var hash = GetDynamicEntry ( ElfDynamicType . DT_HASH ) ;
186
+
187
+ if ( hash == null )
188
+ {
189
+ LibLogger . WarnNewline ( "\t No DT_HASH found in NSO, symbols will not be resolved" ) ;
190
+ return ;
191
+ }
192
+
186
193
Position = MapVirtualAddressToRaw ( hash . Value ) ;
187
194
ReadUInt32 ( ) ; //Ignored
188
195
var symbolCount = ReadUInt32 ( ) ;
189
196
190
- var symTab = GetDynamicEntry ( ElfDynamicType . DT_SYMTAB ) ?? throw new ( "No symbol table found in NSO" ) ;
197
+ var symTab = GetDynamicEntry ( ElfDynamicType . DT_SYMTAB ) ;
198
+
199
+ if ( symTab == null )
200
+ {
201
+ LibLogger . WarnNewline ( "\t No DT_SYMTAB found in NSO, symbols will not be resolved" ) ;
202
+ return ;
203
+ }
204
+
191
205
_symbolTable = ReadReadableArrayAtVirtualAddress < ElfDynamicSymbol64 > ( ( ulong ) MapVirtualAddressToRaw ( symTab . Value ) , symbolCount ) ;
192
206
193
207
LibLogger . VerboseNewline ( $ "Got { _symbolTable . Length } symbols") ;
@@ -375,4 +389,4 @@ public override ulong GetVirtualAddressOfPrimaryExecutableSection()
375
389
return _header . TextSegment . MemoryOffset ;
376
390
}
377
391
}
378
- }
392
+ }
You can’t perform that action at this time.
0 commit comments