forked from preemptive/PPiOS-Rename
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CDLCLinkeditData.m
50 lines (37 loc) · 1.13 KB
/
CDLCLinkeditData.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
// -*- 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 "CDLCLinkeditData.h"
#import "CDMachOFile.h"
@implementation CDLCLinkeditData
{
struct linkedit_data_command _linkeditDataCommand;
NSData *_linkeditData;
}
- (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor;
{
if ((self = [super initWithDataCursor:cursor])) {
_linkeditDataCommand.cmd = [cursor readInt32];
_linkeditDataCommand.cmdsize = [cursor readInt32];
_linkeditDataCommand.dataoff = [cursor readInt32];
_linkeditDataCommand.datasize = [cursor readInt32];
}
return self;
}
#pragma mark -
- (uint32_t)cmd;
{
return _linkeditDataCommand.cmd;
}
- (uint32_t)cmdsize;
{
return _linkeditDataCommand.cmdsize;
}
- (NSData *)linkeditData;
{
if (_linkeditData == NULL) {
_linkeditData = [[NSData alloc] initWithBytes:[self.machOFile bytesAtOffset:_linkeditDataCommand.dataoff] length:_linkeditDataCommand.datasize];
}
return _linkeditData;
}
@end