added exception handling to XPC service

set max window width for search window
This commit is contained in:
Patrick Wardle
2016-02-21 21:33:11 -10:00
parent f8cd92239d
commit 905672341f
6 changed files with 26 additions and 11 deletions
+1
View File
@@ -20,6 +20,7 @@
//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
+1 -1
View File
@@ -3,7 +3,7 @@
#import <syslog.h>
#import <signal.h>
#import <Foundation/Foundation.h>
//install exception/signal handlers
void installExceptionHandlers();
+2
View File
@@ -16,6 +16,7 @@
7D7348111BCB82C900CD7235 /* flaggedRedOver.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D73480E1BCB82C900CD7235 /* flaggedRedOver.png */; };
7DA5CA0F1C7AA8CB00627DD7 /* MachO.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DA5CA0E1C7AA8CB00627DD7 /* MachO.m */; };
7DAA78091B903BF1004840B9 /* CustomTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DAA78081B903BF1004840B9 /* CustomTextField.m */; };
7DB0FCA21C7AECB300D2CE0D /* Exception.m in Sources */ = {isa = PBXBuildFile; fileRef = CD7B9F4F1ACB9A8400DF3C71 /* Exception.m */; };
CD001B381AB903040089014A /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = CD001B351AB903040089014A /* logo.png */; };
CD001B391AB903040089014A /* logoApple.png in Resources */ = {isa = PBXBuildFile; fileRef = CD001B361AB903040089014A /* logoApple.png */; };
CD02194F1AD34D8B005148A2 /* AboutWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD02194D1AD34D8B005148A2 /* AboutWindow.xib */; };
@@ -833,6 +834,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7DB0FCA21C7AECB300D2CE0D /* Exception.m in Sources */,
CDA5F6B61B16D805003CE340 /* main.m in Sources */,
CDA5F6B41B16D805003CE340 /* remoteTaskService.m in Sources */,
7D2A4C6C1BC789070029A284 /* Utilities.m in Sources */,
+4 -3
View File
@@ -23,6 +23,7 @@
<rect key="contentRect" x="95" y="481" width="1304" height="425"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1057"/>
<value key="minSize" type="size" width="800" height="250"/>
<value key="maxSize" type="size" width="2000" height="425"/>
<view key="contentView" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="3" width="1304" height="425"/>
<autoresizingMask key="autoresizingMask"/>
@@ -75,7 +76,7 @@
</imageView>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="n1s-T9-NPU">
<rect key="frame" x="46" y="20" width="1103" height="19"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Name" id="5KE-Dr-geL">
<textFieldCell key="cell" lineBreakMode="truncatingTail" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Name" usesSingleLineMode="YES" id="5KE-Dr-geL">
<font key="font" size="13" name="Menlo-Regular"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
@@ -198,7 +199,7 @@
</imageView>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ugh-bk-muU">
<rect key="frame" x="31" y="20" width="1185" height="19"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Name" id="fgN-p7-FWL">
<textFieldCell key="cell" lineBreakMode="truncatingTail" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Name" usesSingleLineMode="YES" id="fgN-p7-FWL">
<font key="font" size="13" name="Menlo-Regular"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
@@ -304,7 +305,7 @@
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UR5-ag-OPP">
<rect key="frame" x="32" y="20" width="1227" height="19"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Network Info" id="WqN-YF-KzO">
<textFieldCell key="cell" lineBreakMode="truncatingTail" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Network Info" usesSingleLineMode="YES" id="WqN-YF-KzO">
<font key="font" size="13" name="Menlo-Regular"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+2 -2
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<development version="6000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9532"/>
<capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
</dependencies>
<objects>
+16 -5
View File
@@ -8,6 +8,7 @@
#import "serviceInterface.h"
#import "remoteTaskService.h"
#import "../Exception.h"
#import <syslog.h>
#import <libproc.h>
@@ -101,20 +102,30 @@ bail:
@end
//TODO: add exception handling!!!!
//main entrypoint
// ->install exception handlers & setup/kickoff listener
int main(int argc, const char *argv[])
{
//service delegate
ServiceDelegate* delegate = nil;
//listener
NSXPCListener* listener = nil;
//first thing...
// ->install exception handlers!
installExceptionHandlers();
//make really r00t
// ->needed for exec'ing vmmap
// ->needed for exec'ing vmmap, etc
setuid(0);
//create the delegate for the service.
ServiceDelegate *delegate = [ServiceDelegate new];
delegate = [ServiceDelegate new];
//set up the one NSXPCListener for this service
// ->handles incoming connections
NSXPCListener *listener = [NSXPCListener serviceListener];
listener = [NSXPCListener serviceListener];
//set delegate
listener.delegate = delegate;