diff --git a/DataController.mm b/DataController.mm index 646d7ea..ab83c7a 100644 --- a/DataController.mm +++ b/DataController.mm @@ -163,7 +163,9 @@ -(void)replaceColoumnAtIndex:(NSUInteger)index withString:(NSString *)str //----------------------------------------------------------------------------- - (void)writeString:(NSString *)str toFile:(FILE *)pFile { - fwrite(CSTRING(str), [str length] + 1, 1, pFile); + if(str){ + fwrite(CSTRING(str), [str length] + 1, 1, pFile); + } } //----------------------------------------------------------------------------- diff --git a/Document.mm b/Document.mm index c59fbe5..29f422b 100644 --- a/Document.mm +++ b/Document.mm @@ -448,28 +448,31 @@ - (void)handleDataTableChanged:(NSNotification *)notification //---------------------------------------------------------------------------- - (void)handleThreadStateChanged:(NSNotification *)notification { - if ([notification object] == dataController) - { - NSString * threadState = [[notification userInfo] objectForKey:MVStatusUserInfoKey]; - if ([threadState isEqualToString:MVStatusTaskStarted] == YES) - { - if (OSAtomicIncrement32(&threadCount) == 1) - { - [progressIndicator setUsesThreadedAnimation:YES]; - [progressIndicator startAnimation:nil]; - [stopButton setHidden:NO]; - } - } - else if ([threadState isEqualToString:MVStatusTaskTerminated] == YES) - { - if (OSAtomicDecrement32(&threadCount) == 0) - { - [progressIndicator stopAnimation:nil]; - [statusText setStringValue:@""]; - [stopButton setHidden:YES]; - } - } - } + dispatch_async(dispatch_get_main_queue(), ^{ + if ([notification object] == dataController) + { + NSString * threadState = [[notification userInfo] objectForKey:MVStatusUserInfoKey]; + if ([threadState isEqualToString:MVStatusTaskStarted] == YES) + { + if (OSAtomicIncrement32(&threadCount) == 1) + { + [progressIndicator setUsesThreadedAnimation:YES]; + [progressIndicator startAnimation:nil]; + [stopButton setHidden:NO]; + } + } + else if ([threadState isEqualToString:MVStatusTaskTerminated] == YES) + { + if (OSAtomicDecrement32(&threadCount) == 0) + { + [progressIndicator stopAnimation:nil]; + [statusText setStringValue:@""]; + [stopButton setHidden:YES]; + } + } + } + }); + } //---------------------------------------------------------------------------- diff --git a/Info.plist b/Info.plist index d09111f..556b7a0 100644 --- a/Info.plist +++ b/Info.plist @@ -3,9 +3,9 @@ CFBuildDate - Thu Apr 23 12:18:08 WEST 2015 + Thu Mar 21 20:13:01 CST 2019 CFBuildNumber - 9121 + 9132 CFBundleDevelopmentRegion English CFBundleDocumentTypes @@ -44,7 +44,7 @@ CFBundleSignature ???? CFBundleVersion - 9121 + 9132 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/LinkEdit.mm b/LinkEdit.mm index 429cd4f..98c94ac 100644 --- a/LinkEdit.mm +++ b/LinkEdit.mm @@ -827,9 +827,10 @@ - (MVNode *) createSymbolsNode:parent nameToStore = (nameToStore != nil ? [nameToStore stringByAppendingFormat:@"(%@)", symbolName] : [NSString stringWithFormat:@"0x%X (%@)", nlist->n_value, symbolName]); - - [symbolNames setObject:nameToStore - forKey:[NSNumber numberWithUnsignedLong:nlist->n_value]]; + if(nameToStore){ + [symbolNames setObject:nameToStore + forKey:[NSNumber numberWithUnsignedLong:nlist->n_value]]; + } } } else @@ -841,8 +842,10 @@ - (MVNode *) createSymbolsNode:parent // fill in lookup table with undefined sybols (key equals (-1) * index) uint32_t key = *symbols.begin() - nlist - 1; - [symbolNames setObject:symbolName - forKey:[NSNumber numberWithUnsignedLong:key]]; + if(symbolName){ + [symbolNames setObject:symbolName + forKey:[NSNumber numberWithUnsignedLong:key]]; + } } [node.details setAttributesFromRowIndex:bookmark:MVMetaDataAttributeName,symbolName, @@ -991,9 +994,10 @@ - (MVNode *) createSymbols64Node:parent nameToStore = (nameToStore != nil ? [nameToStore stringByAppendingFormat:@"(%@)", symbolName] : [NSString stringWithFormat:@"0x%qX (%@)", nlist_64->n_value, symbolName]); - - [symbolNames setObject:nameToStore - forKey:[NSNumber numberWithUnsignedLongLong:nlist_64->n_value]]; + if(nameToStore){ + [symbolNames setObject:nameToStore + forKey:[NSNumber numberWithUnsignedLongLong:nlist_64->n_value]]; + } } } else @@ -1005,8 +1009,10 @@ - (MVNode *) createSymbols64Node:parent // fill in lookup table with undefined sybols (key equals (-1) * index) uint64_t key = *symbols_64.begin() - nlist_64 - 1; - [symbolNames setObject:symbolName - forKey:[NSNumber numberWithUnsignedLongLong:key]]; + if(symbolName){ + [symbolNames setObject:symbolName + forKey:[NSNumber numberWithUnsignedLongLong:key]]; + } } [node.details setAttributesFromRowIndex:bookmark:MVMetaDataAttributeName,symbolName, @@ -1174,10 +1180,11 @@ - (MVNode *) createISymbolsNode:parent symbolName = [NSString stringWithFormat:@"[0x%X->LOCAL ABSOLUTE]",indirectAddress]; } } - - // fill in lookup table with special indirect sybols - [symbolNames setObject:symbolName - forKey:[NSNumber numberWithUnsignedLong:indirectAddress]]; + if(symbolName){ + // fill in lookup table with special indirect sybols + [symbolNames setObject:symbolName + forKey:[NSNumber numberWithUnsignedLong:indirectAddress]]; + } } [node.details appendRow:@"":@"":@"Section" @@ -1303,9 +1310,11 @@ - (MVNode *) createISymbols64Node:parent } } + if(symbolName){ // fill in lookup table with special indirect sybols - [symbolNames setObject:symbolName - forKey:[NSNumber numberWithUnsignedLongLong:indirectAddress]]; + [symbolNames setObject:symbolName + forKey:[NSNumber numberWithUnsignedLongLong:indirectAddress]]; + } } [node.details appendRow:@"":@"":@"Section" diff --git a/machoview.xcodeproj/project.pbxproj b/machoview.xcodeproj/project.pbxproj index afa40ac..62c6b0d 100644 --- a/machoview.xcodeproj/project.pbxproj +++ b/machoview.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 005039762243B5A20012A68C /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 005039752243B5A20012A68C /* libc++.tbd */; }; 256AC3DA0F4B6AC300CF3369 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* AppController.mm */; }; 3C0ADEB0169CD42600DA428E /* README in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3CE90DFC11F6107600543402 /* README */; }; 3C0F958411F6589D0070A2FE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3C0F957E11F6589D0070A2FE /* InfoPlist.strings */; }; @@ -77,6 +78,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 005039752243B5A20012A68C /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 256AC3D80F4B6AC300CF3369 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; 256AC3D90F4B6AC300CF3369 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; @@ -216,6 +218,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 005039762243B5A20012A68C /* libc++.tbd in Frameworks */, 3CC0022211F64A45000F7A3D /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -337,6 +340,7 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + 005039752243B5A20012A68C /* libc++.tbd */, 7B5E71E319B6829F00843CCE /* libcapstone.a */, 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, @@ -686,6 +690,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; CONFIGURATION_TEMP_DIR = "$(inherited)"; @@ -726,7 +731,7 @@ ); PRIVATE_HEADERS_FOLDER_PATH = ""; PRODUCT_NAME = MachOView; - SDKROOT = macosx10.9; + SDKROOT = macosx; USER_HEADER_SEARCH_PATHS = ""; VALID_ARCHS = "$(inherited)"; VERSIONING_SYSTEM = ""; @@ -738,6 +743,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; CONFIGURATION_TEMP_DIR = "$(inherited)"; @@ -781,7 +787,7 @@ ); PRIVATE_HEADERS_FOLDER_PATH = ""; PRODUCT_NAME = MachOView; - SDKROOT = macosx10.9; + SDKROOT = macosx; SKIP_INSTALL = NO; USER_HEADER_SEARCH_PATHS = ""; VALID_ARCHS = "$(inherited)"; diff --git a/machoview.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/machoview.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/machoview.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/machoview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/machoview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/machoview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/machoview.xcodeproj/project.xcworkspace/xcuserdata/junzhan.xcuserdatad/UserInterfaceState.xcuserstate b/machoview.xcodeproj/project.xcworkspace/xcuserdata/junzhan.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..2a0e8dc Binary files /dev/null and b/machoview.xcodeproj/project.xcworkspace/xcuserdata/junzhan.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/machoview.xcodeproj/xcuserdata/junzhan.xcuserdatad/xcschemes/MachOView.xcscheme b/machoview.xcodeproj/xcuserdata/junzhan.xcuserdatad/xcschemes/MachOView.xcscheme new file mode 100644 index 0000000..72fc410 --- /dev/null +++ b/machoview.xcodeproj/xcuserdata/junzhan.xcuserdatad/xcschemes/MachOView.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/machoview.xcodeproj/xcuserdata/junzhan.xcuserdatad/xcschemes/xcschememanagement.plist b/machoview.xcodeproj/xcuserdata/junzhan.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..0ef9d06 --- /dev/null +++ b/machoview.xcodeproj/xcuserdata/junzhan.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + MachOView.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8D1107260486CEB800E47090 + + primary + + + + +