File tree Expand file tree Collapse file tree 5 files changed +21
-18
lines changed Expand file tree Collapse file tree 5 files changed +21
-18
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ - (void)visitObjectiveCProcessor:(CDObjectiveCProcessor *)aProcessor;
54
54
[resultString appendString: @" #pragma mark -\n\n " ];
55
55
[resultString appendString: @" /*\n " ];
56
56
[resultString appendFormat: @" * File: %@ \n " , [machOFile filename ]];
57
+ [resultString appendFormat: @" * UUID: %@ \n " , [machOFile uuidString ]];
57
58
58
59
archInfo = NXGetArchInfoFromCpuType ([machOFile cputypePlusArchBits ], [machOFile cpusubtype ]);
59
60
// archInfo = [machOFile archInfo];
Original file line number Diff line number Diff line change 20
20
- (uint32_t )cmd ;
21
21
- (uint32_t )cmdsize ;
22
22
23
+ - (NSString *)uuidString ;
24
+
23
25
- (void )appendToString : (NSMutableString *)resultString verbose : (BOOL )isVerbose ;
24
26
25
27
@end
Original file line number Diff line number Diff line change @@ -60,28 +60,17 @@ - (uint32_t)cmdsize;
60
60
return uuidCommand.cmdsize ;
61
61
}
62
62
63
- - (void ) appendToString : ( NSMutableString *)resultString verbose : ( BOOL ) isVerbose ;
63
+ - (NSString *)uuidString ;
64
64
{
65
- unsigned int index;
66
- CFUUIDBytes uuidBytes;
67
- UInt8 *bytePtr = (UInt8 *)&uuidBytes;
68
- UInt8 byte;
65
+ return [NSMakeCollectable (CFUUIDCreateString (kCFAllocatorDefault , uuid)) autorelease ];
66
+ }
69
67
68
+ - (void )appendToString : (NSMutableString *)resultString verbose : (BOOL )isVerbose ;
69
+ {
70
70
[super appendToString: resultString verbose: isVerbose];
71
71
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 ]];
85
74
[resultString appendString: @" \n " ];
86
75
}
87
76
Original file line number Diff line number Diff line change 85
85
- (NSString *)loadCommandString : (BOOL )isVerbose ;
86
86
- (NSString *)headerString : (BOOL )isVerbose ;
87
87
88
+ - (NSString *)uuidString ;
88
89
- (NSString *)archName ;
89
90
90
91
- (NSString *)description ;
Original file line number Diff line number Diff line change 20
20
#import " CDLCSegment.h"
21
21
#import " CDLCSegment64.h"
22
22
#import " CDLCSymbolTable.h"
23
+ #import " CDLCUUID.h"
23
24
#import " CDObjectiveCProcessor.h"
24
25
#import " CDSection.h"
25
26
#import " CDSymbol.h"
@@ -493,6 +494,15 @@ - (NSString *)headerString:(BOOL)isVerbose;
493
494
return resultString;
494
495
}
495
496
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
+
496
506
// Must not return nil.
497
507
- (NSString *)archName ;
498
508
{
You can’t perform that action at this time.
0 commit comments