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 "CDLCDylinker.h" |
| 7 |
| 8 #import "CDDataCursor.h" |
| 9 |
| 10 @implementation CDLCDylinker |
| 11 |
| 12 - (id)initWithDataCursor:(CDDataCursor *)cursor machOFile:(CDMachOFile *)aMachOF
ile; |
| 13 { |
| 14 NSUInteger length; |
| 15 |
| 16 if ([super initWithDataCursor:cursor machOFile:aMachOFile] == nil) |
| 17 return nil; |
| 18 |
| 19 dylinkerCommand.cmd = [cursor readInt32]; |
| 20 dylinkerCommand.cmdsize = [cursor readInt32]; |
| 21 |
| 22 dylinkerCommand.name.offset = [cursor readInt32]; |
| 23 |
| 24 length = dylinkerCommand.cmdsize - sizeof(dylinkerCommand); |
| 25 //NSLog(@"expected length: %u", length); |
| 26 |
| 27 name = [[cursor readStringOfLength:length encoding:NSASCIIStringEncoding] re
tain]; |
| 28 //NSLog(@"name: %@", name); |
| 29 |
| 30 return self; |
| 31 } |
| 32 |
| 33 - (void)dealloc; |
| 34 { |
| 35 [name release]; |
| 36 |
| 37 [super dealloc]; |
| 38 } |
| 39 |
| 40 - (uint32_t)cmd; |
| 41 { |
| 42 return dylinkerCommand.cmd; |
| 43 } |
| 44 |
| 45 - (uint32_t)cmdsize; |
| 46 { |
| 47 return dylinkerCommand.cmdsize; |
| 48 } |
| 49 |
| 50 - (NSString *)name; |
| 51 { |
| 52 return name; |
| 53 } |
| 54 |
| 55 @end |
OLD | NEW |