Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix commands like ipsw class-dump to work on older macOS versions #577

Open
2 tasks done
rgoldberg opened this issue Oct 11, 2024 · 1 comment
Open
2 tasks done
Assignees
Labels
bug Something isn't working triage

Comments

@rgoldberg
Copy link

What happened?

On macOS 12.7.6, commands like:

ipsw class-dump /System/Library/dyld/dyld_shared_cache_arm64e 'CommerceKit' --headers --output /tmp/CommerceKit_HDRS

output headers with incorrect symbol names. e.g., /tmp/CommerceKit_HDRS/CommerceKit/CKBag.h is:

//
//   Generated by https://github.com/blacktop/ipsw (Version: 3.1.549, BuildCommit: Homebrew)
//
//    - LC_BUILD_VERSION:  Platform: macOS, MinOS: 12.7, SDK: 12.7, Tools: [ld (756.90), ld (760)]
//    - LC_SOURCE_VERSION: 712.6.1.0.0
//
#ifndef CKBag_h
#define CKBag_h
@import Foundation;

#include "CKStoreClient.h"

@interface CKBag : NSObject

@property (readonly, nonatomic) CKStoreClient *storeClient;

/* class methods */
+ (id)itiveIntegerBuilder;
+ (id)ateLearningAnalytics17GroundTruthRecord;
+ (id)entifier;
+ (id)Array",R,C,N,V_strokeIdentifiers;
+ (id)s;

/* instance methods */
- (_Bool)CKDPRecordRetrieveChangesResponseRecordChange;
- (void)nURLRequestWrapperOperation;
- (id)rsonaPersistenceLayoutManager;
- (id)itiveIntegerBuilder;
- (id)ateLearningAnalytics17GroundTruthRecord;
- (id)BetweenRefreshes;
- (id)er",&,V_authenticationPluginManager;
- (id)_OSLogEventStoreTimeRef",R,N,V_oldestSignpost;
- (_Bool)rokeGroupType;
- (_Bool)T@"NSLocale",R,C,N,V_preferredLocale;
- (_Bool)edLocale;
- (id)ovider;
- (id)dentifierFromData:(id /* block */)data;
- (void)r:(id)r;
- (void)trokeIdentifier;

@end

#endif /* CKBag_h */

Please fix this command, and all other related commands, for as many latest versions of each macOS major version as possible.

How can we reproduce this?

Run the above command on macOS 12.7.6. Try it on some other macOS versions, too.

ipsw version

Version: 3.1.549, BuildCommit: Homebrew

Search

  • I did search for other open and closed issues before opening this

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

See #563

@rgoldberg rgoldberg added bug Something isn't working triage labels Oct 11, 2024
@rgoldberg rgoldberg changed the title Make commands like ipsw class-dump work on older macOS versions Fix commands like ipsw class-dump to work on older macOS versions Oct 12, 2024
@rgoldberg
Copy link
Author

@blacktop Does the following info help with any investigation into fixing the headers extracted from the DSC on macOS 12 (& presumably older versions)?

I extracted all headers from the DSC for the current latest macOS 12, 13, 14 & 15 versions (the older 2 versions ran on Intel, the newer 2 versions ran on Apple Silicon).

In one example file (SSPurchase.h; the attached zip file has an extracted copy for each of the 4 aforementioned macOS versions), ignoring the boilerplate comments at the beginning:

  • The 14 & 15 files were the same.
  • The 13 file was the same as the 14 & 15 files, except that it used signed char while 14 & 15 used _Bool.
  • The 12 file was the same as the 13 file, except that its /* class methods */ & /* instance methods */ sections were incorrect.

macOS 12.7.6 (build 21H1320) x86_64h

ipsw class-dump /System/Library/dyld/dyld_shared_cache_x86_64h --all --headers --output /tmp/headers

macOS 13.7.2 (build 22H313) x86_64h

ipsw class-dump /System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64h --all --headers --output /tmp/headers

macOS 14.7.2 (build 23H311) arm64e & macOS 15.2 (build 24C101) arm64e

ipsw class-dump /System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_arm64e --all --headers --output /tmp/headers

Zip of header extracted for StoreFoundation/SSPurchase.h for each of the 4 macOS versions

SSPurchase.zip

Thanks for any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants