Advertisement
bottomy

Untitled

Apr 23rd, 2012
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #import <Foundation/Foundation.h>
  2.  
  3. extern CFTypeRef _CFKeyedArchiverUIDCreate(CFAllocatorRef, uint32_t);
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7.     @autoreleasepool {
  8.         CFPropertyListRef Nib1 = CFPropertyListCreateWithData(kCFAllocatorDefault, (CFDataRef)[NSData dataWithContentsOfFile: @"/PROJECT_PATH_HERE/OSXPatchMe V2.app/Contents/Resources/en.lproj/MainMenu.nib"], kCFPropertyListMutableContainersAndLeaves, NULL, NULL);
  9.        
  10.         NSMutableArray *Objects = [(NSMutableDictionary*)Nib1 objectForKey: @"$objects"];
  11.        
  12.         NSUInteger Index = [Objects count];
  13.        
  14.         [Objects addObject: [NSDictionary dictionaryWithObjectsAndKeys: [NSArray arrayWithObjects: @"NSNibControlConnector", @"NSNibConnector", @"NSObject", nil], @"$classes", @"NSNibControlConnector", @"$classname", nil]]; //34 = Index
  15.        
  16.         [Objects addObject: [NSDictionary dictionaryWithObjectsAndKeys: [NSArray arrayWithObjects: @"NSCustomObject", @"NSObject", nil], @"$classes", @"NSCustomObject", @"$classname", nil]]; //4 = Index + 1
  17.        
  18.         [Objects addObject: @"AppDelegate"]; //32 = Index + 2
  19.        
  20.         CFTypeRef ClassKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index + 1), ClassNameKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index + 2);
  21.         [Objects addObject: [NSDictionary dictionaryWithObjectsAndKeys: ClassKAUID, @"$class", ClassNameKAUID, @"NSClassName", nil]]; //6 and 31 = Index + 3
  22.         CFRelease(ClassKAUID);
  23.         CFRelease(ClassNameKAUID);
  24.        
  25.        
  26.        
  27.        
  28.         ClassKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index);
  29.         CFTypeRef DestinationKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index + 3), LabelKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, 33/*Index + 6*/), SourceKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, 12);
  30.         [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
  31.         CFRelease(ClassKAUID);
  32.         CFRelease(DestinationKAUID);
  33.         CFRelease(LabelKAUID);
  34.         CFRelease(SourceKAUID);
  35.        
  36.        
  37.         CFTypeRef ObjectKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index + 4);
  38.         [[[Objects objectAtIndex: 29] objectForKey: @"NS.objects"] addObject: ObjectKAUID];
  39.         [[[Objects objectAtIndex: 69] objectForKey: @"NS.objects"] addObject: ObjectKAUID];
  40.         CFRelease(ObjectKAUID);
  41.        
  42.        
  43.         [Objects addObject: [NSNumber numberWithInteger: 556]];
  44.         ObjectKAUID = _CFKeyedArchiverUIDCreate(kCFAllocatorDefault, Index + 5);
  45.         [[[Objects objectAtIndex: 70] objectForKey: @"NS.objects"] addObject: ObjectKAUID];
  46.         CFRelease(ObjectKAUID);
  47.        
  48.        
  49.        
  50.         //[Objects addObject: @"pushed:"]; //38 = Index + 6
  51.         /*
  52.          For actual challenge remove this "pushed:" and change the destination to some other
  53.          value. So they have to add pushed: and change the destination value.
  54.          */
  55.        
  56.        
  57.        
  58.         [[(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];
  59.        
  60.         CFRelease(Nib1);
  61.     }
  62.    
  63.     return 0;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement