fixed bug when futurerestore would send another stock iBEC when restoring to iOS 10 in pwndfu

This commit is contained in:
tihmstar 2017-12-31 17:41:54 +01:00
parent 17839c1019
commit e740b28b1d

View file

@ -440,6 +440,7 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){
reterror(-91,"Unable to connect to DFU device\n"); reterror(-91,"Unable to connect to DFU device\n");
irecv_get_mode(_client->dfu->client, &mode); irecv_get_mode(_client->dfu->client, &mode);
try { try {
iBSSKeys = libipatcher::getFirmwareKey(_client->device->product_type, _client->build, "iBSS"); iBSSKeys = libipatcher::getFirmwareKey(_client->device->product_type, _client->build, "iBSS");
iBECKeys = libipatcher::getFirmwareKey(_client->device->product_type, _client->build, "iBEC"); iBECKeys = libipatcher::getFirmwareKey(_client->device->product_type, _client->build, "iBEC");
@ -736,7 +737,7 @@ int futurerestore::doRestore(const char *ipsw){
//check for enterpwnrecovery, because we could be in DFU mode //check for enterpwnrecovery, because we could be in DFU mode
if (_enterPwnRecoveryRequested){ if (_enterPwnRecoveryRequested){
if (getDeviceMode(true) != MODE_DFU) if (getDeviceMode(true) != MODE_DFU)
reterror(-6, "unexpected device mode"); reterror(-6, "unexpected device mode\n");
enterPwnRecovery(build_identity); enterPwnRecovery(build_identity);
} }
@ -863,9 +864,10 @@ int futurerestore::doRestore(const char *ipsw){
if (_enterPwnRecoveryRequested && strncmp(client->version, "10.", 3)) //if pwnrecovery send all components decrypted, unless we're dealing with iOS 10 if (_enterPwnRecoveryRequested){ //if pwnrecovery send all components decrypted, unless we're dealing with iOS 10
if (strncmp(client->version, "10.", 3))
client->recovery_custom_component_function = get_custom_component; client->recovery_custom_component_function = get_custom_component;
else if (!_rerestoreiOS9){ }else if (!_rerestoreiOS9){
/* now we load the iBEC */ /* now we load the iBEC */
if (recovery_send_ibec(client, build_identity) < 0) { if (recovery_send_ibec(client, build_identity) < 0) {
reterror(-8,"ERROR: Unable to send iBEC\n"); reterror(-8,"ERROR: Unable to send iBEC\n");
@ -996,7 +998,7 @@ int futurerestore::doJustBoot(const char *ipsw, string bootargs){
reterror(-6, "enterPwnRecoveryRequested is not set, but required"); reterror(-6, "enterPwnRecoveryRequested is not set, but required");
if (getDeviceMode(true) != MODE_DFU && getDeviceMode(false) != MODE_RECOVERY) if (getDeviceMode(true) != MODE_DFU && getDeviceMode(false) != MODE_RECOVERY)
reterror(-6, "unexpected device mode"); reterror(-6, "unexpected device mode\n");
enterPwnRecovery(build_identity, bootargs); enterPwnRecovery(build_identity, bootargs);
client->recovery_custom_component_function = get_custom_component; client->recovery_custom_component_function = get_custom_component;