Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup xcode
uses: maxim-lobanov/setup-xcode@v1
with:
Expand Down
1 change: 0 additions & 1 deletion lara.xcodeproj/.gitignore

This file was deleted.

59 changes: 59 additions & 0 deletions lara/classes/FindUUID.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#import <Foundation/Foundation.h>
#include <dlfcn.h>
#include <objc/runtime.h>

@interface LSApplicationWorkspace : NSObject
+ (id)defaultWorkspace;
- (id)allInstalledApplications;
@end

@interface LSApplicationProxy : NSObject
- (NSString *)applicationIdentifier;
- (NSString *)localizedName;
- (NSURL *)containerURL;
@end

NSString* get_container_uuid_for_app(NSString *targetName) {
if (!targetName || [targetName length] == 0) {
return nil;
}

void *handle = dlopen("/System/Library/PrivateFrameworks/MobileCoreServices.framework/MobileCoreServices", RTLD_NOW);
if (!handle) {
handle = dlopen("/System/Library/Frameworks/CoreServices.framework/CoreServices", RTLD_NOW);
}

if (!handle) {
return nil;
}

Class workspaceClass = objc_getClass("LSApplicationWorkspace");
if (!workspaceClass) {
dlclose(handle);
return nil;
}

id workspace = [workspaceClass defaultWorkspace];
NSArray *apps = [workspace allInstalledApplications];
NSString *foundUUID = nil;

NSString *searchQuery = [targetName lowercaseString];

for (LSApplicationProxy *app in apps) {
NSString *appName = [[app localizedName] lowercaseString];
NSString *bundleId = [[app applicationIdentifier] lowercaseString];

if ((appName && [appName rangeOfString:searchQuery].location != NSNotFound) ||
(bundleId && [bundleId rangeOfString:searchQuery].location != NSNotFound)) {

NSURL *containerURL = [app containerURL];
if (containerURL) {
foundUUID = [containerURL path];
break;
}
}
}

dlclose(handle);
return foundUUID;
}
1 change: 1 addition & 0 deletions lara/kexploit/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ uint64_t proc_self(void);
uint64_t task_self(void);

int crashproc(const char* pid);
int proc_pause_resume(const char *name, bool resume)

#ifdef __cplusplus
}
Expand Down
21 changes: 21 additions & 0 deletions lara/kexploit/utils.m
Original file line number Diff line number Diff line change
Expand Up @@ -710,3 +710,24 @@ int crashproc(const char* name) {
ds_kwrite64(state + offsetof(struct arm_saved_state64, sp), 0x1337133713371337);
return 0;
}

int proc_pause_resume(const char *name, bool resume) {
uint64_t proc = procbyname(name);
pid_t pid = (pid_t)ds_kread32(proc + off_proc_p_pid);
mach_port_t task = MACH_PORT_NULL;
kern_return_t kr =
task_for_pid(mach_task_self(), pid, &task);
if (resume) {
kr = task_resume(task);
} else {
kr = task_suspend(task);
}
if (kr != KERN_SUCCESS) {
mach_port_deallocate(mach_task_self(), task);
}
printf("%s %s\n",
name,
resume ? "resumed" : "suspended");
mach_port_deallocate(mach_task_self(), task);
return 0;
}
21 changes: 19 additions & 2 deletions lara/views/tweaks/ToolsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct ToolsView: View {
@State private var pid: pid_t = getpid()
@State private var status: String?
@State private var crashname: String = "SpringBoard"
@State private var pausedProcesses: Set<String> = []

private enum tokenclass: String, CaseIterable, Identifiable {
case read = "com.apple.app-sandbox.read"
Expand Down Expand Up @@ -156,10 +157,26 @@ struct ToolsView: View {
}
}
.disabled(crashname.isEmpty)

Button("Pause") {
crashname.withCString { cstr in
_ = proc_pause_resume(cstr, false)
pausedProcesses.insert(crashname)
}
}
.disabled(crashname.isEmpty || pausedProcess.contains(crashname))

Button("Resume") {
crashname.withCString { cstr in
_ = proc_pause_resume(cstr, true)
}
}
.disabled(crashname.isEmpty || !pausedProcess.contains(crashname))

} header: {
Text("Crasher")
Text("Task Manager")
} footer: {
Text("Crashes the selected process")
Text("Pause, Resume or Crash a Selected Process")
}

Section {
Expand Down
26 changes: 26 additions & 0 deletions project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: lara

options:
bundleIdPrefix: com.roooot
deploymentTarget:
iOS: 17.0

targets:
Lara:
type: application
platform: iOS

sources:
- path: lara

resources:
- path: lara/assets/lara.png

settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.roooot.lara
INFOPLIST_FILE: lara/Info.plist
SWIFT_VERSION: 5.0
ENABLE_BITCODE: NO
CLANG_ENABLE_OBJC_ARC: YES
SWIFT_OBJC_BRIDGING_HEADER: lara/lara-Bridging-Header.h
7 changes: 5 additions & 2 deletions scripts/build_ipa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ mkdir -p build
echo "Build Started!"
echo

SCHEME=$(xcodebuild -list -project lara.xcodeproj | sed -n '/Schemes:/,$p' | tail -n +2 | head -n 1 | xargs)
echo "Scheme: $SCHEME"

xcodebuild \
-project lara.xcodeproj \
-scheme lara \
-scheme "$SCHEME" \
-configuration Debug \
-sdk iphoneos \
-arch arm64e \
Expand All @@ -18,7 +21,7 @@ xcodebuild \
CODE_SIGN_IDENTITY="" \
CODE_SIGN_ENTITLEMENTS="Config/lara.entitlements" \
archive \
-archivePath "$PWD/build/lara.xcarchive" 2>&1 | xcpretty
-archivePath "$PWD/build/lara.xcarchive"

APP_PATH="$PWD/build/lara.xcarchive/Products/Applications/lara.app"
if [ ! -d "$APP_PATH" ]; then
Expand Down