Cleaned up headers

This commit is contained in:
2020-02-27 16:14:05 -05:00
parent aff4be3a65
commit a9550de75a
27 changed files with 64 additions and 73 deletions

View File

@@ -46,9 +46,25 @@ struct pwned_device
#endif
};
struct dev_cmd_resp
{
int ret;
unsigned long long magic;
unsigned long long retval;
unsigned char *data;
int len;
};
struct pwned_device *exploit_device();
int demote_device(struct pwned_device *dev);
int fix_heap(struct pwned_device *dev);
void free_device(struct pwned_device *dev);
int demote_device(struct pwned_device *dev);
int fix_heap(struct pwned_device *dev);
int open_device_session(struct pwned_device *dev);
int close_device_session(struct pwned_device *dev);
int is_device_session_open(struct pwned_device *dev);
void free_dev_cmd_resp(struct dev_cmd_resp *resp);
#endif //CHECKM8_TOOL_CHECKM8_H

View File

@@ -1,8 +1,8 @@
#ifndef CHECKM8_TOOL_BOOTROM_ADDR_H
#define CHECKM8_TOOL_BOOTROM_ADDR_H
#ifndef CHECKM8_TOOL_ADDR_H
#define CHECKM8_TOOL_ADDR_H
#include "checkm8_config.h"
#include "bootrom_type.h"
#include "types.h"
#if CHECKM8_PLATFORM == 8010
@@ -53,4 +53,4 @@
#error "Unsupported checkm8 platform"
#endif
#endif //CHECKM8_TOOL_BOOTROM_ADDR_H
#endif //CHECKM8_TOOL_ADDR_H

View File

@@ -1,5 +1,5 @@
#ifndef CHECKM8_TOOL_BOOTROM_TYPE_H
#define CHECKM8_TOOL_BOOTROM_TYPE_H
#ifndef CHECKM8_TOOL_TYPES_H
#define CHECKM8_TOOL_TYPES_H
struct event
{
@@ -41,4 +41,4 @@ struct corr_data
unsigned char data[N_CORR_ENTRIES];
};
#endif //CHECKM8_TOOL_BOOTROM_TYPE_H
#endif //CHECKM8_TOOL_TYPES_H

View File

@@ -5,15 +5,6 @@
#define CMD_USB_READ_LIMIT 0xFF0
struct dev_cmd_resp
{
int ret;
unsigned long long magic;
unsigned long long retval;
unsigned char *data;
int len;
};
struct dev_cmd_resp *dev_memset(struct pwned_device *dev, unsigned long long addr, unsigned char c, int len);
struct dev_cmd_resp *dev_memcpy(struct pwned_device *dev, unsigned long long dest, unsigned long long src, int len);
struct dev_cmd_resp *dev_exec(struct pwned_device *dev, int response_len, int nargs, unsigned long long *args);
@@ -21,6 +12,4 @@ struct dev_cmd_resp *dev_exec(struct pwned_device *dev, int response_len, int na
struct dev_cmd_resp *dev_read_memory(struct pwned_device *dev, unsigned long long addr, int len);
struct dev_cmd_resp *dev_write_memory(struct pwned_device *dev, unsigned long long addr, unsigned char *data, int len);
void free_dev_cmd_resp(struct dev_cmd_resp *resp);
#endif //CHECKM8_TOOL_COMMAND_H

View File

@@ -15,10 +15,6 @@ struct libusb_device_bundle
};
#endif
int open_device_session(struct pwned_device *dev);
int close_device_session(struct pwned_device *dev);
int is_device_session_open(struct pwned_device *dev);
int partial_ctrl_transfer(struct pwned_device *dev,
unsigned char bmRequestType, unsigned char bRequest,
unsigned short wValue, unsigned short wIndex,

View File

@@ -1,8 +1,8 @@
#ifndef CHECKM8_TOOL_EXPERIMENTS_H
#define CHECKM8_TOOL_EXPERIMENTS_H
#include "payload.h"
#include "bootrom_type.h"
#include "tool/payload.h"
#include "dev/types.h"
/* AES Software */
DEV_PTR_T setup_bern_exp(struct pwned_device *dev);

View File

@@ -1,7 +1,7 @@
#ifndef CHECKM8_TOOL_HOST_CRYPTO_H
#define CHECKM8_TOOL_HOST_CRYPTO_H
#include "bootrom_type.h"
#include "dev/types.h"
void expand_key(unsigned char key[16], unsigned char key_sched[176],
int n, struct aes_constants *c);

View File

@@ -37,7 +37,7 @@ add_custom_command(TARGET payload POST_BUILD
BYPRODUCTS ${CMAKE_SOURCE_DIR}/c8_remote/include/libpayload.h
COMMAND python3 ${CMAKE_CURRENT_LIST_DIR}/scripts/headerize.py
${CMAKE_CURRENT_BINARY_DIR}/lib_cfiles
${CMAKE_SOURCE_DIR}/c8_remote/include)
${CMAKE_SOURCE_DIR}/c8_remote/include/tool)
add_library(experiments experiments/aes_sw.c
experiments/system.c

View File

@@ -1,7 +1,7 @@
#include <stdlib.h>
#include <string.h>
#include "bootrom_type.h"
#include "dev/types.h"
static const unsigned char sbox[256] =
{

View File

@@ -1,4 +1,4 @@
#include "bootrom_type.h"
#include "dev/types.h"
#ifdef DEV_CRYPTO
#include "dev_util.h"

View File

@@ -1,14 +1,13 @@
#include "experiments.h"
#include "util/experiments.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include "bootrom_addr.h"
#include "usb_helpers.h"
#include "command.h"
#include "host_crypto.h"
#include "dev/addr.h"
#include "tool/command.h"
#include "util/host_crypto.h"
DEV_PTR_T install_aes_data(struct pwned_device *dev)
{

View File

@@ -1,8 +1,7 @@
#include "experiments.h"
#include "util/experiments.h"
#include <stdio.h>
#include "usb_helpers.h"
#include "command.h"
#include "tool/payload.h"
void floppysleep(struct pwned_device *dev)
{

View File

@@ -1,9 +1,7 @@
#include "experiments.h"
#include "util/experiments.h"
#include <stdio.h>
#include "usb_helpers.h"
#include "command.h"
#include "tool/command.h"
void usb_task_exit(struct pwned_device *dev)
{

View File

@@ -1,8 +1,8 @@
#ifndef CHECKM8_TOOL_BOOTROM_FUNC_H
#define CHECKM8_TOOL_BOOTROM_FUNC_H
#include "bootrom_addr.h"
#include "bootrom_type.h"
#include "dev/addr.h"
#include "dev/types.h"
#include "dev_util.h"
/* Crypto */

View File

@@ -1,5 +1,5 @@
#ifndef CHECKM8_TOOL_CACHEUTIL_H
#define CHECKM8_TOOL_CACHEUTIL_H
#ifndef CHECKM8_TOOL_DEV_CACHE_H
#define CHECKM8_TOOL_DEV_CACHE_H
#include "dev_util.h"
@@ -59,4 +59,4 @@ static inline void clean_inv_va(void *addr)
__asm__ volatile ("dc ivac, %0"::"r" (addr));
}
#endif //CHECKM8_TOOL_CACHEUTIL_H
#endif //CHECKM8_TOOL_DEV_CACHE_H

View File

@@ -1,7 +1,7 @@
#ifndef CHECKM8_TOOL_CRYPTO_H
#define CHECKM8_TOOL_CRYPTO_H
#include "bootrom_type.h"
#include "dev/types.h"
void expand_key(unsigned char key[16], unsigned char key_sched[176],
int n, struct aes_constants *c);

View File

@@ -1,5 +1,5 @@
#include "dev_util.h"
#include "bootrom_addr.h"
#include "dev/addr.h"
PAYLOAD_SECTION
void load_sync_entry()

View File

@@ -1,6 +1,6 @@
#include "bootrom_func.h"
#include "bootrom_type.h"
#include "cacheutil.h"
#include "dev/types.h"
#include "dev_cache.h"
#include "dev_crypto.h"
PAYLOAD_SECTION

View File

@@ -1,5 +1,5 @@
#include "bootrom_func.h"
#include "cacheutil.h"
#include "dev_cache.h"
PAYLOAD_SECTION

View File

@@ -1,4 +1,4 @@
#include "bootrom_addr.h"
#include "dev/addr.h"
#include "bootrom_func.h"
PAYLOAD_SECTION

View File

@@ -4,19 +4,14 @@
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <unistd.h>
#include "payload.h"
#include "usb_helpers.h"
#include "bootrom_type.h"
#include "experiments.h"
#include "host_crypto.h"
#include "dev/types.h"
#include "util/experiments.h"
#include "util/host_crypto.h"
#ifdef CHECKM8_LOGGING
#include <stdarg.h>
#include <execinfo.h>
#endif
void checkm8_debug_indent(const char *format, ...)

View File

@@ -1,7 +1,7 @@
#include "command.h"
#include "tool/command.h"
#include "checkm8.h"
#include "usb_helpers.h"
#include "tool/usb_helpers.h"
#include <stdlib.h>
#include <string.h>

View File

@@ -5,9 +5,9 @@
#include <string.h>
#include <unistd.h>
#include "usb_helpers.h"
#include "command.h"
#include "bootrom_addr.h"
#include "tool/usb_helpers.h"
#include "tool/command.h"
#include "dev/addr.h"
static unsigned char data_0xA_0xC0_buf[192] =
{

View File

@@ -1,14 +1,13 @@
#include "payload.h"
#include "tool/payload.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "command.h"
#include "usb_helpers.h"
#include "tool/command.h"
#include "tool/libpayload.h"
#include "bootrom_addr.h"
#include "libpayload.h"
#include "dev/addr.h"
struct payload
{

View File

@@ -1,4 +1,4 @@
#include "usb_helpers.h"
#include "tool/usb_helpers.h"
#ifdef WITH_ARDUINO