Skip to main content

Module utils

Module utils 

Source
Expand description

Utility functions for fine-grained coverage collection: Including functions to: wrap the specified external symbols, extract partial match information from comparison operands, mutate the AFL coverage bitmap, etc.

Functions§

base_idx_of_app_pc
Calculate a suitable coverage-bitmap base index for the program address app_pc. The address is hashed and masked to ensure it is within the bounds of the bitmap.
compare_ptrs
Record coverage information for the comparison between the n bytes of data pointed to by a, and the n bytes pointed to by b. The coverage information is written to the coverage bitmap pointed to by afl_cmp_area, starting at base_idx.
get_afl_cmp_area
wrap_compare_symbols
Called from WinAFL. Check if any of the compare symbols (defined in the cmp::Symbols enum) are exported by the module with base address mod_base_addr. Wrap all of the compare symbols that are found with their associated wrapper function.
write_coverage
Record coverage information for the comparison between slices a and b. The coverage information is written to the coverage bitmap pointed to by afl_cmp_area, starting at base_idx.