From 38477100a6e59cb5e2af4f46cade254bb980b7d9 Mon Sep 17 00:00:00 2001 From: Gregor Haas Date: Mon, 28 Oct 2019 13:21:52 -0400 Subject: [PATCH] Some changes --- .idea/workspace.xml | 1 - CMakeLists.txt | 2 +- {bin => exploit/bin}/overwrite.bin | Bin {bin => exploit/bin}/payload.bin | Bin libusb_helpers.c => exploit/libusb_helpers.c | 1 - libusb_helpers.h => exploit/libusb_helpers.h | 0 main.c => exploit/main.c | 3 ++- 7 files changed, 3 insertions(+), 4 deletions(-) rename {bin => exploit/bin}/overwrite.bin (100%) rename {bin => exploit/bin}/payload.bin (100%) rename libusb_helpers.c => exploit/libusb_helpers.c (99%) rename libusb_helpers.h => exploit/libusb_helpers.h (100%) rename main.c => exploit/main.c (96%) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d6706ad..c99cfa3 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -12,7 +12,6 @@ - diff --git a/CMakeLists.txt b/CMakeLists.txt index bd851fc..f397ffd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,5 +4,5 @@ project(ipwndfu_rewrite_c C) set(CMAKE_C_STANDARD 99) set(CMAKE_C_FLAGS -g) -add_executable(ipwndfu main.c libusb_helpers.c libusb_helpers.h) +add_executable(ipwndfu exploit/main.c exploit/libusb_helpers.c exploit/libusb_helpers.h) target_link_libraries(ipwndfu usb-1.0) diff --git a/bin/overwrite.bin b/exploit/bin/overwrite.bin similarity index 100% rename from bin/overwrite.bin rename to exploit/bin/overwrite.bin diff --git a/bin/payload.bin b/exploit/bin/payload.bin similarity index 100% rename from bin/payload.bin rename to exploit/bin/payload.bin diff --git a/libusb_helpers.c b/exploit/libusb_helpers.c similarity index 99% rename from libusb_helpers.c rename to exploit/libusb_helpers.c index c8f6e23..008f1b6 100644 --- a/libusb_helpers.c +++ b/exploit/libusb_helpers.c @@ -132,7 +132,6 @@ void usb_req_stall(libusb_device_handle *handle) void usb_req_leak(libusb_device_handle *handle) { - printf("Req leak\n"); unsigned char data[0x40]; memset(data, 0, 0x40); libusb1_no_error_ctrl_transfer(handle, 0x80, 6, 0x304, 0x40A, data, 0x40, 1); diff --git a/libusb_helpers.h b/exploit/libusb_helpers.h similarity index 100% rename from libusb_helpers.h rename to exploit/libusb_helpers.h diff --git a/main.c b/exploit/main.c similarity index 96% rename from main.c rename to exploit/main.c index 5af1a0b..a31b1e0 100644 --- a/main.c +++ b/exploit/main.c @@ -78,7 +78,8 @@ int stage2_function(libusb_device_handle *handle) int stage3_function(libusb_device_handle *handle) { unsigned char overwrite_buf[1524]; - FILE *overwrite_file = fopen("/home/grg/Projects/School/NCSU/iphone_aes_sc/ipwndfu_rewrite_c/bin/overwrite.bin", "r"); + FILE *overwrite_file = fopen("/home/grg/Projects/School/NCSU/iphone_aes_sc/ipwndfu_rewrite_c/bin/overwrite.bin", + "r"); fread(overwrite_buf, 1524, 1, overwrite_file); fclose(overwrite_file);