Began restructuring project to include payload building
This commit is contained in:
@@ -1,15 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(ipwndfu_rewrite_c)
|
||||
enable_language(C)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_FLAGS -g)
|
||||
|
||||
add_executable(ipwndfu main.c conf.h
|
||||
exploit/libusb_helpers.c exploit/libusb_helpers.h
|
||||
exploit/exploit.c exploit/checkm8.h exploit/commands.c)
|
||||
|
||||
add_library(libusb_checkm8
|
||||
conf.h libusb/config.h
|
||||
add_library(checkm8_libusb
|
||||
checkm8_remote/conf.h libusb/config.h
|
||||
|
||||
libusb/src/core.c libusb/src/descriptor.c libusb/src/hotplug.c
|
||||
libusb/src/io.c libusb/src/strerror.c libusb/src/sync.c
|
||||
@@ -19,4 +13,5 @@ add_library(libusb_checkm8
|
||||
libusb/src/os/threads_posix.c libusb/src/os/poll_posix.c
|
||||
libusb/src/os/linux_usbfs.h libusb/src/os/threads_posix.h libusb/src/os/poll_posix.h)
|
||||
|
||||
target_link_libraries(ipwndfu libusb_checkm8 pthread udev)
|
||||
add_subdirectory(checkm8_remote)
|
||||
add_subdirectory(checkm8_payload)
|
||||
|
||||
6
checkm8_payload/CMakeLists.txt
Normal file
6
checkm8_payload/CMakeLists.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
enable_language(ASM)
|
||||
|
||||
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||
set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc)
|
||||
set(CMAKE_ASM_COMPILER /usr/bin/aarch64-linux-gnu-as)
|
||||
|
||||
9
checkm8_remote/CMakeLists.txt
Normal file
9
checkm8_remote/CMakeLists.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_FLAGS -g)
|
||||
|
||||
add_executable(checkm8_remote main.c conf.h
|
||||
libusb_helpers.c libusb_helpers.h exploit.c
|
||||
checkm8.h commands.c)
|
||||
|
||||
|
||||
target_link_libraries(checkm8_remote libusb_checkm8 pthread udev)
|
||||
@@ -65,12 +65,12 @@ int stage3_function(struct libusb_device_bundle *bundle)
|
||||
{
|
||||
printf("~~~ Exploit stage 3 ~~~\n");
|
||||
unsigned char overwrite_buf[1524];
|
||||
FILE *overwrite_file = fopen("/home/grg/Projects/School/NCSU/iphone_aes_sc/ipwndfu_rewrite_c/exploit/bin/overwrite.bin", "r");
|
||||
FILE *overwrite_file = fopen("/home/grg/Projects/School/NCSU/iphone_aes_sc/ipwndfu_rewrite_c/checkm8_remote/bin/overwrite.bin", "r");
|
||||
fread(overwrite_buf, 1524, 1, overwrite_file);
|
||||
fclose(overwrite_file);
|
||||
|
||||
unsigned char payload_buf[2400];
|
||||
FILE *payload_file = fopen("/home/grg/Projects/School/NCSU/iphone_aes_sc/ipwndfu_rewrite_c/exploit/bin/payload.bin", "r");
|
||||
FILE *payload_file = fopen("/home/grg/Projects/School/NCSU/iphone_aes_sc/ipwndfu_rewrite_c/checkm8_remote/bin/payload.bin", "r");
|
||||
fread(payload_buf, 2400, 1, payload_file);
|
||||
fclose(payload_file);
|
||||
|
||||
@@ -6,7 +6,7 @@ int main()
|
||||
int status = exploit_device();
|
||||
if(status != 0)
|
||||
{
|
||||
printf("Failed to exploit device\n");
|
||||
printf("Failed to checkm8_remote device\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* config.h. Generated from config.h.in by configure. */
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
#include "../conf.h"
|
||||
#include "../checkm8_remote/conf.h"
|
||||
|
||||
/* Default visibility */
|
||||
#define DEFAULT_VISIBILITY __attribute__((visibility("default")))
|
||||
|
||||
Reference in New Issue
Block a user