From e9d5ec02433655f7b2e40b96f683838169883637 Mon Sep 17 00:00:00 2001 From: Gregor Haas Date: Mon, 9 Dec 2019 15:40:03 -0500 Subject: [PATCH] Some tests for payloads on the remote end --- checkm8_remote/CMakeLists.txt | 2 +- checkm8_remote/include/payload.h | 4 ++++ checkm8_remote/src/exploit.c | 1 - checkm8_remote/src/payload.c | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 checkm8_remote/include/payload.h create mode 100644 checkm8_remote/src/payload.c diff --git a/checkm8_remote/CMakeLists.txt b/checkm8_remote/CMakeLists.txt index d0775a7..14b5244 100644 --- a/checkm8_remote/CMakeLists.txt +++ b/checkm8_remote/CMakeLists.txt @@ -2,6 +2,6 @@ set(CMAKE_C_STANDARD 99) set(CMAKE_C_FLAGS -g) include_directories(include) -add_executable(checkm8_remote main.c src/libusb_helpers.c src/commands.c src/exploit.c) +add_executable(checkm8_remote main.c src/libusb_helpers.c src/commands.c src/exploit.c src/payload.c) target_link_libraries(checkm8_remote checkm8_libusb pthread udev) \ No newline at end of file diff --git a/checkm8_remote/include/payload.h b/checkm8_remote/include/payload.h new file mode 100644 index 0000000..15bb183 --- /dev/null +++ b/checkm8_remote/include/payload.h @@ -0,0 +1,4 @@ +#ifndef IPWNDFU_REWRITE_C_PAYLOAD_H +#define IPWNDFU_REWRITE_C_PAYLOAD_H + +#endif //IPWNDFU_REWRITE_C_PAYLOAD_H diff --git a/checkm8_remote/src/exploit.c b/checkm8_remote/src/exploit.c index e1ec907..2fe664a 100644 --- a/checkm8_remote/src/exploit.c +++ b/checkm8_remote/src/exploit.c @@ -2,7 +2,6 @@ #include #include -#include "checkm8.h" #include "libusb_helpers.h" int complete_stage(int stage_function(struct libusb_device_bundle *bundle)) diff --git a/checkm8_remote/src/payload.c b/checkm8_remote/src/payload.c new file mode 100644 index 0000000..98b23eb --- /dev/null +++ b/checkm8_remote/src/payload.c @@ -0,0 +1,14 @@ +#include "../include/payload.h" + +#include +#include + +void read_elf_header(const char *filename) +{ + Elf64_Ehdr header; + FILE *file = fopen(filename, "rb"); + if(file) + { + fread(&header, 1, sizeof(header), file); + } +} \ No newline at end of file