arandomdev / DyldExtractor

Extract Binaries from Apple's Dyld Shared Cache
MIT License
404 stars 40 forks source link

Extraction from iOS 17 beta image fails #55

Closed frankschlegel closed 1 year ago

frankschlegel commented 1 year ago

Extraction from dyld_shared_cache fails from iOS 17.0b1 image (tested with iPhone 14 Pro Max recovery image):

dyldex -e Metal.framework/Metal dyld_shared_cache_arm64e

Extracting /System/Library/Frameworks/Metal.framework/Metal ObjC Fixer >> Processing Classes :: [|] 12:20:36:946 [ ERROR ] objc_fixer.py:1223 : Small method list at 0x186964e81, has an entsize that doesn't match the size of objc_method_small_t Traceback (most recent call last): File ".venv/bin/dyldex", line 277, in main() File ".venv/bin/dyldex", line 272, in main _extractImage(args.dyld_path, dyldCtx, imageMap[targetPaths[0]], outputPath) File ".venv/bin/dyldex", line 138, in _extractImage objc_fixer.fixObjC(extractionCtx) File ".venv/lib/python3.11/site-packages/DyldExtractor/converter/objc_fixer.py", line 1519, in fixObjC _ObjCFixer(extractionCtx).run() File ".venv/lib/python3.11/site-packages/DyldExtractor/converter/objc_fixer.py", line 447, in run self._processSections() File ".venv/lib/python3.11/site-packages/DyldExtractor/converter/objc_fixer.py", line 634, in _processSections if self._processClass(classAddr)[1]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/DyldExtractor/converter/objc_fixer.py", line 850, in _processClass classDef.isa, needsFutureIsa = self._processClass(classDef.isa) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/DyldExtractor/converter/objc_fixer.py", line 850, in _processClass classDef.isa, needsFutureIsa = self._processClass(classDef.isa) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/DyldExtractor/converter/objc_fixer.py", line 855, in _processClass classDef.superclass, needsFutureSuper = self._processClass( ^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/DyldExtractor/converter/objc_fixer.py", line 867, in _processClass classDef.data = self._processClassData( ^^^^^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/DyldExtractor/converter/objc_fixer.py", line 929, in _processClassData classDataDef.baseProtocols = self._processProtocolList( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/DyldExtractor/converter/objc_fixer.py", line 1034, in _processProtocolList newProtoAddr = self._processProtocol(protoAddr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/DyldExtractor/converter/objc_fixer.py", line 1058, in _processProtocol protoDef = self._slider.slideStruct(protoAddr, objc_protocol_t) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/DyldExtractor/converter/slide_info.py", line 412, in slideStruct structOff, context = self._dyldCtx.convertAddr(address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/DyldExtractor/cache_context.py", line 34, in convertAddr if vmaddr >= lowBound and vmaddr < highBound: ^^^^^^^^^^^^^^^^^^ TypeError: '>=' not supported between instances of 'NoneType' and 'int'

arandomdev commented 1 year ago

Thank you for bring this to my attention. I'll try to investigate when I'm able to.

arandomdev commented 1 year ago

Ok, I believe this is fixed with d12b5a6.

frankschlegel commented 1 year ago

Works perfectly now, thanks!

codan1 commented 1 year ago

Still happens to me on iOS 17 beta 6

frankschlegel commented 1 year ago

Still happens to me on iOS 17 beta 6

It just worked for me for beta 7 using the latest version on master.

codan1 commented 1 year ago

@frankschlegel For some it work perfectly, but for some frameworks it is still broken. Try JavaScriptCore.framework/JavaScriptCore for example

@arandomdev Can you please take a look?

arandomdev commented 1 year ago

I can take a look, but I need more info.

codan1 commented 1 year ago

Nevermind, it seems like it didn't update properly, it works perfectly now. Thanks!