From 3fcf6ee19e50841dad0f07e8473725ee71d29947 Mon Sep 17 00:00:00 2001 From: veracode Date: Tue, 13 May 2014 00:10:05 -0500 Subject: [PATCH] Add AppDelegate.h --- .DS_Store | Bin 0 -> 6148 bytes AppDelegate.h | 15 ++ AppDelegate.m | 47 ++++ Base.lproj/Main_iPad.storyboard | 26 ++ Base.lproj/Main_iPhone.storyboard | 31 +++ .../AppIcon.appiconset/Contents.json | 35 +++ Images.xcassets/AppIcon.appiconset/Icon.png | Bin 0 -> 5483 bytes .../LaunchImage.launchimage/Contents.json | 51 ++++ ViewController.h | 20 ++ ViewController.m | 226 ++++++++++++++++++ com.jensen.iRE.Startup.plist | Bin 0 -> 429 bytes en.lproj/InfoPlist.strings | 2 + iRE-Info.plist | 45 ++++ iRE-Prefix.pch | 16 ++ main.m | 22 ++ 15 files changed, 536 insertions(+) create mode 100644 .DS_Store create mode 100644 AppDelegate.h create mode 100644 AppDelegate.m create mode 100644 Base.lproj/Main_iPad.storyboard create mode 100644 Base.lproj/Main_iPhone.storyboard create mode 100644 Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Images.xcassets/AppIcon.appiconset/Icon.png create mode 100644 Images.xcassets/LaunchImage.launchimage/Contents.json create mode 100644 ViewController.h create mode 100644 ViewController.m create mode 100755 com.jensen.iRE.Startup.plist create mode 100644 en.lproj/InfoPlist.strings create mode 100644 iRE-Info.plist create mode 100644 iRE-Prefix.pch create mode 100644 main.m diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/AppDelegate.m b/AppDelegate.m new file mode 100644 index 0000000..edc69fe --- /dev/null +++ b/AppDelegate.m @@ -0,0 +1,47 @@ +// +// AppDelegate.m +// iRE +// +// Created by veracode on 11/8/13. +// Copyright (c) 2013 veracode. All rights reserved. +// + +#import "AppDelegate.h" +#include + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git a/Base.lproj/Main_iPad.storyboard b/Base.lproj/Main_iPad.storyboard new file mode 100644 index 0000000..a185e8a --- /dev/null +++ b/Base.lproj/Main_iPad.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Base.lproj/Main_iPhone.storyboard b/Base.lproj/Main_iPhone.storyboard new file mode 100644 index 0000000..46dbdce --- /dev/null +++ b/Base.lproj/Main_iPhone.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Images.xcassets/AppIcon.appiconset/Contents.json b/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..138e2f0 --- /dev/null +++ b/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "57x57", + "scale" : "1x" + }, + { + "idiom" : "iphone", + "size" : "57x57", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon.png", + "unassigned" : true, + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Images.xcassets/AppIcon.appiconset/Icon.png b/Images.xcassets/AppIcon.appiconset/Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..62cf13e15c0f1fbaf99240f135ff684fd2c67059 GIT binary patch literal 5483 zcmV-x6_o0UP)Dm4{athJ?(B_S9E)>-U7Wz?365}{DOQu9hGHKGXDG7uC2n0z0A`TJ&cd=M3fW5H0bI*5nzn4D-06`E3 zC0C9={C57Bo$2ZR_3Pg|`n?Z{2>ubm%m9FhSN?6j=gT6cd_VJCnc-$*{xMjuUf>E! zA`(JeJ*>H(n+P*s^ONf@_w!+8W&jMspkA+sVQ7qD<~WYi>2!a8e;h|6Bcprw?ycAB zk3IHSI-S0C_*|T?cc4lB;#o@yT zr>CdZtsC00W5@F4%ZcblIEZL+aksI`V0(4eWva=API`j6? z!~339dghHYeBT4VzF~N6xm>w8ck$@KgR55-jvjjPz@C@=*f~8q`uO9I!wpOa5sfkB za=E|1zo)0?mP`L^95BW(iy!{*doO+O>-X<`U}$*Tb1(g9&+8|KRu3u^o!woVH*UCX z>vo;!lgD#S7bSyZu*x>DL$l5H@Yz(){7gb&({=^z`(~l`Dl1 zx3sPI&sP>g?E3Mpzx>8m{`Keo^Y+_!8e_sJ$YyfGcWym3eBjPMowYx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X_Hv1*nY|e92t-0Ki{@#-#n?{blGJ9rEJ~)vRgix+{P#~ZJO9(`1DF8+w;w1JdjC|LTUMJaEmMM;cs^6%P5d;#zM&W6;05haKND%UC zT6*qkn*Y^Tu1kHxW?{D3PG?Ty&|I7^oftWN@{OM?9Qy~ac&y8d8N4-H1_su)g?=cl zX3N3|0mw*(3>zi_5QH`f6liH9jdYl$NiZ@g2G6n6D%-761WHJqZm9&qx=A zjVc2wg(?jyFVh9(rIl($uT{Be&u)=+PCA}+U1@oaZAo#)Vw00uTqW4WA0HS36Ytpc0h zz4w#%^U%cmcy5A#Fa2Etj8_8Qwb%TgTW*cDDctPFHyz%kwehO=|2O3QV*UR?e&**g h{vXOeVf{ZN{~J(*!Zj34A~XO1002ovPDHLkV1n)@u^RvY literal 0 HcmV?d00001 diff --git a/Images.xcassets/LaunchImage.launchimage/Contents.json b/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..6da7c45 --- /dev/null +++ b/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,51 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ViewController.h b/ViewController.h new file mode 100644 index 0000000..332eee9 --- /dev/null +++ b/ViewController.h @@ -0,0 +1,20 @@ +// +// ViewController.h +// iRE +// +// Created by veracode on 11/8/13. +// Copyright (c) 2013 veracode. All rights reserved. +// + +#import + +@interface ViewController : UIViewController +{ + UILabel*lblHeader; + UILabel*lblMessage; + UILabel*lblIPText; + UILabel*lblIPAddress; + UILabel*lbliRET; +} + +@end diff --git a/ViewController.m b/ViewController.m new file mode 100644 index 0000000..ebf64b4 --- /dev/null +++ b/ViewController.m @@ -0,0 +1,226 @@ +// +// ViewController.m +// iRE +// +// Created by veracode on 11/8/13. +// Copyright (c) 2013 veracode. All rights reserved. +// + +#import "ViewController.h" +#include +#include + + + +@interface ViewController () + + + +@end + +@implementation ViewController + + UIButton*btnStart; + int intButtonState; + + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + + float rd = 3.0/255.0; + float gr = 119.0/255.0; + float bl = 204.0/255.0; + + self.view.backgroundColor = [UIColor colorWithRed:rd green:gr blue:bl alpha:1.0]; + + //ADD THE HEADER LABEL + lblHeader = [[UILabel alloc] + initWithFrame:CGRectMake(0,10,320,100)]; + lblHeader.text = @"Welcome to iRET"; + lblHeader.backgroundColor = [UIColor clearColor]; + lblHeader.textColor = [UIColor whiteColor]; + lblHeader.font = [UIFont fontWithName:@"Arial-BoldMT" size:25.0]; + lblHeader.textAlignment = NSTextAlignmentCenter; + + //ADD THE HEADER LABEL + lbliRET = [[UILabel alloc] + initWithFrame:CGRectMake(0,60,320,100)]; + lbliRET.text = @"The iOS Reverse Engineering Toolkit"; + lbliRET.backgroundColor = [UIColor clearColor]; + lbliRET.textColor = [UIColor whiteColor]; + lbliRET.font = [UIFont fontWithName:@"Arial-BoldMT" size:15.0]; + lbliRET.textAlignment = NSTextAlignmentCenter; + + //ADD THE MESSAGE LABEL + lblMessage = [[UILabel alloc] + initWithFrame:CGRectMake(0,100,320,100)]; + lblMessage.numberOfLines = 0; + lblMessage.lineBreakMode = true; + lblMessage.text = @"For on device analysis and reversing."; + lblMessage.backgroundColor = [UIColor clearColor]; + lblMessage.textColor = [UIColor whiteColor]; + lblMessage.font = [UIFont fontWithName:@"Arial-BoldMT" size:10.0]; + lblMessage.textAlignment = NSTextAlignmentCenter; + + //ADD THE BUTTON + UIButton*btnStart = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + btnStart.frame = CGRectMake(105,175,100,35); + btnStart.backgroundColor = [UIColor whiteColor]; + [btnStart.titleLabel setTextColor:[UIColor blackColor]]; + [btnStart.titleLabel setFont:[UIFont boldSystemFontOfSize:20]]; + [btnStart setTitle:@"Start" forState:UIControlStateNormal]; + [btnStart addTarget:self action:@selector(btnStartPressed:) forControlEvents:UIControlEventTouchUpInside]; + + //ADD THE IP Text LABEL + lblIPText = [[UILabel alloc] + initWithFrame:CGRectMake(0,225,320,100)]; + lblIPText.backgroundColor = [UIColor clearColor]; + lblIPText.textColor = [UIColor whiteColor]; + lblIPText.font = [UIFont fontWithName:@"Arial-BoldMT" size:20.0]; + lblIPText.textAlignment = NSTextAlignmentCenter; + + //ADD THE IP Address LABEL + lblIPAddress = [[UILabel alloc] + initWithFrame:CGRectMake(0,275,320,200)]; + lblIPAddress.backgroundColor = [UIColor clearColor]; + lblIPAddress.textColor = [UIColor blackColor]; + lblIPAddress.font = [UIFont fontWithName:@"Arial-BoldMT" size:15.0]; + lblIPAddress.textAlignment = NSTextAlignmentCenter; + + + + [self.view addSubview:lblHeader]; + [self.view addSubview:lblMessage]; + [self.view addSubview:btnStart]; + [self.view addSubview:lblIPText]; + [self.view addSubview:lblIPAddress]; + [self.view addSubview: lbliRET]; + + + +} + +-(void) btnStartPressed:(UIButton *) sender +{ + + //START THE LISTENER + NSString *strIP; + + if (intButtonState == 0) + { + intButtonState = 1; + + @try + { + //change the button text to show 'Stop' + [sender setTitle: @"Stop" forState: UIControlStateNormal]; + + int loadResult = system("launchctl load /System/Library/LaunchDaemons/com.jensen.iRE.Startup.plist"); + NSLog(@" Load Startup Result: %i", loadResult); + + if(loadResult == 0) + strIP = [self getIPAddress]; + strIP = [strIP stringByAppendingString:@":5555"]; + lblIPText.text = @"Navigate your browser to:"; + lblIPAddress.text = strIP; + + } + @catch (NSException *exception) + { + NSLog( @"NSException caught "); + NSLog( @"Name: %@", exception.name); + NSLog( @"Reason: %@", exception.reason); + } + @finally + { + NSLog( @"In finally block."); + } + + + } + else if (intButtonState == 1) + { + //STOP THE LISTENER + + intButtonState = 0; + + @try { + //change the button text to show 'Start' + [sender setTitle: @"Start" forState: UIControlStateNormal]; + int unloadStart = system("launchctl unload /System/Library/LaunchDaemons/com.jensen.iRE.Startup.plist"); + NSLog(@"Unload Start Result: %i", unloadStart); + + lblIPText.text = @""; + lblIPAddress.text = @""; + + } + @catch (NSException *exception) { + NSLog( @"NSException caught "); + NSLog( @"Name: %@", exception.name); + NSLog( @"Reason: %@", exception.reason); + } + @finally { + NSLog( @"In finally block."); + } + + } + +} + + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +-(BOOL)shouldAutorotate +{ + return NO; +} + +-(NSUInteger)supportedInterfaceOrientations +{ + return UIInterfaceOrientationMaskPortrait; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return (interfaceOrientation == UIInterfaceOrientationPortrait); +} + +- (NSString *)getIPAddress { + + NSString *address = @"error"; + struct ifaddrs *interfaces = NULL; + struct ifaddrs *temp_addr = NULL; + int success = 0; + // retrieve the current interfaces - returns 0 on success + success = getifaddrs(&interfaces); + if (success == 0) { + // Loop through linked list of interfaces + temp_addr = interfaces; + while(temp_addr != NULL) { + if(temp_addr->ifa_addr->sa_family == AF_INET) { + // Check if interface is en0 which is the wifi connection on the iPhone + if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"]) { + // Get NSString from C String + address = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)]; + + } + + } + + temp_addr = temp_addr->ifa_next; + } + } + // Free memory + freeifaddrs(interfaces); + return address; + +} + + +@end diff --git a/com.jensen.iRE.Startup.plist b/com.jensen.iRE.Startup.plist new file mode 100755 index 0000000000000000000000000000000000000000..3a01aa3277e1021a9d46c3fe81cf93315f9f3e08 GIT binary patch literal 429 zcmaiv&q@O^5XL9|?OOk&R;!l^(t{V-?Gp$K77rFJZKYJukln^MvYUh?Tj)c0_oUP} zQ9@nF)Ki#m;1;$cK^IS7?Y8B@!pFadAYe5%xxiR^n`VI4nh z7G1a?GdhU42-L_9q#(HR=O$?}J!INfqyPNJC4%>U_fhU=UuW)6DVC{!%Y + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.jensen.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIBackgroundModes + + fetch + + UIMainStoryboardFile + Main_iPhone + UIMainStoryboardFile~ipad + Main_iPad + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/iRE-Prefix.pch b/iRE-Prefix.pch new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ b/iRE-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/main.m b/main.m new file mode 100644 index 0000000..4752d17 --- /dev/null +++ b/main.m @@ -0,0 +1,22 @@ +// +// main.m +// iRE +// +// Created by veracode on 11/8/13. +// Copyright (c) 2013 veracode. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + setuid(0); + setgid(0); + + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } + +}