Add placeholder for types that start with A, for _Atomic() types.
[class-dump.git] / Source / CDLCUnknown.m
blobe8ab4a52fbd396d6baf856691b6810f341028040
1 // -*- mode: ObjC -*-
3 //  This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files.
4 //  Copyright (C) 1997-2019 Steve Nygard.
6 #import "CDLCUnknown.h"
8 static BOOL debug = NO;
10 @implementation CDLCUnknown
12     struct load_command _loadCommand;
13     
14     NSData *_commandData;
17 - (id)initWithDataCursor:(CDMachOFileDataCursor *)cursor;
19     if ((self = [super initWithDataCursor:cursor])) {
20         if (debug) NSLog(@"offset: %lu", [cursor offset]);
21         _loadCommand.cmd     = [cursor readInt32];
22         _loadCommand.cmdsize = [cursor readInt32];
23         if (debug) NSLog(@"cmdsize: %u", _loadCommand.cmdsize);
24         
25         if (_loadCommand.cmdsize > 8) {
26             NSMutableData *commandData = [[NSMutableData alloc] init];
27             [cursor appendBytesOfLength:_loadCommand.cmdsize - 8 intoData:commandData];
28             _commandData = [commandData copy];
29         } else {
30             _commandData = nil;
31         }
32     }
34     return self;
37 #pragma mark -
39 - (uint32_t)cmd;
41     return _loadCommand.cmd;
44 - (uint32_t)cmdsize;
46     return _loadCommand.cmdsize;
49 @end