Add a debug command

This commit is contained in:
2019-12-11 16:19:05 -05:00
parent ebe07f5c32
commit 3c8d6c62c5
10 changed files with 240 additions and 119 deletions

View File

@@ -8,6 +8,7 @@
#define CHECKM8_FAIL_NODEV -2
#define CHECKM8_FAIL_NOEXP -3
#define CHECKM8_FAIL_NOTDONE -4
#define CHECKM8_FAIL_XFER -5
#define IS_CHECKM8_FAIL(code) code < 0

View File

@@ -3,11 +3,11 @@
#include "checkm8.h"
int dev_memset(struct pwned_device *dev, long addr, char c, long len);
int dev_memset(struct pwned_device *dev, long addr, unsigned char c, long len);
int dev_memcpy(struct pwned_device *dev, long dest, long src, long len);
int dev_exec(struct pwned_device *dev, long response_len, int nargs, long *args);
int dev_read_memory();
int dev_read_memory(struct pwned_device *dev, long addr, long len);
int dev_write_memory();
#endif //IPWNDFU_REWRITE_C_COMMAND_H

View File

@@ -15,25 +15,26 @@ struct libusb_device_bundle
int get_device_bundle(struct pwned_device *dev);
int release_device_bundle(struct pwned_device *dev);
int is_device_bundle_open(struct pwned_device *dev);
void libusb1_async_ctrl_transfer(struct pwned_device *dev,
int libusb1_async_ctrl_transfer(struct pwned_device *dev,
unsigned char bmRequestType, unsigned char bRequest,
unsigned short wValue, unsigned short wIndex,
unsigned char *data, unsigned short data_len,
unsigned int timeout);
void libusb1_no_error_ctrl_transfer(struct pwned_device *dev,
int libusb1_no_error_ctrl_transfer(struct pwned_device *dev,
unsigned char bmRequestType, unsigned char bRequest,
unsigned short wValue, unsigned short wIndex,
unsigned char *data, unsigned short data_len,
unsigned int timeout);
void stall(struct pwned_device *dev);
void leak(struct pwned_device *dev);
void no_leak(struct pwned_device *dev);
int stall(struct pwned_device *dev);
int leak(struct pwned_device *dev);
int no_leak(struct pwned_device *dev);
void usb_req_stall(struct pwned_device *dev);
void usb_req_leak(struct pwned_device *dev);
void usb_req_no_leak(struct pwned_device *dev);
int usb_req_stall(struct pwned_device *dev);
int usb_req_leak(struct pwned_device *dev);
int usb_req_no_leak(struct pwned_device *dev);
#endif //IPWNDFU_REWRITE_C_LIBUSB_HELPERS_H

View File

@@ -3,9 +3,6 @@
#include "checkm8.h"
#define PAYLOAD_SUCCESS 0
#define PAYLOAD_FAIL_DUP -1
#define PAYLOAD_FOUND 0
#define PAYLOAD_NOT_FOUND -1