This reimplements the signature scanner in order to allow it to return an iterator of addresses matching the signature provided, whereas previously the scan would invariably stop at the first match.
Returning an iterator has several advantages in case more than 1 match is expected, for example it allows the caller to select the target address based on a closure.
For convenience, two more additions have been made:
a scan function has been added, which essentially provides the same behaviour before the present PR. This allows for simpler scenarios to just stop the iterator at the first matching address
a SignatureScanner trait has been implemented for Signature<N> and for the scan and scan_process_range functions. This is more for convenience for now, but could allow for passing any Signature<N> in functions if needed
This reimplements the signature scanner in order to allow it to return an iterator of addresses matching the signature provided, whereas previously the scan would invariably stop at the first match.
Returning an iterator has several advantages in case more than 1 match is expected, for example it allows the caller to select the target address based on a closure.
For convenience, two more additions have been made:
scan
function has been added, which essentially provides the same behaviour before the present PR. This allows for simpler scenarios to just stop the iterator at the first matching addressSignatureScanner
trait has been implemented forSignature<N>
and for thescan
andscan_process_range
functions. This is more for convenience for now, but could allow for passing anySignature<N>
in functions if needed