mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-12 01:58:17 +00:00
qemu maps debug print
This commit is contained in:
@ -231,6 +231,21 @@ static void afl_setup(void) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void print_mappings(void) {
|
||||||
|
|
||||||
|
u8 buf[MAX_LINE];
|
||||||
|
FILE* f = fopen("/proc/self/maps", "r");
|
||||||
|
|
||||||
|
if (!f) return;
|
||||||
|
|
||||||
|
while (fgets(buf, MAX_LINE, f))
|
||||||
|
printf("%s", buf);
|
||||||
|
|
||||||
|
fclose(f);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* Fork server logic, invoked once we hit _start. */
|
/* Fork server logic, invoked once we hit _start. */
|
||||||
|
|
||||||
static void afl_forkserver(CPUState *cpu) {
|
static void afl_forkserver(CPUState *cpu) {
|
||||||
@ -239,6 +254,9 @@ static void afl_forkserver(CPUState *cpu) {
|
|||||||
|
|
||||||
if (forkserver_installed == 1) return;
|
if (forkserver_installed == 1) return;
|
||||||
forkserver_installed = 1;
|
forkserver_installed = 1;
|
||||||
|
|
||||||
|
if (getenv("AFL_QEMU_DEBUG_MAPS"))
|
||||||
|
print_mappings();
|
||||||
|
|
||||||
// if (!afl_area_ptr) return; // not necessary because of fixed dummy buffer
|
// if (!afl_area_ptr) return; // not necessary because of fixed dummy buffer
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user