|
|
|
@ -28,12 +28,17 @@ static void print_string_hex(unsigned char *str, int len) |
|
|
|
|
printf("\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static size_t mycallback(const uint8_t *buffer, size_t offset, void *p) |
|
|
|
|
size_t mycallback(const uint8_t *buffer, size_t offset, void *p) |
|
|
|
|
{ |
|
|
|
|
// always skip 2 bytes when encountering data
|
|
|
|
|
return 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cs_opt_skipdata skipdata = { |
|
|
|
|
// rename default "data" instruction from ".byte" to "db"
|
|
|
|
|
"db", |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static void test() |
|
|
|
|
{ |
|
|
|
|
#define X86_CODE32 "\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00\x00\x91\x92" |
|
|
|
@ -61,10 +66,6 @@ static void test() |
|
|
|
|
cs_insn *insn; |
|
|
|
|
int i; |
|
|
|
|
size_t count; |
|
|
|
|
cs_opt_skipdata skipdata = { |
|
|
|
|
// rename default "data" instruction from ".byte" to "db"
|
|
|
|
|
"db", |
|
|
|
|
}; |
|
|
|
|
cs_err err; |
|
|
|
|
|
|
|
|
|
for (i = 0; i < sizeof(platforms)/sizeof(platforms[0]); i++) { |
|
|
|
|