From 6e9e3f770357dddc5f30666c6617d6762ede2ed8 Mon Sep 17 00:00:00 2001 From: Nick Chan Date: Thu, 11 Jan 2024 06:12:48 +0800 Subject: [PATCH] exploit options --- usprebooter/ContentView.swift | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/usprebooter/ContentView.swift b/usprebooter/ContentView.swift index 2efa1e0..2ccd6d1 100644 --- a/usprebooter/ContentView.swift +++ b/usprebooter/ContentView.swift @@ -2,7 +2,12 @@ import SwiftUI struct ContentView: View { @State var LogItems: [String.SubSequence] = [""] - + private let puaf_method_options = ["physpuppet", "smith", "landa"] + @AppStorage("puaf_method") private var puaf_method = 1.0 + private let kwrite_method_options = ["kqueue_workloop_ctl", "sem_open"]; + @AppStorage("kwrite_method") private var kwrite_method = 1.0; + private let kread_method_options = ["dup"," sem_open"]; + @AppStorage("kread_method") private var kread_method = 1.0; @AppStorage("headroom") var staticHeadroomMB: Double = 384.0 @AppStorage("pages") var pUaFPages: Double = 3072.0 @Binding var useNewUI: Bool @@ -12,7 +17,7 @@ struct ContentView: View { HStack { Button("do the thing!") { DispatchQueue.main.async { - do_kopen(UInt64(pUaFPages), 1, 1, 1, Int(staticHeadroomMB), true) + do_kopen(UInt64(pUaFPages), UInt64(puaf_method), UInt64(kread_method), UInt64(kwrite_method), Int(staticHeadroomMB), true) fix_exploit() go() do_kclose() @@ -31,6 +36,19 @@ struct ContentView: View { Text("puaf pages: \(Int(pUaFPages))") Slider(value: $pUaFPages, in: 16...4096, step: 16.0) } + HStack { + Text("puaf method: \(puaf_method_options[Int(puaf_method)])") + Slider(value: $puaf_method, in: 0...Double(puaf_method_options.count-1), step: 1.0) + } + HStack { + Text("kread method: \(kread_method_options[Int(kread_method)])") + Slider(value: $kread_method, in: 0...Double(kread_method_options.count-1), step: 1.0) + } + HStack { + Text("kwrite method: \(kwrite_method_options[Int(kwrite_method)])") + Slider(value: $kwrite_method, in: 0...Double(kwrite_method_options.count-1), step: 1.0) + } + ScrollView { ScrollViewReader { scroll in VStack(alignment: .leading) {