dylibs and files in bottom pane are now sorted

errSecCSBadResource is ignored when checking for apple-signed files
'show file' fixed in bottom pane
tree view (re)fixed and sorted based on PID
tree view logic combined in single file
This commit is contained in:
Patrick Wardle
2015-06-17 21:47:56 -10:00
parent f19466a8fe
commit ee9b80ddb9
14 changed files with 476 additions and 490 deletions
+46 -4
View File
@@ -328,6 +328,13 @@ bail:
//alloc array for new dylibs
newDylibs = [NSMutableArray array];
//sync
@synchronized(self.dylibs)
{
//reset existing dylibs
[self.dylibs removeAllObjects];
}
//invoke XPC service (running as r00t)
// ->will enumerate dylibs, then invoke reply block to save into iVar
[[xpcConnection remoteObjectProxy] enumerateDylibs:self.pid withReply:^(NSMutableArray* dylibPaths) {
@@ -393,6 +400,18 @@ bail:
}
}
//sync to sort
@synchronized(self.dylibs)
{
//sort by name
self.dylibs = [[self.dylibs sortedArrayUsingComparator:^NSComparisonResult(id a, id b)
{
//sort
return [[(Binary*)a name] compare:[(Binary*)b name] options:NSCaseInsensitiveSearch];
}] mutableCopy];
}
//reload bottom pane now
// ->this will only reload if new task is the currently selected one, etc
[((AppDelegate*)[[NSApplication sharedApplication] delegate]) reloadBottomPane:self itemView:DYLIBS_VIEW];
@@ -406,7 +425,7 @@ bail:
}
//any new dylibs?
// ->reload bottom pane
// ->reload bottom pane to update signing info, etc
if(0 != newDylibs.count)
{
//reload
@@ -435,6 +454,13 @@ bail:
//alloc array for new files
newFiles = [NSMutableArray array];
//sync
@synchronized(self.files)
{
//reset existing files
[self.files removeAllObjects];
}
//invoke XPC service (running as r00t)
// ->will enumerate files, then invoke reply block so can save into iVar
[[xpcConnection remoteObjectProxy] enumerateFiles:self.pid withReply:^(NSMutableArray* fileDescriptors) {
@@ -455,9 +481,13 @@ bail:
//next
continue;
}
//add to task's files
[self.files addObject:file];
//sync
@synchronized(self.files)
{
//add to task's files
[self.files addObject:file];
}
//save new files
// ->will be processed below
@@ -468,6 +498,18 @@ bail:
}
}
//sync to sort
@synchronized(self.files)
{
//sort by name
self.files = [[self.files sortedArrayUsingComparator:^NSComparisonResult(id a, id b)
{
//sort
return [[(File*)a name] compare:[(File*)b name] options:NSCaseInsensitiveSearch];
}] mutableCopy];
}
//reload bottom pane
[((AppDelegate*)[[NSApplication sharedApplication] delegate]) reloadBottomPane:self itemView:FILES_VIEW];