Fix wifi ipad restores and a few pwndfu changes/fixes. (#17)

* Comment out idevice_event_subscribe to fix hang on Linux

* Enable serial debugging for pwnrecovery

* Update idevicerestore submodule

* Actually set sepBuildIdentity

Co-authored-by: nyuszika7h <nyuszika7h@gmail.com>
This commit is contained in:
Liam(Cryptic) 2021-05-08 02:21:50 -07:00 committed by GitHub
parent 9bff1c4e9b
commit a51a122986
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

2
.gitmodules vendored
View file

@ -3,4 +3,4 @@
url = https://github.com/DanTheMann15/tsschecker.git url = https://github.com/DanTheMann15/tsschecker.git
[submodule "external/idevicerestore"] [submodule "external/idevicerestore"]
path = external/idevicerestore path = external/idevicerestore
url = https://github.com/marijuanARM/idevicerestore.git url = https://github.com/nyuszika7h/idevicerestore.git

@ -1 +1 @@
Subproject commit c8d65a4e132483e28ce47a24d65b41e704b9f312 Subproject commit dacbcbf5543f645c139311fd1cb1a6ebdc1b9900

View file

@ -448,6 +448,8 @@ pair<ptr_smart<char*>, size_t> getIPSWComponent(struct idevicerestore_client_t*
} }
void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){
bootargs = "rd=md0 -restore -v debug=0x14e serial=3";
#ifndef HAVE_LIBIPATCHER #ifndef HAVE_LIBIPATCHER
reterror("compiled without libipatcher"); reterror("compiled without libipatcher");
#else #else
@ -458,7 +460,7 @@ if (_client->image4supported) {
} }
irecv_device_event_subscribe(&_client->irecv_e_ctx, irecv_event_cb, _client); irecv_device_event_subscribe(&_client->irecv_e_ctx, irecv_event_cb, _client);
idevice_event_subscribe(idevice_event_cb, _client); //idevice_event_subscribe(idevice_event_cb, _client);
int mode = 0; int mode = 0;
libipatcher::fw_key iBSSKeys; libipatcher::fw_key iBSSKeys;
@ -648,7 +650,6 @@ void futurerestore::doRestore(const char *ipsw){
}); });
struct idevicerestore_client_t* client = _client; struct idevicerestore_client_t* client = _client;
plist_t build_identity = NULL; plist_t build_identity = NULL;
plist_t sep_build_identity = NULL;
client->ipsw = strdup(ipsw); client->ipsw = strdup(ipsw);
if (!_isUpdateInstall) client->flags |= FLAG_ERASE; if (!_isUpdateInstall) client->flags |= FLAG_ERASE;
@ -706,10 +707,10 @@ void futurerestore::doRestore(const char *ipsw){
retassure(build_identity = getBuildidentityWithBoardconfig(buildmanifest, client->device->hardware_model, _isUpdateInstall),"ERROR: Unable to find any build identities for iPSW\n"); retassure(build_identity = getBuildidentityWithBoardconfig(buildmanifest, client->device->hardware_model, _isUpdateInstall),"ERROR: Unable to find any build identities for iPSW\n");
if (_client->image4supported) { if (_client->image4supported) {
if (!(sep_build_identity = getBuildidentityWithBoardconfig(_sepbuildmanifest, client->device->hardware_model, _isUpdateInstall))){ if (!(client->sepBuildIdentity = getBuildidentityWithBoardconfig(_sepbuildmanifest, client->device->hardware_model, _isUpdateInstall))){
retassure(_isPwnDfu, "ERROR: Unable to find any build identities for SEP\n"); retassure(_isPwnDfu, "ERROR: Unable to find any build identities for SEP\n");
warning("can't find buildidentity for SEP with InstallType=%s. However pwnDFU was requested, so trying fallback to %s",(_isUpdateInstall ? "UPDATE" : "ERASE"),(!_isUpdateInstall ? "UPDATE" : "ERASE")); warning("can't find buildidentity for SEP with InstallType=%s. However pwnDFU was requested, so trying fallback to %s",(_isUpdateInstall ? "UPDATE" : "ERASE"),(!_isUpdateInstall ? "UPDATE" : "ERASE"));
retassure((sep_build_identity = getBuildidentityWithBoardconfig(_sepbuildmanifest, client->device->hardware_model, !_isUpdateInstall)), retassure((client->sepBuildIdentity = getBuildidentityWithBoardconfig(_sepbuildmanifest, client->device->hardware_model, !_isUpdateInstall)),
"ERROR: Unable to find any build identities for SEP\n"); "ERROR: Unable to find any build identities for SEP\n");
} }
} }
@ -829,7 +830,7 @@ void futurerestore::doRestore(const char *ipsw){
if (_client->image4supported) { if (_client->image4supported) {
//check SEP //check SEP
plist_t sep_manifest = plist_dict_get_item(sep_build_identity, "Manifest"); plist_t sep_manifest = plist_dict_get_item(client->sepBuildIdentity, "Manifest");
plist_t sep_sep = plist_copy(plist_dict_get_item(sep_manifest, "SEP")); plist_t sep_sep = plist_copy(plist_dict_get_item(sep_manifest, "SEP"));
plist_dict_set_item(manifest, "SEP", sep_sep); plist_dict_set_item(manifest, "SEP", sep_sep);
unsigned char genHash[48]; //SHA384 digest length unsigned char genHash[48]; //SHA384 digest length
@ -1043,7 +1044,7 @@ void futurerestore::doRestore(const char *ipsw){
if (_client->image4supported) { if (_client->image4supported) {
info("getting SEP ticket\n"); info("getting SEP ticket\n");
retassure(!get_tss_response(client, sep_build_identity, &client->septss), "ERROR: Unable to get signing tickets for SEP\n"); retassure(!get_tss_response(client, client->sepBuildIdentity, &client->septss), "ERROR: Unable to get signing tickets for SEP\n");
retassure(_client->sepfwdatasize && _client->sepfwdata, "SEP is not loaded, refusing to continue"); retassure(_client->sepfwdatasize && _client->sepfwdata, "SEP is not loaded, refusing to continue");
} }