diff --git a/c8_remote/src/exploit.c b/c8_remote/src/exploit.c index de3e195..ce1d05f 100644 --- a/c8_remote/src/exploit.c +++ b/c8_remote/src/exploit.c @@ -150,6 +150,12 @@ int stage3_function(struct pwned_device *dev) checkm8_debug_indent("exploit stage 3\n"); 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); ow_len = ftell(overwrite_file); rewind(overwrite_file); @@ -159,6 +165,12 @@ int stage3_function(struct pwned_device *dev) fclose(overwrite_file); 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); pl_len = ftell(payload_file); rewind(payload_file);