DyldExtractor icon indicating copy to clipboard operation
DyldExtractor copied to clipboard

DyldContext attempts to open .symbols file without checks.

Open santalvarez opened this issue 3 years ago • 5 comments

Hi, Im on macOS 12 (Monterey) and I am getting an error when trying to extract the cache.

FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/dyld/dyld_shared_cache_x86_64.symbols'

The file shown in the error does indeed not exist, does this mean DyldExtractor doesn't work in macOS 12?

santalvarez avatar Aug 27 '22 23:08 santalvarez

DyldExtractor does not support x86_64 caches, but the error that is shown should have not happened. If possible, can you send me a file with the first 512 bytes of the main cache, /System/Library/dyld/dyld_shared_cache_x86_64. You can use the following command, dd count=1 if=INPUT_FILE of=OUTPUT_FILE.

arandomdev avatar Aug 28 '22 13:08 arandomdev

Yeah, here you go dyld_shared_cache_x86_64.zip

santalvarez avatar Aug 28 '22 14:08 santalvarez

Okay, I added a small check with 934b17d. As for x86_64 support, DyldExtractorC will support it, but development is going really slow unfortunately.

arandomdev avatar Aug 28 '22 15:08 arandomdev

Nice, thank you. I tried it and I am getting this error for every lib, even in arm64e.

Processed: libsystem_info.dylib
----- libsystem_info.dylib -----
12:19:02:511 [  ERROR  ] dyldex_all:184 : 'NoneType' object has no attribute 'header'
Traceback (most recent call last):
  File "/usr/local/bin/dyldex_all", line 159, in _extractImage
    linkedit_optimizer.optimizeLinkedit(extractionCtx)
  File "/usr/local/lib/python3.9/site-packages/DyldExtractor/converter/linkedit_optimizer.py", line 600, in optimizeLinkedit
    optimizer.copyLocalSymbols(newLinkedit)
  File "/usr/local/lib/python3.9/site-packages/DyldExtractor/converter/linkedit_optimizer.py", line 270, in copyLocalSymbols
    if symbolsCache.header.localSymbolsOffset == 0:
AttributeError: 'NoneType' object has no attribute 'header'
--------------------

santalvarez avatar Aug 28 '22 15:08 santalvarez

Hmm I probably should have done more testing, can you send me a download link for your cache files so I can look deeper into the issue?

arandomdev avatar Aug 28 '22 15:08 arandomdev

Also seeing this for an x86_64h cache

torarnv avatar Dec 18 '22 22:12 torarnv

If possible can you send me your cache files? It would very helpful.

arandomdev avatar Dec 20 '22 03:12 arandomdev

Do you have an email I can reach you on?

torarnv avatar Dec 20 '22 09:12 torarnv

Yep, [email protected]

arandomdev avatar Dec 20 '22 13:12 arandomdev

I added another check with 7a559b60a141323da11ce6d94e1ab1445b0d1a17 and that seems to fix this issue, but x86_64h still fails in ObjC Fixer.

arandomdev avatar Dec 20 '22 20:12 arandomdev