forked from preemptive/PPiOS-Rename
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CDLCEncryptionInfo.m
64 lines (49 loc) · 1.35 KB
/
CDLCEncryptionInfo.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
// -*- mode: ObjC -*-
// This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files.
// Copyright (C) 1997-1998, 2000-2001, 2004-2015 Steve Nygard.
#import "CDLCEncryptionInfo.h"
// This is used on iOS.
@implementation CDLCEncryptionInfo
{
struct encryption_info_command_64 _encryptionInfoCommand;
}
- (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor;
{
if ((self = [super initWithDataCursor:cursor])) {
_encryptionInfoCommand.cmd = [cursor readInt32];
_encryptionInfoCommand.cmdsize = [cursor readInt32];
_encryptionInfoCommand.cryptoff = [cursor readInt32];
_encryptionInfoCommand.cryptsize = [cursor readInt32];
_encryptionInfoCommand.cryptid = [cursor readInt32];
if (_encryptionInfoCommand.cmd == LC_ENCRYPTION_INFO_64) {
_encryptionInfoCommand.pad = [cursor readInt32];
}
}
return self;
}
#pragma mark -
- (uint32_t)cmd;
{
return _encryptionInfoCommand.cmd;
}
- (uint32_t)cmdsize;
{
return _encryptionInfoCommand.cmdsize;
}
- (uint32_t)cryptoff;
{
return _encryptionInfoCommand.cryptoff;
}
- (uint32_t)cryptsize;
{
return _encryptionInfoCommand.cryptsize;
}
- (uint32_t)cryptid;
{
return _encryptionInfoCommand.cryptid;
}
- (BOOL)isEncrypted;
{
return _encryptionInfoCommand.cryptid != 0;
}
@end