mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 09:47:01 +02:00
refactor: libciderra1n support (#764)
* refactor refactor: remove wdi refactor: move openra1n to its own library refactor: move everything standalone file to src root * submodule * okay these shouldnt of been included * remove * readd * fix openra1n libusb * liteusb for ra1ncovery * fix action * token * whatever lwra bw apwxidix * I knew this was gonna happen * fix mac build * what if this doesnt work * okay bro * lzma resources * rename * use idevice++, fix multiple devices, enter recovery * whatever * fix * --force-enable-ssv * improve exploit stuff, mirror tui logic to gui also cooool logging for libopenra1n * fix idevice windows build * lets not be fancy * new idevice patch * easier to read * lets hope this action works! * remove useless ifs * not required for non tui * PLEASE COMPILE * gsed lmao * this might work idk * whatever bro * ah * amd fix * fix ts * fix * licensing * update paleinfo * LETS NOT do that * forgot a file
This commit is contained in:
128 files changed
+12054
-3114
No files matched your search
@@ -0,0 +1,129 @@
|
||||
diff --git a/cpp/include/idevice++/dvt/network_monitor.hpp b/cpp/include/idevice++/dvt/network_monitor.hpp
|
||||
index 229bf6d..6dcf2a2 100644
|
||||
--- a/cpp/include/idevice++/dvt/network_monitor.hpp
|
||||
+++ b/cpp/include/idevice++/dvt/network_monitor.hpp
|
||||
@@ -22,7 +22,7 @@ struct CppSocketAddress {
|
||||
|
||||
/// A decoded network event from the device
|
||||
struct NetworkEvent {
|
||||
- IdeviceNetworkEventType event_type = Unknown;
|
||||
+ IdeviceNetworkEventType event_type = NetworkEventUnknown;
|
||||
|
||||
// InterfaceDetection
|
||||
uint32_t interface_index = 0;
|
||||
diff --git a/ffi/Cargo.toml b/ffi/Cargo.toml
|
||||
index 91bd981..933e743 100644
|
||||
--- a/ffi/Cargo.toml
|
||||
+++ b/ffi/Cargo.toml
|
||||
@@ -71,7 +71,7 @@ tunnel_tcp_stack = ["idevice/tunnel_tcp_stack"]
|
||||
tunnel_tcp_stack_pcap = ["idevice/tunnel_tcp_stack_pcap"]
|
||||
tss = ["idevice/tss"]
|
||||
tunneld = ["idevice/tunneld"]
|
||||
-usbmuxd = ["idevice/usbmuxd"]
|
||||
+usbmuxd = ["idevice/usbmuxd", "dep:futures"]
|
||||
wda = ["idevice/wda", "dep:serde_json"]
|
||||
xpc = ["idevice/xpc"]
|
||||
screenshotr = ["idevice/screenshotr"]
|
||||
diff --git a/ffi/src/dvt/network_monitor.rs b/ffi/src/dvt/network_monitor.rs
|
||||
index e089ffa..264b36d 100644
|
||||
--- a/ffi/src/dvt/network_monitor.rs
|
||||
+++ b/ffi/src/dvt/network_monitor.rs
|
||||
@@ -18,7 +18,7 @@ pub enum IdeviceNetworkEventType {
|
||||
InterfaceDetection = 0,
|
||||
ConnectionDetection = 1,
|
||||
ConnectionUpdate = 2,
|
||||
- Unknown = 255,
|
||||
+ NetworkEventUnknown = 255,
|
||||
}
|
||||
|
||||
/// A socket address (IPv4 or IPv6), represented as a null-terminated string + port
|
||||
@@ -286,7 +286,7 @@ pub unsafe extern "C" fn network_monitor_next_event(
|
||||
unknown_type: 0,
|
||||
},
|
||||
NetworkEvent::Unknown(t) => IdeviceNetworkEvent {
|
||||
- event_type: IdeviceNetworkEventType::Unknown,
|
||||
+ event_type: IdeviceNetworkEventType::NetworkEventUnknown,
|
||||
interface_index: 0,
|
||||
interface_name: null_mut(),
|
||||
local_addr: make_socket_addr(None),
|
||||
diff --git a/ffi/src/lockdown.rs b/ffi/src/lockdown.rs
|
||||
index cb04c27..d13a25a 100644
|
||||
--- a/ffi/src/lockdown.rs
|
||||
+++ b/ffi/src/lockdown.rs
|
||||
@@ -3,14 +3,14 @@
|
||||
use std::ptr::null_mut;
|
||||
|
||||
use idevice::{
|
||||
- IdeviceError, IdeviceService, RsdService as _, lockdown::LockdownClient,
|
||||
+ IdeviceError, IdeviceService, lockdown::LockdownClient,
|
||||
provider::IdeviceProvider,
|
||||
};
|
||||
use plist_ffi::plist_t;
|
||||
|
||||
use crate::{
|
||||
- IdeviceFfiError, IdeviceHandle, IdevicePairingFile, core_device_proxy::AdapterHandle, ffi_err,
|
||||
- provider::IdeviceProviderHandle, rsd::RsdHandshakeHandle, run_sync_local,
|
||||
+ IdeviceFfiError, IdeviceHandle, IdevicePairingFile, ffi_err,
|
||||
+ provider::IdeviceProviderHandle, run_sync_local,
|
||||
};
|
||||
|
||||
pub struct LockdowndClientHandle(pub LockdownClient);
|
||||
@@ -55,45 +55,6 @@ pub unsafe extern "C" fn lockdownd_connect(
|
||||
}
|
||||
}
|
||||
|
||||
-/// Creates a new LockdownClient via RSD
|
||||
-///
|
||||
-/// # Arguments
|
||||
-/// * [`provider`] - An adapter created by this library
|
||||
-/// * [`handshake`] - An RSD handshake from the same provider
|
||||
-/// * [`client`] - On success, will be set to point to a newly allocated LockdownClient handle
|
||||
-///
|
||||
-/// # Returns
|
||||
-/// An IdeviceFfiError on error, null on success
|
||||
-///
|
||||
-/// # Safety
|
||||
-/// `provider` must be a valid pointer to a handle allocated by this library
|
||||
-/// `handshake` must be a valid pointer to a handle allocated by this library
|
||||
-/// `client` must be a valid, non-null pointer to a location where the handle will be stored
|
||||
-#[unsafe(no_mangle)]
|
||||
-pub unsafe extern "C" fn lockdownd_connect_rsd(
|
||||
- provider: *mut AdapterHandle,
|
||||
- handshake: *mut RsdHandshakeHandle,
|
||||
- client: *mut *mut LockdowndClientHandle,
|
||||
-) -> *mut IdeviceFfiError {
|
||||
- if provider.is_null() || handshake.is_null() || client.is_null() {
|
||||
- return ffi_err!(IdeviceError::FfiInvalidArg);
|
||||
- }
|
||||
- let res: Result<LockdownClient, IdeviceError> = run_sync_local(async move {
|
||||
- let provider_ref = unsafe { &mut (*provider).0 };
|
||||
- let handshake_ref = unsafe { &mut (*handshake).0 };
|
||||
- LockdownClient::connect_rsd(provider_ref, handshake_ref).await
|
||||
- });
|
||||
-
|
||||
- match res {
|
||||
- Ok(r) => {
|
||||
- let boxed = Box::new(LockdowndClientHandle(r));
|
||||
- unsafe { *client = Box::into_raw(boxed) };
|
||||
- null_mut()
|
||||
- }
|
||||
- Err(e) => ffi_err!(e),
|
||||
- }
|
||||
-}
|
||||
-
|
||||
/// Creates a new LockdowndClient from an existing Idevice connection
|
||||
///
|
||||
/// # Arguments
|
||||
diff --git a/idevice/src/lib.rs b/idevice/src/lib.rs
|
||||
index b208525..d8d8109 100644
|
||||
--- a/idevice/src/lib.rs
|
||||
+++ b/idevice/src/lib.rs
|
||||
@@ -51,7 +51,7 @@ pub mod tunnel;
|
||||
pub use xpc::RemoteXpcClient;
|
||||
|
||||
use plist_macro::{plist, pretty_print_dictionary, pretty_print_plist};
|
||||
-use provider::{IdeviceProvider, RsdProvider};
|
||||
+use provider::IdeviceProvider;
|
||||
#[cfg(feature = "rustls")]
|
||||
use rustls::{crypto::CryptoProvider, pki_types::ServerName};
|
||||
use std::{
|
||||
@@ -1,12 +0,0 @@
|
||||
--- a/src/notification_proxy.c 2026-06-19 21:43:36
|
||||
+++ b/src/notification_proxy.c 2026-06-20 16:44:12
|
||||
@@ -31,7 +31,8 @@
|
||||
#include "property_list_service.h"
|
||||
#include "common/debug.h"
|
||||
|
||||
-#ifdef WIN32
|
||||
+#ifdef _WIN32
|
||||
+#include <windows.h>
|
||||
#define sleep(x) Sleep(x*1000)
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
diff --git a/include/liteusb.h b/include/liteusb.h
|
||||
index 4f4033a..ab9d48a 100644
|
||||
--- a/include/liteusb.h
|
||||
+++ b/include/liteusb.h
|
||||
@@ -134,6 +134,10 @@ typedef struct {
|
||||
#endif
|
||||
} liteusb_handle_t;
|
||||
|
||||
+#ifdef __cplusplus
|
||||
+extern "C" {
|
||||
+#endif
|
||||
+
|
||||
const char *liteusb_strerror(liteusb_err_t err);
|
||||
liteusb_err_t liteusb_init(uint32_t flags);
|
||||
void liteusb_deinit(void);
|
||||
@@ -154,4 +158,8 @@ liteusb_err_t liteusb_upload(liteusb_handle_t *handle, uint32_t endpoint, void *
|
||||
liteusb_err_t liteusb_get_device_desc(liteusb_handle_t *handle, liteusb_device_desc_t *desc);
|
||||
liteusb_err_t liteusb_get_device_serial_num(liteusb_handle_t *handle, char **serial_num);
|
||||
|
||||
-#endif /* LITEUSB_HEADER_H */
|
||||
\ No newline at end of file
|
||||
+#ifdef __cplusplus
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+#endif /* LITEUSB_HEADER_H */
|
||||
@@ -1,33 +0,0 @@
|
||||
From a2d012f3ba459f6debe636b576ad9aeab7b3c2aa Mon Sep 17 00:00:00 2001
|
||||
From: Nick Chan <[email protected]>
|
||||
Date: Sat, 27 May 2023 23:50:23 +0800
|
||||
Subject: [PATCH] Allow empty x509 cert issuer
|
||||
|
||||
---
|
||||
library/x509_crt.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/library/x509_crt.c b/library/x509_crt.c
|
||||
index cf62532f2..ef25b3d77 100644
|
||||
--- a/library/x509_crt.c
|
||||
+++ b/library/x509_crt.c
|
||||
@@ -1061,13 +1061,13 @@ static int x509_crt_parse_der_core(mbedtls_x509_crt *crt,
|
||||
|
||||
if ((ret = mbedtls_asn1_get_tag(&p, end, &len,
|
||||
MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE)) != 0) {
|
||||
- mbedtls_x509_crt_free(crt);
|
||||
- return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT, ret);
|
||||
+ /*mbedtls_x509_crt_free(crt);
|
||||
+ return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT, ret);*/
|
||||
}
|
||||
|
||||
if ((ret = mbedtls_x509_get_name(&p, p + len, &crt->issuer)) != 0) {
|
||||
- mbedtls_x509_crt_free(crt);
|
||||
- return ret;
|
||||
+ /*mbedtls_x509_crt_free(crt);
|
||||
+ return ret;*/
|
||||
}
|
||||
|
||||
crt->issuer_raw.len = p - crt->issuer_raw.p;
|
||||
--
|
||||
2.39.1
|
||||
Reference in new issue
Block a user