how to run a constructor function on each fork

27 views
Skip to first unread message

Shank

unread,
Jun 13, 2022, 10:05:17 PM6/13/22
to afl-users
From what I understand, afl would stop just before main() and then create the forks from there (for better performance). In my usecase, it is needed that a particular constructor function is run for each invocation, rather than once in the whole session (as is the case now). Is there an option to disable the described behaviour?

- Shank

Marc

unread,
Jun 14, 2022, 4:58:19 AM6/14/22
to afl-...@googlegroups.com, Shank
what you could do is add another constructor to your target that runs
before the speical one you have and put __AFL_INIT(); in there, then
this will be the location the forkserver is installed, and your special
constructor comes afterwards every time.

Regards,
Marc

--

Marc Heuse
www.mh-sec.de

PGP: AF3D 1D4C D810 F0BB 977D 3807 C7EE D0A0 6BE9 F573

Shank

unread,
Jun 14, 2022, 10:03:54 AM6/14/22
to afl-users
Thank you. I will do that.
Reply all
Reply to author
Forward
0 new messages