File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ - (void)visitObjectiveCProcessor:(CDObjectiveCProcessor *)aProcessor;
5454 [resultString appendString: @" #pragma mark -\n\n " ];
5555 [resultString appendString: @" /*\n " ];
5656 [resultString appendFormat: @" * File: %@ \n " , [machOFile filename ]];
57+ [resultString appendFormat: @" * UUID: %@ \n " , [machOFile uuidString ]];
5758
5859 archInfo = NXGetArchInfoFromCpuType ([machOFile cputypePlusArchBits ], [machOFile cpusubtype ]);
5960 // archInfo = [machOFile archInfo];
Original file line number Diff line number Diff line change 2020- (uint32_t )cmd ;
2121- (uint32_t )cmdsize ;
2222
23+ - (NSString *)uuidString ;
24+
2325- (void )appendToString : (NSMutableString *)resultString verbose : (BOOL )isVerbose ;
2426
2527@end
Original file line number Diff line number Diff line change @@ -60,28 +60,17 @@ - (uint32_t)cmdsize;
6060 return uuidCommand.cmdsize ;
6161}
6262
63- - (void ) appendToString : ( NSMutableString *)resultString verbose : ( BOOL ) isVerbose ;
63+ - (NSString *)uuidString ;
6464{
65- unsigned int index;
66- CFUUIDBytes uuidBytes;
67- UInt8 *bytePtr = (UInt8 *)&uuidBytes;
68- UInt8 byte;
65+ return [NSMakeCollectable (CFUUIDCreateString (kCFAllocatorDefault , uuid)) autorelease ];
66+ }
6967
68+ - (void )appendToString : (NSMutableString *)resultString verbose : (BOOL )isVerbose ;
69+ {
7070 [super appendToString: resultString verbose: isVerbose];
7171
72- uuidBytes = CFUUIDGetUUIDBytes (uuid);
73- [resultString appendString: @" uuid" ];
74- for (index = 0 ; index < 8 ; index++) {
75- byte = bytePtr[index];
76- [resultString appendFormat: @" 0x%02x " , byte];
77- }
78-
79- [resultString appendString: @" \n " ];
80- [resultString appendString: @" " ];
81- for (index = 0 ; index < 8 ; index++) {
82- byte = bytePtr[8 + index];
83- [resultString appendFormat: @" 0x%02x " , byte];
84- }
72+ [resultString appendString: @" uuid " ];
73+ [resultString appendString: [self uuidString ]];
8574 [resultString appendString: @" \n " ];
8675}
8776
Original file line number Diff line number Diff line change 8585- (NSString *)loadCommandString : (BOOL )isVerbose ;
8686- (NSString *)headerString : (BOOL )isVerbose ;
8787
88+ - (NSString *)uuidString ;
8889- (NSString *)archName ;
8990
9091- (NSString *)description ;
Original file line number Diff line number Diff line change 2020#import " CDLCSegment.h"
2121#import " CDLCSegment64.h"
2222#import " CDLCSymbolTable.h"
23+ #import " CDLCUUID.h"
2324#import " CDObjectiveCProcessor.h"
2425#import " CDSection.h"
2526#import " CDSymbol.h"
@@ -493,6 +494,15 @@ - (NSString *)headerString:(BOOL)isVerbose;
493494 return resultString;
494495}
495496
497+ - (NSString *)uuidString ;
498+ {
499+ for (CDLoadCommand *loadCommand in loadCommands)
500+ if ([loadCommand isKindOfClass: [CDLCUUID class ]])
501+ return [(CDLCUUID*)loadCommand uuidString ];
502+
503+ return @" N/A" ;
504+ }
505+
496506// Must not return nil.
497507- (NSString *)archName ;
498508{
You can’t perform that action at this time.
0 commit comments