Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import <Foundation/Foundation.h>
- extern CFTypeRef _CFKeyedArchiverUIDCreate(CFAllocatorRef, uint32_t);
- int main(int argc, char *argv[])
- {
- @autoreleasepool {
- CFPropertyListRef Nib1 = CFPropertyListCreateWithData(kCFAllocatorDefault, (CFDataRef)[NSData dataWithContentsOfFile: @"/PROJECT_PATH_HERE/OSXPatchMe V2.app/Contents/Resources/en.lproj/MainMenu.nib"], kCFPropertyListMutableContainersAndLeaves, NULL, NULL);
- NSMutableArray *Objects = [(NSMutableDictionary*)Nib1 objectForKey: @"$objects"];
- NSUInteger Index = [Objects count];
- [Objects addObject: [NSDictionary dictionaryWithObjectsAndKeys: [NSArray arrayWithObjects: @"NSNibControlConnector", @"NSNibConnector", @"NSObject", nil], @"$classes", @"NSNibControlConnector", @"$classname", nil]]; //34 = Index
- [Objects addObject: [NSDictionary dictionaryWithObjectsAndKeys: [NSArray arrayWithObjects: @"NSCustomObject", @"NSObject", nil], @"$classes", @"NSCustomObject", @"$classname", nil]]; //4 = Index + 1
- [Objects addObject: @"AppDelegate"]; //32 = Index + 2
- CFTypeRef ClassKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index + 1), ClassNameKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index + 2);
- [Objects addObject: [NSDictionary dictionaryWithObjectsAndKeys: ClassKAUID, @"$class", ClassNameKAUID, @"NSClassName", nil]]; //6 and 31 = Index + 3
- CFRelease(ClassKAUID);
- CFRelease(ClassNameKAUID);
- ClassKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index);
- CFTypeRef DestinationKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index + 3), LabelKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, 33/*Index + 6*/), SourceKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, 12);
- [Objects addObject: [NSDictionary dictionaryWithObjectsAndKeys: ClassKAUID, @"$class", DestinationKAUID, @"NSDestination", @"Fix this dictionary's NSLabel. May need to add extra data to $objects. Good Luck :)", @"FIX ME", LabelKAUID, @"NSLabel", SourceKAUID, @"NSSource", nil]]; //Index + 4
- CFRelease(ClassKAUID);
- CFRelease(DestinationKAUID);
- CFRelease(LabelKAUID);
- CFRelease(SourceKAUID);
- CFTypeRef ObjectKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index + 4);
- [[[Objects objectAtIndex: 29] objectForKey: @"NS.objects"] addObject: ObjectKAUID];
- [[[Objects objectAtIndex: 69] objectForKey: @"NS.objects"] addObject: ObjectKAUID];
- CFRelease(ObjectKAUID);
- [Objects addObject: [NSNumber numberWithInteger: 556]];
- ObjectKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index + 5);
- [[[Objects objectAtIndex: 70] objectForKey: @"NS.objects"] addObject: ObjectKAUID];
- CFRelease(ObjectKAUID);
- //[Objects addObject: @"pushed:"]; //38 = Index + 6
- /*
- For actual challenge remove this "pushed:" and change the destination to some other
- value. So they have to add pushed: and change the destination value.
- */
- [[(NSData*)CFPropertyListCreateData(kCFAllocatorDefault, Nib1, kCFPropertyListBinaryFormat_v1_0, 0, NULL) autorelease] writeToFile: @"/PROJECT_PATH_HERE/OSXPatchMe V2.app/Contents/Resources/en.lproj/MainMenu.nib" atomically: NO];
- CFRelease(Nib1);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement