Definition at line 12 of file fuzz_harness.c.
23 "X86 32 (Intel syntax)"
28 "X86 64 (Intel syntax)"
43 "ARM: Cortex-A15 + NEON"
63 "MIPS-32 (Big-endian)"
68 "MIPS-64-EL (Little-endian)"
73 "MIPS-32R6 | Micro (Big-endian)"
78 "MIPS-32R6 (Big-endian)"
127 if (fp ==
NULL)
return 1;
132 if (bufsize == -1)
return 1;
137 if (fseek(fp, 0
L,
SEEK_SET) != 0)
return 1;
139 size_t len = fread(
buf,
sizeof(
char), bufsize, fp);
141 if (
len == 0)
return 2;
151 if (bufsize < 3)
return 0;
154 int i = (
int)
buf[0] % platforms_len;
156 unsigned char *buf_ptr =
buf + 1;
157 long buf_ptr_size = bufsize - 1;
163 printf(
"Failed on cs_open() with error returned: %u\n",
err);
178 for (j = 0; j <
count; j++) {
179 cs_insn *
i = &(all_insn[j]);
180 printf(
"0x%"PRIx64":\t%s\t\t%s // insn-ID: %u, insn-mnem: %s\n",
181 i->address,
i->mnemonic,
i->op_str,
186 if (
detail->regs_read_count > 0) {
187 printf(
"\tImplicit registers read: ");
188 for (
n = 0;
n <
detail->regs_read_count;
n++) {
194 if (
detail->regs_write_count > 0) {
195 printf(
"\tImplicit registers modified: ");
196 for (
n = 0;
n <
detail->regs_write_count;
n++) {
202 if (
detail->groups_count > 0) {
203 printf(
"\tThis instruction belongs to groups: ");
204 for (
n = 0;
n <
detail->groups_count;
n++) {
213 printf(
"ERROR: Failed to disasm given code!\n");
static mcore_handle handle
@ CS_ARCH_ARM64
ARM-64, also called AArch64.
@ CS_ARCH_SPARC
Sparc architecture.
@ CS_ARCH_XCORE
XCore architecture.
@ CS_ARCH_M68K
68K architecture
@ CS_ARCH_X86
X86 architecture (including x86 & x86-64)
@ CS_ARCH_M680X
680X architecture
@ CS_ARCH_ARM
ARM architecture (including Thumb, Thumb-2)
@ CS_ARCH_MIPS
Mips architecture.
@ CS_ARCH_SYSZ
SystemZ architecture.
@ CS_ARCH_PPC
PowerPC architecture.
@ CS_MODE_MCLASS
ARM's Cortex-M series.
@ CS_MODE_64
64-bit mode (X86, PPC)
@ CS_MODE_MIPS64
Mips64 ISA (Mips)
@ CS_MODE_32
32-bit mode (X86)
@ CS_MODE_V8
ARMv8 A32 encodings for ARM.
@ CS_MODE_MICRO
MicroMips mode (MIPS)
@ CS_MODE_MIPS32
Mips32 ISA (Mips)
@ CS_MODE_MIPS32R6
Mips32r6 ISA.
@ CS_MODE_BIG_ENDIAN
big-endian mode
@ CS_MODE_V9
SparcV9 mode (Sparc)
@ CS_MODE_THUMB
ARM's Thumb mode, including Thumb-2.
@ CS_MODE_LITTLE_ENDIAN
little-endian mode (default mode)
@ CS_MODE_M680X_6809
M680X Motorola 6809 mode.
@ CS_OPT_DETAIL
Break down instruction structure into details.
@ CS_OPT_ON
Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA).
CAPSTONE_EXPORT size_t CAPSTONE_API cs_disasm(csh ud, const uint8_t *buffer, size_t size, uint64_t offset, size_t count, cs_insn **insn)
CAPSTONE_EXPORT const char *CAPSTONE_API cs_group_name(csh ud, unsigned int group)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle)
CAPSTONE_EXPORT const char *CAPSTONE_API cs_insn_name(csh ud, unsigned int insn)
CAPSTONE_EXPORT void CAPSTONE_API cs_free(cs_insn *insn, size_t count)
CAPSTONE_EXPORT const char *CAPSTONE_API cs_reg_name(csh ud, unsigned int reg)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close(csh *handle)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option(csh ud, cs_opt_type type, size_t value)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
struct platform platforms[]
RZ_API void Ht_() free(HtName_(Ht) *ht)
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char argv
References arch, argv, platform::comment, count, CS_ARCH_ARM, CS_ARCH_ARM64, CS_ARCH_M680X, CS_ARCH_M68K, CS_ARCH_MIPS, CS_ARCH_PPC, CS_ARCH_SPARC, CS_ARCH_SYSZ, CS_ARCH_X86, CS_ARCH_XCORE, cs_close(), cs_disasm(), cs_free(), cs_group_name(), cs_insn_name(), CS_MODE_32, CS_MODE_64, CS_MODE_ARM, CS_MODE_BIG_ENDIAN, CS_MODE_LITTLE_ENDIAN, CS_MODE_M680X_6809, CS_MODE_MCLASS, CS_MODE_MICRO, CS_MODE_MIPS32, CS_MODE_MIPS32R6, CS_MODE_MIPS64, CS_MODE_THUMB, CS_MODE_V8, CS_MODE_V9, cs_open(), CS_OPT_DETAIL, CS_OPT_ON, cs_option(), cs_reg_name(), test_evm::detail, err, benchmark::FILE, free(), handle, i, int, L, len, malloc(), n, NULL, platforms, printf(), PRIx64, SEEK_END, and SEEK_SET.