mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-10 17:21:33 +00:00
qemu maps debug print
This commit is contained in:
parent
16551643b3
commit
78d9fa280c
@ -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. */
|
||||
|
||||
static void afl_forkserver(CPUState *cpu) {
|
||||
@ -239,6 +254,9 @@ static void afl_forkserver(CPUState *cpu) {
|
||||
|
||||
if (forkserver_installed == 1) return;
|
||||
forkserver_installed = 1;
|
||||
|
||||
if (getenv("AFL_QEMU_DEBUG_MAPS"))
|
||||
print_mappings();
|
||||
|
||||
// if (!afl_area_ptr) return; // not necessary because of fixed dummy buffer
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user