explicitly check if these files open
This commit is contained in:
@@ -150,6 +150,12 @@ int stage3_function(struct pwned_device *dev)
|
|||||||
|
|
||||||
checkm8_debug_indent("exploit stage 3\n");
|
checkm8_debug_indent("exploit stage 3\n");
|
||||||
FILE *overwrite_file = fopen(CHECKM8_BIN_BASE "overwrite.bin", "r");
|
FILE *overwrite_file = fopen(CHECKM8_BIN_BASE "overwrite.bin", "r");
|
||||||
|
if(overwrite_file == NULL)
|
||||||
|
{
|
||||||
|
checkm8_debug_indent("\tfailed to open overwrite file\n");
|
||||||
|
return CHECKM8_FAIL_NOINST;
|
||||||
|
}
|
||||||
|
|
||||||
fseek(overwrite_file, 0, SEEK_END);
|
fseek(overwrite_file, 0, SEEK_END);
|
||||||
ow_len = ftell(overwrite_file);
|
ow_len = ftell(overwrite_file);
|
||||||
rewind(overwrite_file);
|
rewind(overwrite_file);
|
||||||
@@ -159,6 +165,12 @@ int stage3_function(struct pwned_device *dev)
|
|||||||
fclose(overwrite_file);
|
fclose(overwrite_file);
|
||||||
|
|
||||||
FILE *payload_file = fopen(CHECKM8_BIN_BASE "payload.bin", "r");
|
FILE *payload_file = fopen(CHECKM8_BIN_BASE "payload.bin", "r");
|
||||||
|
if(payload_file == NULL)
|
||||||
|
{
|
||||||
|
checkm8_debug_indent("\tfailed to open payload file\n");
|
||||||
|
return CHECKM8_FAIL_NOINST;
|
||||||
|
}
|
||||||
|
|
||||||
fseek(payload_file, 0, SEEK_END);
|
fseek(payload_file, 0, SEEK_END);
|
||||||
pl_len = ftell(payload_file);
|
pl_len = ftell(payload_file);
|
||||||
rewind(payload_file);
|
rewind(payload_file);
|
||||||
|
|||||||
Reference in New Issue
Block a user