2019-02-25 04:09:34 +00:00
|
|
|
#pragma once
|
2017-02-27 21:37:47 +00:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2017-04-28 13:48:38 +00:00
|
|
|
#define KERNEL_FILE "kernel"
|
|
|
|
#define RAMDISK_FILE "ramdisk.cpio"
|
|
|
|
#define SECOND_FILE "second"
|
2017-10-07 14:08:10 +00:00
|
|
|
#define EXTRA_FILE "extra"
|
2017-04-28 13:48:38 +00:00
|
|
|
#define DTB_FILE "dtb"
|
2018-10-20 03:10:47 +00:00
|
|
|
#define RECV_DTBO_FILE "recovery_dtbo"
|
2017-04-28 13:48:38 +00:00
|
|
|
#define NEW_BOOT "new-boot.img"
|
2017-03-04 17:50:36 +00:00
|
|
|
|
2017-02-27 21:37:47 +00:00
|
|
|
// Main entries
|
2018-01-28 18:44:30 +00:00
|
|
|
int unpack(const char *image);
|
2017-03-07 16:54:23 +00:00
|
|
|
void repack(const char* orig_image, const char* out_image);
|
2017-03-04 13:16:59 +00:00
|
|
|
void hexpatch(const char *image, const char *from, const char *to);
|
2017-12-20 19:36:18 +00:00
|
|
|
int cpio_commands(int argc, char *argv[]);
|
2017-11-10 17:30:33 +00:00
|
|
|
int dtb_commands(const char *cmd, int argc, char *argv[]);
|
2017-02-27 21:37:47 +00:00
|
|
|
|
2018-08-09 16:40:23 +00:00
|
|
|
// Pattern
|
2019-02-25 04:09:34 +00:00
|
|
|
bool patch_verity(void **buf, uint32_t *size, bool patch = true);
|
2018-08-09 16:40:23 +00:00
|
|
|
void patch_encryption(void **buf, uint32_t *size);
|