Skip to content

Commit

Permalink
Add libafl_get_initial_brk API
Browse files Browse the repository at this point in the history
Companion patch for LibAFL #2776
domenukk authored Dec 18, 2024

Verified

This commit was signed with the committer’s verified signature.
ElDavoo Davide Palma
2 parents b01a0bc + fb1b23c commit 06bf8fa
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/libafl/user.h
Original file line number Diff line number Diff line change
@@ -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);

2 changes: 2 additions & 0 deletions libafl/user.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 06bf8fa

Please sign in to comment.