-
Notifications
You must be signed in to change notification settings - Fork 28
/
CDLCUUID.m
57 lines (43 loc) · 1.23 KB
/
CDLCUUID.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
// -*- mode: ObjC -*-
// This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files.
// Copyright (C) 1997-2019 Steve Nygard.
#import "CDLCUUID.h"
#import "CDMachOFile.h"
@implementation CDLCUUID
{
struct uuid_command _uuidCommand;
NSUUID *_UUID;
}
- (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor;
{
if ((self = [super initWithDataCursor:cursor])) {
_uuidCommand.cmd = [cursor readInt32];
_uuidCommand.cmdsize = [cursor readInt32];
for (NSUInteger index = 0; index < sizeof(_uuidCommand.uuid); index++) {
_uuidCommand.uuid[index] = [cursor readByte];
}
_UUID = [[NSUUID alloc] initWithUUIDBytes:_uuidCommand.uuid];
}
return self;
}
#pragma mark -
- (uint32_t)cmd;
{
return _uuidCommand.cmd;
}
- (uint32_t)cmdsize;
{
return _uuidCommand.cmdsize;
}
- (void)appendToString:(NSMutableString *)resultString verbose:(BOOL)isVerbose;
{
[super appendToString:resultString verbose:isVerbose];
[resultString appendString:@" uuid "];
[resultString appendString:[self.UUID UUIDString]];
[resultString appendString:@"\n"];
}
- (NSString *)extraDescription;
{
return [self.UUID UUIDString];
}
@end