added more logs,

fixed parameter
allocing 1 more byte (0 terminated string) of buffer for apticket
This commit is contained in:
tihmstar 2016-12-31 19:52:52 +01:00
parent 64fbd4d536
commit 6b0085ff6a
2 changed files with 10 additions and 7 deletions

View file

@ -202,8 +202,8 @@ void futurerestore::loadAPTickets(const vector<const char *> &apticketPaths){
size_t fSize = ftell(f);
fseek(f, 0, SEEK_SET);
char *buf = (char*)malloc(fSize);
memset(buf, 0, fSize);
char *buf = (char*)malloc(fSize+1);
memset(buf, 0, fSize+1);
fread(buf, fSize, 1, f);
fclose(f);
@ -222,6 +222,7 @@ void futurerestore::loadAPTickets(const vector<const char *> &apticketPaths){
_im4ms.push_back(im4m);
_aptickets.push_back(apticket);
printf("reading ticket %s done\n",apticketPath);
}
}

View file

@ -22,7 +22,7 @@
static struct option longopts[] = {
{ "apticket", required_argument, NULL, 't' },
{ "baseband", required_argument, NULL, 'b' },
{ "baseband-plist", required_argument, NULL, 'p' },
{ "baseband-manifest", required_argument, NULL, 'p' },
{ "sep", required_argument, NULL, 's' },
{ "sep-manifest", required_argument, NULL, 'm' },
{ "wait", no_argument, NULL, 'w' },
@ -76,10 +76,8 @@ int main(int argc, const char * argv[]) {
vector<const char*> apticketPaths;
t_devicevals devVals;
t_iosVersion versVals;
memset(&devVals, 0, sizeof(devVals));
memset(&versVals, 0, sizeof(versVals));
t_devicevals devVals = {0};
t_iosVersion versVals = {0};
if (argc == 1){
cmd_help();
@ -133,6 +131,8 @@ int main(int argc, const char * argv[]) {
futurerestore client;
if (!client.init()) reterror(-3,"can't init, no device found\n");
printf("futurerestore init done\n");
try {
if (apticketPaths.size()) client.loadAPTickets(apticketPaths);
@ -168,6 +168,8 @@ int main(int argc, const char * argv[]) {
client.setBasebandManifestPath(basebandManifestPath);
}
printf("Did set sep+baseband path and firmware\n");
versVals.basebandMode = kBasebandModeWithoutBaseband;
if (!(isSepManifestSigned = isManifestSignedForDevice(client.sepManifestPath(), &devVals, &versVals))){