Skip to content

Commit

Permalink
QoL improvements (check nightly_changes.txt)
Browse files Browse the repository at this point in the history
  • Loading branch information
rA9stuff committed Nov 24, 2023
1 parent 14a6f59 commit e123115
Show file tree
Hide file tree
Showing 50 changed files with 2,137 additions and 470 deletions.
Binary file added Frameworks/iPwnder32/boot.a
Binary file not shown.
Binary file added Frameworks/iPwnder32/checkm8.a
Binary file not shown.
Binary file added Frameworks/iPwnder32/ipwnder32.a
Binary file not shown.
Binary file added Frameworks/iPwnder32/ircv.a
Binary file not shown.
Binary file added Frameworks/iPwnder32/partial.a
Binary file not shown.
Binary file added Frameworks/iPwnder32/payload.a
Binary file not shown.
Binary file added Frameworks/ipwnder_lite/checkm8_arm64.a
Binary file not shown.
Binary file added Frameworks/ipwnder_lite/common.a
Binary file not shown.
Binary file added Frameworks/ipwnder_lite/iousb.a
Binary file not shown.
Binary file added Frameworks/ipwnder_lite/limera1n.a
Binary file not shown.
Binary file added Frameworks/ipwnder_lite/main.a
Binary file not shown.
Binary file added Frameworks/ipwnder_lite/payload.a
Binary file not shown.
Binary file added Frameworks/ipwnder_lite/s5l8950x.a
Binary file not shown.
Binary file removed Frameworks/libcrypto.1.1.dylib
Binary file not shown.
Binary file added Frameworks/libcrypto.3.dylib
Binary file not shown.
Binary file added Frameworks/libideviceactivation-1.0.2.dylib
Binary file not shown.
Binary file added Frameworks/libimobiledevice-1.0.6.dylib
Binary file not shown.
Binary file added Frameworks/libimobiledevice-glue-1.0.0.dylib
Binary file not shown.
Binary file modified Frameworks/libirecovery-1.0.3.dylib
100644 → 100755
Binary file not shown.
Binary file removed Frameworks/libplist-2.0.3.dylib
Binary file not shown.
Binary file added Frameworks/libplist-2.0.4.dylib
Binary file not shown.
Binary file added Frameworks/libssl.3.dylib
Binary file not shown.
Binary file modified Frameworks/libusb-1.0.0.dylib
Binary file not shown.
Binary file modified Frameworks/libusbmuxd-2.0.6.dylib
100644 → 100755
Binary file not shown.
Binary file removed LDResources/Binaries/ipwnder_macosx
Binary file not shown.
73 changes: 73 additions & 0 deletions LDUpdater/main.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//
// main.m
// LDUpdater
//
// Created by rA9stuff on 24.11.2023.
//

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
@autoreleasepool {
// grab launch arguments
NSArray *args = [[NSProcessInfo processInfo] arguments];

if ([args count] != 2) {
printf("Usage: LDUpdater <url of LD Bundle>\n");
return -1;
}
NSString *fullURL = [args objectAtIndex:1];

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd-HH-mm-ss"];
NSString *dateString = [formatter stringFromDate:[NSDate date]];
NSString *volumePath = [@"/Volumes/" stringByAppendingString:dateString];

NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/bin/hdiutil"];
[task setArguments:@[@"attach", [NSString stringWithFormat:@"%@", fullURL], @"-nobrowse", @"-mountpoint", volumePath]];
[task launch];
[task waitUntilExit];

if ([task terminationStatus] != 0) {
printf("Error: %d\n", [task terminationStatus]);
return -1;
}
printf("Copying app to /Applications\n");
// use nstask to tell cp to copy the app to /Applications
NSString *appPath = [volumePath stringByAppendingString:@"/LeetDown.app"];
task = [[NSTask alloc] init];
[task setLaunchPath:@"/bin/cp"];
[task setArguments:@[@"-R", appPath, @"/Applications/"]];
[task launch];
[task waitUntilExit];

if ([task terminationStatus] != 0) {
printf("Error copying app to /Applications\n");
return -1;
}
printf("Unmounting dmg\n");
// use nstask to tell hdutil to unmount the dmg
task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/bin/hdiutil"];
[task setArguments:@[@"detach", volumePath]];
[task launch];
[task waitUntilExit];

if ([task terminationStatus] != 0) {
printf("Error unmounting dmg\n");
return -1;
}

printf("Done, relaunching...");

NSTask *launch = [[NSTask alloc] init];
NSString *LDPath = [[NSBundle mainBundle] resourcePath];
LDPath = [[LDPath substringToIndex:[LDPath length] -9] stringByAppendingString:@"MacOS/LeetDown"];
printf("launching %s\n", LDPath.UTF8String);
launch.launchPath = @"/Applications/LeetDown.app/Contents/MacOS/LeetDown";
launch.arguments = @[];
[launch launch]; // fr
}
return 0;
}
311 changes: 270 additions & 41 deletions LeetDown.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

483 changes: 303 additions & 180 deletions LeetDown_M/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions LeetDown_M/DFUHelperViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

#import <Cocoa/Cocoa.h>

@protocol DFUHelperViewControllerDelegate <NSObject>
- (void)viewControllerDidDismiss;
@end

@interface DFUHelperViewController : NSViewController
@property (assign) IBOutlet NSTextField *getreadytext;
@property (assign) IBOutlet NSTextField *getreadyCounter;
Expand All @@ -20,6 +24,5 @@
@property (assign) IBOutlet NSButton *startbutton;
@property (assign) IBOutlet NSButton *cancelout;
@property (nonatomic, assign) BOOL shouldStopSearch;


@end

36 changes: 28 additions & 8 deletions LeetDown_M/DFUHelperViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,33 @@
#import "LeetDownMain.h"
#import "LDD.h"

extern LDD* dfuDevPtr;
NSCondition *LD_conditionVariable;
BOOL LD_signalReceived;

@implementation DFUHelperViewController

- (void) searchForDevices {
- (void) deviceDidEnterDFUMode {

_shouldStopSearch = false;

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

static bool complete = false;

LDD *devptr = new LDD(); // init a temporary device to check if the client device has entered DFU mode.
dfuDevPtr = new LDD(); // init a temporary device to check if the client device has entered DFU mode.

while (!_shouldStopSearch) {
if (devptr -> openConnection(1) == 0) {
devptr -> setAllDeviceInfo();
if (strcmp(devptr -> getDeviceMode(), "DFU") == 0) {
if (dfuDevPtr -> openConnection(1) == 0) {
dfuDevPtr -> setAllDeviceInfo();
if (strcmp(dfuDevPtr -> getDeviceMode(), "DFU") == 0) {
dispatch_async(dispatch_get_main_queue(), ^(){
[self.view.window.contentViewController dismissViewController:self];
});
complete = true;
devptr->freeDevice();
dfuDevPtr->freeDevice();
LD_signalReceived = YES;
[LD_conditionVariable signal];
break;
}
}
Expand Down Expand Up @@ -82,10 +88,18 @@ - (IBAction)startbutton:(id)sender {
_firstcounter.alphaValue = 1;
});

for (int i = 10; i > 0; i--) {


for (int i = 5; i > 0; i--) {
dispatch_async(dispatch_get_main_queue(), ^(){
_firstcounter.stringValue = [[NSString stringWithFormat:@"%d", i] stringByAppendingString:@" seconds"];
});
if (i == 3) {
if (dfuDevPtr -> sendCommand("reset", NO) != 0) {
printf("unable to send reset request\n");
return;
}
}
sleep(1);
}

Expand All @@ -100,15 +114,22 @@ - (IBAction)startbutton:(id)sender {
_lockbuttonimage.alphaValue = 0;
});

// initiate the dfu device search
[self deviceDidEnterDFUMode];

for (int i = 10; i > 0; i--) {
dispatch_async(dispatch_get_main_queue(), ^(){
_secondcounter.stringValue = [[NSString stringWithFormat:@"%d", i] stringByAppendingString:@" seconds"];
});
sleep(1);
}

dispatch_async(dispatch_get_main_queue(), ^(){
_shouldStopSearch = true;
[self.view.window.contentViewController dismissViewController:self];
// send signal to wake up the main thread
LD_signalReceived = YES;
[LD_conditionVariable signal];
});
});
}
Expand Down Expand Up @@ -136,7 +157,6 @@ - (void)viewDidLoad {
_lockbuttonimage.alphaValue = 0;
_homebuttonimage.image = [NSImage imageNamed:@"homebuttonimage"];

[self searchForDevices];
}

@end
22 changes: 16 additions & 6 deletions LeetDown_M/LDD.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#import <Foundation/Foundation.h>
#import "LeetDownMain.h"

// I: LDD is short for "LeetDownDevice"
class LDD {

public:
Expand All @@ -33,12 +34,12 @@ class LDD {
void setAllDeviceInfo();

// getters
const char* getDisplayName() { return displayName; }
const char* getHardwareModel() { return hardwareModel; }
const char* getProductType() { return productType; }
const char* getDisplayName() { return displayName; }
const char* getHardwareModel() { return hardwareModel; }
const char* getProductType() { return productType; }
const struct irecv_device_info* getDevInfo() { return devinfo; }
irecv_client_t getClient() { return client; }
irecv_device_t getDevice() { return device; }
irecv_client_t getClient() { return client; }
irecv_device_t getDevice() { return device; }

// functions
bool deviceConnected();
Expand All @@ -47,7 +48,7 @@ class LDD {
const char* getDeviceMode();
int sendFile(const char*, bool);
int sendCommand(const char*, bool);
void sendDataToNSA();
void pwnDevice();

private:
irecv_client_t client;
Expand All @@ -61,4 +62,13 @@ class LDD {
uint64_t initECID;
};


// Function prototypes for iPwnder32, ipwnder_lite and gaster libraries.
#ifdef __cplusplus
extern "C" {
#endif
void ipwnder_lite_main(int, char**);
int checkm8_32_exploit(irecv_client_t client, irecv_device_t device_info, const struct irecv_device_info *info);
}

#endif /* LDD_h */
9 changes: 4 additions & 5 deletions LeetDown_M/LDD.mm
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@
initECID = 0;
}

void LDD::sendDataToNSA() {

// fake function to get jonathan say leetdown is malicious
}

bool LDD::deviceConnected() {

irecv_error_t error = irecv_open_with_ecid(&client, initECID);
Expand All @@ -139,3 +134,7 @@
}
return false;
}

void LDD::pwnDevice() {
ipwnder_lite_main(0, NULL);
}
9 changes: 7 additions & 2 deletions LeetDown_M/LeetDownMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <sys/types.h>
#include <sys/sysctl.h>

@interface ViewController : NSViewController
@interface ViewController : NSViewController <DFUHelperViewControllerDelegate>
@property (assign) IBOutlet NSView *mainView;
@property (weak) IBOutlet NSTextField *header;
@property (weak) IBOutlet NSScrollView *statusbox;
Expand All @@ -30,16 +30,21 @@
@property (assign) IBOutlet NSButton *dfuhelpoutlet;
@property (assign) IBOutlet NSButton *prefGear;
@property (assign) IBOutlet NSTextField *percentage;
- (int) discoverDevices;
- (int) discoverRestoreDevices:(int)mode;
- (int) discoverNormalDevices;
- (void)updateStatus:(NSString*)text color:(NSColor*)color1;
- (int)exploitDevice;
// Declare a property for your custom NSWindow instance
@property (strong, nonatomic) NSAlert *alert;

@end

@protocol USBDeviceDetectedDelegate <NSObject>

- (void)deviceDetected;
- (int) discoverRestoreDevices:(int)mode;

@end



Loading

0 comments on commit e123115

Please sign in to comment.