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 "CDLCPreboundDylib.h" |
| 7 |
| 8 #import "CDFatFile.h" |
| 9 #import "CDMachOFile.h" |
| 10 |
| 11 @implementation CDLCPreboundDylib |
| 12 |
| 13 - (id)initWithDataCursor:(CDDataCursor *)cursor machOFile:(CDMachOFile *)aMachOF
ile; |
| 14 { |
| 15 if ([super initWithDataCursor:cursor machOFile:aMachOFile] == nil) |
| 16 return nil; |
| 17 |
| 18 //NSLog(@"current offset: %u", [cursor offset]); |
| 19 preboundDylibCommand.cmd = [cursor readInt32]; |
| 20 preboundDylibCommand.cmdsize = [cursor readInt32]; |
| 21 //NSLog(@"cmdsize: %u", preboundDylibCommand.cmdsize); |
| 22 |
| 23 preboundDylibCommand.name.offset = [cursor readInt32]; |
| 24 preboundDylibCommand.nmodules = [cursor readInt32]; |
| 25 preboundDylibCommand.linked_modules.offset = [cursor readInt32]; |
| 26 |
| 27 if (preboundDylibCommand.cmdsize > 20) { |
| 28 // Don't need this info right now. |
| 29 [cursor advanceByLength:preboundDylibCommand.cmdsize - 20]; |
| 30 } |
| 31 |
| 32 //name = [[cursor readCString] retain]; |
| 33 //NSLog(@"name: %@", name); |
| 34 //exit(99); |
| 35 |
| 36 return self; |
| 37 } |
| 38 |
| 39 - (void)dealloc; |
| 40 { |
| 41 [name release]; |
| 42 |
| 43 [super dealloc]; |
| 44 } |
| 45 |
| 46 - (uint32_t)cmd; |
| 47 { |
| 48 return preboundDylibCommand.cmd; |
| 49 } |
| 50 |
| 51 - (uint32_t)cmdsize; |
| 52 { |
| 53 return preboundDylibCommand.cmdsize; |
| 54 } |
| 55 |
| 56 - (NSString *)name; |
| 57 { |
| 58 return name; |
| 59 } |
| 60 |
| 61 @end |
OLD | NEW |