This fuzz target attempts to compress the fuzzed data with the simple compression function with an output buffer that may be too small to ensure that the compressor never crashes.
This fuzz target attempts to decompress the fuzzed data with the simple decompression function to ensure the decompressor never crashes.
This fuzz target performs a lz4 round-trip test (compress & decompress), compares the result with the original, and calls abort() on corruption.
Definition at line 221 of file fuzz_disasm.c.
230 }
else if (Size > 0x1000) {
236 outfile = fopen(
"/dev/null",
"w");
243 int i = (
int)Data[0] % platforms_len;
258 for (j = 0; j <
count; j++) {
259 cs_insn *
i = &(all_insn[j]);
260 fprintf(
outfile,
"0x%"PRIx64":\t%s\t\t%s // insn-ID: %u, insn-mnem: %s\n",
261 i->address,
i->mnemonic,
i->op_str,
266 if (
detail->regs_read_count > 0) {
267 fprintf(
outfile,
"\tImplicit registers read: ");
268 for (
n = 0;
n <
detail->regs_read_count;
n++) {
273 if (
detail->regs_write_count > 0) {
274 fprintf(
outfile,
"\tImplicit registers modified: ");
275 for (
n = 0;
n <
detail->regs_write_count;
n++) {
280 if (
detail->groups_count > 0) {
281 fprintf(
outfile,
"\tThis instruction belongs to groups: ");
282 for (
n = 0;
n <
detail->groups_count;
n++) {
static mcore_handle handle
@ 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)
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
References arch, count, cs_close(), cs_disasm(), cs_free(), cs_group_name(), cs_insn_name(), cs_open(), CS_OPT_DETAIL, CS_OPT_ON, cs_option(), cs_reg_name(), test_evm::detail, err, handle, i, int, n, NULL, outfile, platforms, and PRIx64.
Referenced by main().