diff --git a/AppDelegate.m b/AppDelegate.m index a815cf2..859a410 100755 --- a/AppDelegate.m +++ b/AppDelegate.m @@ -20,7 +20,6 @@ //TODO: autolayout vertically //TODO: show 'from where' via quarantine attrz or database!! (simon email) //TODO: detect as procs die via GCD (simon blog post) -//TODO: max'd out window ->set max? (dual monitors) @implementation AppDelegate @@ -1429,8 +1428,8 @@ bail: //always hide 'no items' label self.noItemsLabel.hidden = YES; - //clear out existing items - [self.bottomViewController.tableItems removeAllObjects]; + //unset existing items + self.bottomViewController.tableItems = nil; //when in a background thread // ->perform UI stuff on main thread @@ -1702,8 +1701,8 @@ bail: if( (YES == self.taskTableController.isFiltered) && (0 == self.taskTableController.filteredItems.count) ) { - //remove bottom pane's items - [self.bottomViewController.tableItems removeAllObjects]; + //unset bottom pane's items + self.bottomViewController.tableItems = nil; //reset current task self.currentTask = nil; diff --git a/Items/Connection.m b/Items/Connection.m index 47a5e41..e0b444f 100644 --- a/Items/Connection.m +++ b/Items/Connection.m @@ -94,6 +94,34 @@ return; } + +//resolve a remote IP address to nice DNS name +// ->uses address and port, which are passed to getaddrinfo +// note: get thread to call this, cuz it can be slow!! +-(void)addressesForHost +{ + /* + struct addrinfo hints = {.ai_family=PF_UNSPEC;.ai_socktype=SOCK_STREAM;.ai_protocol=IPPROTO_TCP}; + struct addrinfo *res; + int gai_error = getaddrinfo(host.UTF8String, port.stringValue.UTF8String, &hints, &res); + if (gai_error) { + if (outError) *outError = [NSError errorWithDomain:@"MyDomain" code:gai_error userInfo:@{NSLocalizedDescriptionKey:@(gai_strerror(gai_error))}]; + return nil; + } + NSMutableArray *addresses = [NSMutableArray array]; + struct addrinfo *ai = res; + do { + NSData *address = [NSData dataWithBytes:ai->ai_addr length:ai->ai_addrlen]; + [addresses addObject:address]; + } while (ai = ai->ai_next); + freeaddrinfo(res); + return [addresses copy]; + */ +} + + + + //build nice string -(void)setConnectionString { diff --git a/Items/File.m b/Items/File.m index b89096b..5066cec 100644 --- a/Items/File.m +++ b/Items/File.m @@ -66,10 +66,7 @@ bail: NSArray* parsedResults = nil; //exec 'file' to get file type - //TODO: make const, and this ERRORS out a bunch? results = [[NSString alloc] initWithData:execTask(FILE, @[self.path]) encoding:NSUTF8StringEncoding]; - - //sanity check if(nil == results) { //bail diff --git a/SearchWindowController.m b/SearchWindowController.m index 8f043f1..5ff6e35 100644 --- a/SearchWindowController.m +++ b/SearchWindowController.m @@ -6,14 +6,15 @@ // Copyright (c) 2015 Objective-See. All rights reserved. // +#import +#import "KKRow.h" +#import "Consts.h" +#import "Filter.h" +#import "ItemView.h" +#import "Utilities.h" #import "AppDelegate.h" #import "SearchWindowController.h" -#import "ItemView.h" -#import "KKRow.h" -#import "Filter.h" -#import "Utilities.h" -#import "Consts.h" @implementation SearchWindowController @@ -546,6 +547,7 @@ bail: } //1st: search for all matching tasks + //search for all matching tasks [self.filterObj filterTasks:searchString items:allTasks results:matchingTasks]; @@ -556,6 +558,7 @@ bail: [self.searchTable reloadData]; //2nd: search for all matching dylibs + //sync @synchronized(allTasks) { @@ -598,6 +601,7 @@ bail: [self.searchTable reloadData]; //3rd: search for all matching files + //sync @synchronized(allTasks) { @@ -640,6 +644,7 @@ bail: [self.searchTable reloadData]; //4th: search for all matching network comms + //sync @synchronized(allTasks) { @@ -647,7 +652,7 @@ bail: [matchingItems removeAllObjects]; //walk all tasks - // ->scan each for file matches, only processing first match + // ->scan each for connections matches, only processing first match for(NSNumber* taskPid in allTasks) { //extract task @@ -655,7 +660,7 @@ bail: //filter [self.filterObj filterConnections:searchString items:task.connections results:matchingItems]; - + //process all matching connections // ->but first check if processed due to matching in another task already for(Connection* connection in matchingItems) diff --git a/Task.m b/Task.m index fd908d8..59bef5b 100644 --- a/Task.m +++ b/Task.m @@ -624,24 +624,21 @@ bail: //remove any existing enum'd networking sockets/connections [self.connections removeAllObjects]; - - // - //NSLog(@"found %d connections", networkItems.count); - + //create/add all network sockets/connection for(NSMutableDictionary* networkItem in networkItems) { //alloc/init File obj connection = [[Connection alloc] initWithParams:networkItem]; - //add File obj + //add connection obj if(nil != connection) { //add [self.connections addObject:connection]; } } - + //reload bottom pane [((AppDelegate*)[[NSApplication sharedApplication] delegate]) reloadBottomPane:self itemView:NETWORKING_VIEW]; @@ -807,7 +804,7 @@ bail: //sync @synchronized(self.connections) { - //convert all dylibs and add + //convert all connections and add for(Connection* connection in self.connections) { //convert/add diff --git a/TaskEnumerator.m b/TaskEnumerator.m index 585c320..2db2c8a 100644 --- a/TaskEnumerator.m +++ b/TaskEnumerator.m @@ -55,7 +55,7 @@ //enumerate all tasks // ->calls back into app delegate to update task (top) table when pau -// TODO: existsing tasks w/ nil vtInfo, call [vtObject addItem:binary] ? +// TODO: existing tasks w/ nil vtInfo, call [vtObject addItem:binary] ? -(void)enumerateTasks { //(new) task item diff --git a/TaskExplorer-Info.plist b/TaskExplorer-Info.plist index bf1ae32..a5292e4 100755 --- a/TaskExplorer-Info.plist +++ b/TaskExplorer-Info.plist @@ -25,7 +25,7 @@ LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright - Copyright © 2015 Objective-See, LLC. All rights reserved. + Copyright © 2016 Objective-See, LLC. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass diff --git a/TaskExplorer.xcodeproj/project.xcworkspace/xcuserdata/patrickw.xcuserdatad/UserInterfaceState.xcuserstate b/TaskExplorer.xcodeproj/project.xcworkspace/xcuserdata/patrickw.xcuserdatad/UserInterfaceState.xcuserstate index 6534dde..677ed60 100644 Binary files a/TaskExplorer.xcodeproj/project.xcworkspace/xcuserdata/patrickw.xcuserdatad/UserInterfaceState.xcuserstate and b/TaskExplorer.xcodeproj/project.xcworkspace/xcuserdata/patrickw.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TaskExplorer.xcodeproj/xcuserdata/patrickw.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/TaskExplorer.xcodeproj/xcuserdata/patrickw.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index e5ac276..fe2b454 100644 --- a/TaskExplorer.xcodeproj/xcuserdata/patrickw.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/TaskExplorer.xcodeproj/xcuserdata/patrickw.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -2,166 +2,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -