init ranges later

This commit is contained in:
tokatoka 2021-12-24 16:34:53 +09:00
parent e6434d2ec2
commit 97c169fe63
2 changed files with 8 additions and 0 deletions

View File

@ -11,6 +11,7 @@ pub struct DrCovRuntime {
}
impl DrCovRuntime {
#[must_use]
pub fn new() -> Self {
Self {
drcov_basic_blocks: vec![],
@ -18,6 +19,11 @@ impl DrCovRuntime {
}
}
pub fn init(&mut self, ranges: &RangeMap<usize, (u16, String)>) {
self.ranges = ranges.clone();
}
#[allow(clippy::unused_self)]
pub fn pre_exec<I: Input + HasTargetBytes>(&mut self, _input: &I) -> Result<(), Error> {
Ok(())
}

View File

@ -377,6 +377,8 @@ impl<'a> FridaInstrumentationHelper<'a> {
if helper.options().asan_enabled() || helper.options().drcov_enabled() {
helper.asan_runtime.init(gum, modules_to_instrument);
}
helper.drcov_runtime.init(&helper.ranges);
#[cfg(feature = "cmplog")]
if helper.options.cmplog_enabled() {
helper.cmplog_runtime.init();