-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathpwnHelper.m
74 lines (52 loc) · 1.77 KB
/
pwnHelper.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// nitoFlowHelper.m
// Seas0nPass
//
// Created by Kevin Bradley on 2/20/07.
// Copyright 2007 nito, LLC. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "pwnHelperClass.h"
#import "FWBundle.h"
#import "TSSManager.h"
#include <Security/Authorization.h>
#include <Security/AuthorizationTags.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSRunLoop *rl = [NSRunLoop currentRunLoop];
if (argc < 2){
}
int i;
for (i = 1; i < (argc - 1); i+= 2){
NSString *path = [NSString stringWithUTF8String:argv[0]];
//NSString *option = [NSString stringWithUTF8String:argv[i]];
NSString *value = [NSString stringWithUTF8String:argv[i+1]]; //plist location
//[phc sendCommand:value];
NSDictionary *pDict = [NSDictionary dictionaryWithContentsOfFile:value];
NSArray *keys = [pDict allKeys];
if ([keys containsObject:@"bundle"]) //we are processing fw bundle
{
pwnHelperClass *phc = [[pwnHelperClass alloc] init];
FWBundle *cBundle = (FWBundle *)[FWBundle bundleWithPath:[pDict valueForKey:@"bundle"]];
[phc setCurrentBundle:cBundle];
[phc setProcessDict:pDict];
[phc setRunPath:path];
int returnStatus = [phc patchDmg:[pDict valueForKey:@"patch"]];
[phc release];
phc = nil;
[pool release];
return returnStatus;
}
//if we get this far we are processing local blobs instead!
NSArray *blobs = [pDict valueForKey:@"blobs"];
TSSManager *theMan = [[TSSManager alloc] init];
[theMan _sendBlobs:blobs];
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"blobsFinished" object:nil userInfo:nil deliverImmediately:YES];
[theMan release];
[pool release];
return 0;
}
[rl run];
[pool release];
return 0;
}