Romain Malmain c944a70056
Linux kernel fuzzing example (#2496)
* linux kernel (x509_cert) and process fuzzing example

* rework filters

* update to latest qemu

* working for process and kernel fuzzing

* new i2s mutator for binary only fuzzers

* refactoring modules with new filtering interface

* add state as parameter of harness

* hide unused global in usermode

* Script for stub bindings generation

* do not try to check whether it is worth generating the bindings, always
  generate when the env variable is on.

* add taplo to fmt_all.sh

* Moved fuzzers (again) in a target-centric way.

* fix rust 2024 warnings.

* new libafl_qemu harness structure.

* rename qemu_systemmode into qemu_baremetal

* fix qemu baremetal makefile

* fix formatter

---------

Co-authored-by: Toka <tokazerkje@outlook.com>
2024-09-26 14:29:33 +02:00

56 lines
1.4 KiB
C

#ifndef LIBAFL_QEMU_H
#define LIBAFL_QEMU_H
#include "libafl_qemu_defs.h"
#include "libafl_qemu_arch.h"
#define LIBAFL_QEMU_PRINTF_MAX_SIZE 4096
/**
* LibAFL QEMU header file.
*
* This file is a portable header file used to build target harnesses more
* conveniently. Its main purpose is to generate ready-to-use calls to
* communicate with the fuzzer. The list of commands is available at the bottom
* of this file. The rest mostly consists of macros generating the code used by
* the commands.
*/
enum LibaflQemuEndStatus {
LIBAFL_QEMU_END_UNKNOWN = 0,
LIBAFL_QEMU_END_OK = 1,
LIBAFL_QEMU_END_CRASH = 2,
};
libafl_word libafl_qemu_start_virt(void *buf_vaddr, libafl_word max_len);
libafl_word libafl_qemu_start_phys(void *buf_paddr, libafl_word max_len);
libafl_word libafl_qemu_input_virt(void *buf_vaddr, libafl_word max_len);
libafl_word libafl_qemu_input_phys(void *buf_paddr, libafl_word max_len);
void libafl_qemu_end(enum LibaflQemuEndStatus status);
void libafl_qemu_save(void);
void libafl_qemu_load(void);
libafl_word libafl_qemu_version(void);
void libafl_qemu_page_current_allow(void);
void libafl_qemu_internal_error(void);
void __attribute__((format(printf, 1, 2))) lqprintf(const char *fmt, ...);
void libafl_qemu_test(void);
void libafl_qemu_trace_vaddr_range(libafl_word start, libafl_word end);
void libafl_qemu_trace_vaddr_size(libafl_word start, libafl_word size);
#include "libafl_qemu_impl.h"
#endif