2026-06-25 11:14:50 -07:00
|
|
|
#ifndef PAYLOAD_H
|
|
|
|
|
#define PAYLOAD_H
|
|
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
|
|
struct DeviceConfiguration {
|
|
|
|
|
uint16_t cpid;
|
|
|
|
|
size_t
|
|
|
|
|
config_hole,
|
|
|
|
|
config_large_leak,
|
|
|
|
|
config_overwrite_pad;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct PayloadConfiguration {
|
|
|
|
|
uint64_t
|
|
|
|
|
tlbi,
|
|
|
|
|
nop_gadget,
|
|
|
|
|
ret_gadget,
|
|
|
|
|
patch_addr,
|
|
|
|
|
ttbr0_addr,
|
|
|
|
|
func_gadget,
|
|
|
|
|
write_ttbr0,
|
|
|
|
|
memcpy_addr,
|
|
|
|
|
aes_crypto_cmd,
|
|
|
|
|
boot_tramp_end,
|
|
|
|
|
ttbr0_vrom_off,
|
|
|
|
|
ttbr0_sram_off,
|
|
|
|
|
gUSBSerialNumber, // ??
|
|
|
|
|
dfu_handle_request,
|
|
|
|
|
usb_core_do_transfer,
|
|
|
|
|
dfu_handle_bus_reset,
|
|
|
|
|
insecure_memory_base,
|
|
|
|
|
handle_interface_request,
|
|
|
|
|
usb_create_string_descriptor,
|
|
|
|
|
usb_serial_number_string_descriptor;
|
2026-06-25 21:40:01 -07:00
|
|
|
uint32_t payload_dest_armv7;
|
2026-06-25 11:14:50 -07:00
|
|
|
};
|
|
|
|
|
|
2026-06-28 16:37:05 -07:00
|
|
|
typedef struct {
|
|
|
|
|
uint16_t cpid;
|
|
|
|
|
const uint8_t *data;
|
|
|
|
|
size_t len;
|
|
|
|
|
} yolo_payload_t;
|
|
|
|
|
|
2026-06-28 17:14:49 -07:00
|
|
|
bool checkm8_find_device_configuration_for_cpid(uint16_t cpid, struct DeviceConfiguration *config);
|
|
|
|
|
bool checkm8_find_payload_configuration_for_cpid(uint16_t cpid, struct PayloadConfiguration *config);
|
2026-06-28 22:32:34 -07:00
|
|
|
bool create_pongo_payload_for_device(uint16_t cpid, const uint8_t **payload, size_t *payloadSize);
|
2026-06-25 11:14:50 -07:00
|
|
|
|
|
|
|
|
#endif // PAYLOAD_H
|