diff --git a/CMakeLists.txt b/CMakeLists.txt index a553ac4..089db8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,5 +3,7 @@ project(checkm8_tool) enable_language(C) include_directories(include) + +#add_subdirectory(c8_arduino) add_subdirectory(c8_remote) add_subdirectory(c8_payloads) diff --git a/c8_remote/src/command.c b/c8_remote/src/command.c index f814f39..a905e2a 100644 --- a/c8_remote/src/command.c +++ b/c8_remote/src/command.c @@ -228,10 +228,12 @@ struct dev_cmd_resp *dev_read_memory(struct pwned_device *dev, long long addr, i resp = command(dev, (unsigned char *) &cmd_args, 5 * sizeof(unsigned long long), 16 + amount); ret->ret = resp->ret; + ret->retval = resp->retval; if(IS_CHECKM8_FAIL(resp->ret)) { checkm8_debug_indent("\tlast transfer failed, aborting\n"); + free_dev_cmd_resp(resp); free(ret->data); ret->data = NULL; @@ -240,7 +242,7 @@ struct dev_cmd_resp *dev_read_memory(struct pwned_device *dev, long long addr, i else { checkm8_debug_indent("\tsuccessfully copied chunk\n"); - memcpy(&ret->data[index], &resp->data[8], amount); + memcpy(&ret->data[index], resp->data, amount); free_dev_cmd_resp(resp); }