ROSE
0.9.6a
|
Callback to detect padding. More...
#include <Partitioner.h>
Public Member Functions | |
FindDataPadding () | |
virtual bool | operator() (bool enabled, const Args &args) |
The actual callback function. More... | |
Public Member Functions inherited from Partitioner::ByteRangeCallback | |
virtual | ~ByteRangeCallback () |
Public Attributes | |
std::vector< SgUnsignedCharList > | patterns |
Pattern of padding, repeated at least minimum_size times. More... | |
size_t | minimum_nrep |
Minimum number of matched patterns to be considered padding. More... | |
size_t | maximum_nrep |
Maximum number of mathced patterns to be considered padding. More... | |
bool | begins_contiguously |
If true, pattern must start immediately after a function. More... | |
bool | ends_contiguously |
If true, pattern must end immediately before a function. More... | |
rose_addr_t | maximum_range_size |
Skip this callback if the range is larger than this. More... | |
size_t | nfound |
Total number of blocks found by this callback. More... | |
Callback to detect padding.
This callback looks for repeated patterns of bytes that are used for padding and adds them as a static data block to the preceding function. Multiple patterns can be specified per callback object for efficiency, and the first pattern that matches will be used. Each pattern is matched as many times as possible (up to a user-specified maximum). Once a repeated matching of the pattern is found, it is considered padding only if it matches at least some minimum (user-specified) number of times and is anchored to (contiguous with) a preceding and/or following function according to the begins_contiguously
and ends_contiguously
properties.
This callback can be invoked by scan_unassigned_bytes(), scan_intrafunc_bytes(), or scan_interfunc_bytes() depending on the kind of padding for which it is searching.
Definition at line 1209 of file Partitioner.h.
|
inline |
Definition at line 1218 of file Partitioner.h.
|
virtual |
The actual callback function.
This needs to be defined in subclasses.
Implements Partitioner::ByteRangeCallback.
Definition at line 1826 of file Partitioner.C.
References Partitioner::append(), SgAsmBlock::BLK_PADDING, Partitioner::debug, Range< T >::empty(), RangeMap< R, T >::end(), Partitioner::Function::entry_va, RangeMap< R, T >::find(), Partitioner::find_db_starting(), RangeMap< R, T >::find_prior(), Range< T >::first(), Range< T >::last(), max, Range< rose_addr_t >::maximum(), Range< rose_addr_t >::minimum(), offset, Partitioner::ByteRangeCallback::Args::partitioner, Partitioner::ByteRangeCallback::Args::range, Partitioner::ByteRangeCallback::Args::ranges, MemoryMap::read(), Range< T >::resize(), Partitioner::ByteRangeCallback::Args::restrict_map, Partitioner::ro_map, and Range< T >::size().
std::vector<SgUnsignedCharList> Partitioner::FindDataPadding::patterns |
Pattern of padding, repeated at least minimum_size times.
Definition at line 1210 of file Partitioner.h.
Referenced by Partitioner::post_cfg().
size_t Partitioner::FindDataPadding::minimum_nrep |
Minimum number of matched patterns to be considered padding.
Definition at line 1211 of file Partitioner.h.
Referenced by Partitioner::post_cfg().
size_t Partitioner::FindDataPadding::maximum_nrep |
Maximum number of mathced patterns to be considered padding.
Definition at line 1212 of file Partitioner.h.
Referenced by Partitioner::post_cfg().
bool Partitioner::FindDataPadding::begins_contiguously |
If true, pattern must start immediately after a function.
Definition at line 1213 of file Partitioner.h.
Referenced by Partitioner::post_cfg().
bool Partitioner::FindDataPadding::ends_contiguously |
If true, pattern must end immediately before a function.
Definition at line 1214 of file Partitioner.h.
Referenced by Partitioner::post_cfg().
rose_addr_t Partitioner::FindDataPadding::maximum_range_size |
Skip this callback if the range is larger than this.
Definition at line 1215 of file Partitioner.h.
size_t Partitioner::FindDataPadding::nfound |
Total number of blocks found by this callback.
Definition at line 1216 of file Partitioner.h.