-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAFirmwareFile.m
68 lines (49 loc) · 1.17 KB
/
AFirmwareFile.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
//
// AFirmwareFile.m
// ambrosia
//
// Created by Kevin Bradley on 4/14/11.
// Copyright 2011 Chronic-Dev Team. All rights reserved.
//
#import "AFirmwareFile.h"
@implementation AFirmwareFile
@synthesize keyBag, file, encrypted;
- (id)initWithFile:(NSString *)theFile
{
if(self = [super init]) {
DebugLog(@"initWithFile: %@", theFile);
file = theFile;
encrypted = [self grabKeybag];
//if (encrypted == TRUE)
// {
// NSDictionary *kbagDict = [ACommon decryptedKbag:keyBag];
// IV = [kbagDict valueForKey:@"iv"];
// key = [kbagDict valueForKey:@"k"];
// }
}
return self;
}
-(BOOL)grabKeybag
{
NSString *kbagProcess = [NSString stringWithFormat:@"\"%@\" \"%@\"", GRABKBAG, self.file];
// DebugLog(@"grabKeybag: %@", kbagProcess);
NSString *returnString = [ACommon singleLineReturnForProcess:kbagProcess];
if (returnString != nil)
{
if (![returnString isEqualToString:@"NO_KBAG"])
{
DebugLog(@"%@ has keybag: %@", [file lastPathComponent], returnString);
keyBag = returnString;
return TRUE;
}
}
DebugLog(@"%@ not encrypted!", file);
return FALSE;
}
-(void)dealloc
{
//[file release];
//[keyBag release];
[super dealloc];
}
@end