-
Notifications
You must be signed in to change notification settings - Fork 1
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
Can't extract the Guided Tour of Macintosh Plus #45
Comments
Here's
The folder's contents are supposed to include The catalog key's length is 23; that leaves 23 - 6 = 17 bytes for the filename, including the length byte. In fact, looking at that output, some of the other items are truncated similarly:
I was dubious about Seems like one thing that needs to happen is Anyway, going back to the alleged contents of this filename buffer: it should be noted, lldb is treating this as a Str31 and showing 32 bytes regardless of the actual length of the string, so it's actually overrunning the key structure. The 0x02, 0x00, 0x00, and 0x00 before the file type and creator look like So a couple more things we need to do here:
|
I added some escaping to the output of analyze (and extract). Here's the filename extract is tripping over:
It looks like the line that's failing is this one: NSURL *_Nonnull const fileURL = [realWorldURL URLByAppendingPathComponent:filename isDirectory:false];
(To be fair, a lot of POSIX APIs down the stack will choke on that \0 as well.) I still should verify somehow that impluse's interpretation of the catalog is correct. |
This is where the error comes from: FSRef parentRef, ref;
bool const gotParentRef = CFURLGetFSRef((__bridge CFURLRef)realWorldURL.URLByDeletingLastPathComponent, &parentRef);
if (! gotParentRef) {
NSError *_Nonnull const noParentError = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedString(@"Couldn't look up parent for destination path %@; check for typoes", @""), realWorldURL.path] }];
if (outError != NULL) {
*outError = noParentError;
}
return false;
} This isn't about catalog back-traversal at all. This is the rehydration method trying to figure out what directory to put the file in, and there isn't one because the URL it's supposed to rehydrate the file at was |
Mounting the disk in Mac OS 9 in SheepShaver and using AppleScript to list the contents of its System Folder, I find that Mac OS 9 also sees a file that AppleScript describes as So impluse is interpreting the catalog correctly. This filename really does contain a NUL character (and a control character). Which means we need to do something reasonable about that… |
If I Some tweaks to the converter confirm that the name is being copied across with an actual NUL character in it. The only other thing I could check is what the POSIX directory-traversal APIs (or the Cocoa ones layered on top) yield. |
Using an uncompressed copy of the “Guided Tour of Macintosh Plus”* image from “Phil and Dave's Excellent CD” volume 1:
The filename shown as empty above is this file as reported by
list
:^A being
less
's escaping of the\x01
byte at the end of that filename.I'm unsure whether this means the catalog is corrupt, impluse is misparsing it, or impluse is doing something else wrong.
The
(null)
s are also concerning. It could be that NSString is refusing to decode this filename.The text was updated successfully, but these errors were encountered: