You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// search by iteration. Doesn't work on iOSModule.enumerateSymbols('libxpc.dylib',{onMatch(symbol){if(symbol.name=='_xpc_connection_call_event_handler'){console.log(symbol.address);return'stop';}},onError(){console.error('error');},onComplete(){console.log('complete');}})// This worksconsole.log(DebugSymbol.getFunctionByName('_xpc_connection_call_event_handler'))// on macOS, they both work, but the second approach is slower
So this function reads LC_SYMTAB from mach header, and parses nlist to get symbols:
However, many symbols are stored locally in dyld_shared_cache (or more recent versions, they are moved to .symbols file)
structdyld_cache_header
{
charmagic[16]; // e.g. "dyld_v0 i386"// ...uint64_tlocalSymbolsOffset; // file offset of where local symbols are storeduint64_tlocalSymbolsSize; // size of local symbols informationuint8_tuuid[16]; // unique value for each shared cache file
};
Test case
So this function reads
LC_SYMTAB
from mach header, and parses nlist to get symbols:frida-gum/gum/gumdarwinmodule.c
Line 781 in 097dd41
However, many symbols are stored locally in dyld_shared_cache (or more recent versions, they are moved to
.symbols
file)Here are some references:
https://github.com/jmpews/Dobby/blob/b0176de574104726bb68dff3b77ee666300fc338/builtin-plugin/SymbolResolver/macho/shared_cache_ctx.cpp#L46
https://github.com/blacktop/ipsw/blob/f03db0abba66f0af93d55344b791f57fde39db42/pkg/dyld/image.go#L795
The text was updated successfully, but these errors were encountered: