From e558cafe7cf565465e9850ccb310c9d40eecc723 Mon Sep 17 00:00:00 2001 From: Alessandro De Vito Date: Tue, 17 Dec 2024 12:25:58 +0200 Subject: [PATCH 1/2] added libafl_get_initial_brk to properly change the heap mapping libafl side --- libafl/user.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libafl/user.c b/libafl/user.c index c30c3bf582..0002190d53 100644 --- a/libafl/user.c +++ b/libafl/user.c @@ -29,6 +29,8 @@ struct image_info* libafl_get_image_info(void) { return &libafl_image_info; } uint64_t libafl_get_brk(void) { return (uint64_t)target_brk; } +uint64_t libafl_get_initial_brk(void) { return (uint64_t)initial_target_brk; } + uint64_t libafl_set_brk(uint64_t new_brk) { uint64_t old_brk = (uint64_t)target_brk; From fb1b23cb2fc1b39233cb1c8f0fe1f6e213916385 Mon Sep 17 00:00:00 2001 From: Alessandro De Vito Date: Tue, 17 Dec 2024 13:37:00 +0200 Subject: [PATCH 2/2] added definition for libafl_get_initial_brk --- include/libafl/user.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/libafl/user.h b/include/libafl/user.h index 410cf185da..db2073c328 100644 --- a/include/libafl/user.h +++ b/include/libafl/user.h @@ -31,6 +31,7 @@ IntervalTreeNode* libafl_maps_next(IntervalTreeNode* pageflags_maps_node, uint64_t libafl_load_addr(void); struct image_info* libafl_get_image_info(void); +uint64_t libafl_get_initial_brk(void); uint64_t libafl_get_brk(void); uint64_t libafl_set_brk(uint64_t new_brk);