added a little more error logging

This commit is contained in:
tihmstar 2017-06-18 11:55:13 +02:00
parent b3f684d61b
commit d1e5c41aff

View file

@ -493,11 +493,16 @@ void get_custom_component(struct idevicerestore_client_t* client, plist_t build_
#ifndef HAVE_LIBIPATCHER #ifndef HAVE_LIBIPATCHER
reterror(-404, "compiled without libipatcher"); reterror(-404, "compiled without libipatcher");
#else #else
auto comp = getIPSWComponent(client, build_identity, component); try {
comp = move(libipatcher::decryptFile3((char*)comp.first, comp.second, libipatcher::getFirmwareKey(client->device->product_type, client->build, component))); auto comp = getIPSWComponent(client, build_identity, component);
*data = (unsigned char*)(char*)comp.first; comp = move(libipatcher::decryptFile3((char*)comp.first, comp.second, libipatcher::getFirmwareKey(client->device->product_type, client->build, component)));
*size = comp.second; *data = (unsigned char*)(char*)comp.first;
comp.first = NULL; //don't free on destruction *size = comp.second;
comp.first = NULL; //don't free on destruction
} catch (libipatcher::exception &e) {
reterror(e.code(),"ERROR: libipatcher failed with reason %s\n",e.what());
}
#endif #endif
} }