OLD | NEW |
(Empty) | |
| 1 // -*- mode: ObjC -*- |
| 2 |
| 3 // This file is part of class-dump, a utility for examining the Objective-C seg
ment of Mach-O files. |
| 4 // Copyright (C) 1997-1998, 2000-2001, 2004-2010 Steve Nygard. |
| 5 |
| 6 #import "CDLoadCommand.h" |
| 7 #include <mach-o/loader.h> |
| 8 |
| 9 @class CDSection; |
| 10 |
| 11 #define CDSegmentProtectedMagicTypeNone 0 |
| 12 #define CDSegmentProtectedMagicType1 0xc2286295 |
| 13 #define CDSegmentProtectedMagicType2 0x2e69cf40 |
| 14 |
| 15 enum { |
| 16 CDSegmentEncryptionTypeNone = 0, |
| 17 CDSegmentEncryptionType1 = 1, // Prior to 10.5 (AES) |
| 18 CDSegmentEncryptionType2 = 2, // 10.6 (Blowfish) |
| 19 CDSegmentEncryptionTypeUnknown |
| 20 }; |
| 21 typedef NSUInteger CDSegmentEncryptionType; |
| 22 |
| 23 extern NSString *CDSegmentEncryptionTypeName(CDSegmentEncryptionType type); |
| 24 |
| 25 @interface CDLCSegment : CDLoadCommand |
| 26 { |
| 27 NSString *name; |
| 28 NSMutableArray *sections; |
| 29 |
| 30 NSMutableData *decryptedData; |
| 31 } |
| 32 |
| 33 - (id)initWithDataCursor:(CDDataCursor *)cursor machOFile:(CDMachOFile *)aMachOF
ile; |
| 34 - (void)dealloc; |
| 35 |
| 36 - (NSString *)name; |
| 37 - (void)setName:(NSString *)newName; |
| 38 |
| 39 - (NSArray *)sections; |
| 40 |
| 41 - (NSUInteger)vmaddr; |
| 42 - (NSUInteger)fileoff; |
| 43 - (NSUInteger)filesize; |
| 44 - (vm_prot_t)initprot; |
| 45 - (uint32_t)flags; |
| 46 - (BOOL)isProtected; |
| 47 |
| 48 - (CDSegmentEncryptionType)encryptionType; |
| 49 - (BOOL)canDecrypt; |
| 50 |
| 51 - (NSString *)flagDescription; |
| 52 - (NSString *)extraDescription; |
| 53 |
| 54 - (BOOL)containsAddress:(NSUInteger)address; |
| 55 - (CDSection *)sectionContainingAddress:(NSUInteger)address; |
| 56 - (CDSection *)sectionWithName:(NSString *)aName; |
| 57 - (NSUInteger)fileOffsetForAddress:(NSUInteger)address; |
| 58 - (NSUInteger)segmentOffsetForAddress:(NSUInteger)address; |
| 59 |
| 60 - (void)appendToString:(NSMutableString *)resultString verbose:(BOOL)isVerbose; |
| 61 |
| 62 - (void)writeSectionData; |
| 63 |
| 64 - (NSData *)decryptedData; |
| 65 |
| 66 @end |
OLD | NEW |