blob: fde1b51814dc16989acb44c39261b67910803393 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#define JUMP_DIS_VERBOSE
#include <stdio.h>
#include "jump-dis.c"
#include <stdlib.h>
int main(UNUSED int argc, char **argv) {
static char buf[1048576];
UNUSED size_t size = fread(buf, 1, sizeof(buf), stdin);
printf("size=%zd\n", size);
int patch_size = atoi(argv[1]);
struct arch_dis_ctx arch;
memset(&arch, 0, sizeof(arch));
#ifdef TARGET_arm
int thumb = atoi(argv[2]);
arch.pc_low_bit = thumb;
#endif
bool bad = P(main)(buf, 0x10000, 0x10000 + patch_size, arch);
printf("final: bad = %d\n", bad);
}
|