A whole lot of changes to make the code more device-oriented
This commit is contained in:
@@ -1,35 +1,31 @@
|
||||
#ifndef IPWNDFU_REWRITE_C_LIBUSB_HELPERS_H
|
||||
#define IPWNDFU_REWRITE_C_LIBUSB_HELPERS_H
|
||||
|
||||
#include "libusb-1.0/libusb.h"
|
||||
#include "checkm8.h"
|
||||
|
||||
struct libusb_device_bundle
|
||||
{
|
||||
struct libusb_device *device;
|
||||
struct libusb_device_handle *handle;
|
||||
struct libusb_device_descriptor descriptor;
|
||||
};
|
||||
#define LIBUSB_MAX_PACKET_SIZE 0x800
|
||||
|
||||
int get_test_device(libusb_context *usb_ctx, struct libusb_device_bundle *bundle);
|
||||
int get_device_bundle(struct pwned_device *dev);
|
||||
int release_device_bundle(struct pwned_device *dev);
|
||||
|
||||
void libusb1_async_ctrl_transfer(libusb_device_handle *handle,
|
||||
void 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(libusb_device_handle *handle,
|
||||
void 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(libusb_device_handle *handle);
|
||||
void leak(libusb_device_handle *handle);
|
||||
void no_leak(libusb_device_handle *handle);
|
||||
void stall(struct pwned_device *dev);
|
||||
void leak(struct pwned_device *dev);
|
||||
void no_leak(struct pwned_device *dev);
|
||||
|
||||
void usb_req_stall(libusb_device_handle *handle);
|
||||
void usb_req_leak(libusb_device_handle *handle);
|
||||
void usb_req_no_leak(libusb_device_handle *handle);
|
||||
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);
|
||||
|
||||
#endif //IPWNDFU_REWRITE_C_LIBUSB_HELPERS_H
|
||||
|
||||
Reference in New Issue
Block a user