A whole lot of changes to make the code more device-oriented

This commit is contained in:
2019-12-10 16:25:11 -05:00
parent 572ce57230
commit 941c476251
13 changed files with 311 additions and 258 deletions

View File

@@ -1,14 +1,43 @@
#ifndef IPWNDFU_REWRITE_C_CHECKM8_H
#define IPWNDFU_REWRITE_C_CHECKM8_H
int exploit_device();
#include "checkm8_config.h"
#define AES_ENCRYPT 16
#define AES_DECRYPT 17
#define CHECKM8_SUCCESS 0
#define CHECKM8_FAIL_NODEV -1
#define CHECKM8_FAIL_NOEXP -2
#define AES_GID_KEY 0x2000200
#define AES_UID_KEY 0x2000201
#define IS_CHECKM8_FAIL(code) code < 0
int aes(unsigned char *source, unsigned char *target, int encrypt, int key);
#if CHECKM8_PLATFORM == 8010
#define DEV_IDVENDOR 0x05AC
#define DEV_IDPRODUCT 0x1227
#else
#error "Unspported checkm8 platform"
#endif
struct libusb_device_bundle
{
struct libusb_context *ctx;
struct libusb_device *device;
struct libusb_device_handle *handle;
struct libusb_device_descriptor *descriptor;
};
struct pwned_device
{
enum
{
DEV_NORMAL,
DEV_PWNED
} status;
unsigned int idVendor;
unsigned int idProduct;
struct libusb_device_bundle *bundle;
};
struct pwned_device *exploit_device();
void free_device(struct pwned_device *dev);
#endif //IPWNDFU_REWRITE_C_CHECKM8_H