Skip to content

Commit f34ca42

Browse files
committed
Cleanup
1 parent f9ebb47 commit f34ca42

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

libafl_qemu/src/modules/systemmode/intel_pt.rs

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ where
4343
S: Unpin + HasMetadata,
4444
T: SaturatingAdd + From<u8> + Debug + 'static,
4545
{
46-
// type ModuleAddressFilter = Self;
47-
// type ModulePageFilter = NopPageFilter;
48-
4946
fn pre_qemu_init<ET>(
5047
&mut self,
5148
emulator_modules: &mut EmulatorModules<ET, I, S>,
@@ -56,7 +53,7 @@ where
5653
emulator_modules
5754
.thread_creation(NewThreadHook::Function(intel_pt_new_thread::<ET, I, S, T>))
5855
.unwrap();
59-
// TODO emulator_modules.thread_teradown
56+
// fixme: consider implementing a clean emulator_modules.thread_teradown
6057
}
6158

6259
fn pre_exec<ET>(
@@ -86,17 +83,10 @@ where
8683
{
8784
let pt = self.pt.as_mut().expect("Intel PT module not initialized.");
8885
pt.disable_tracing().unwrap();
89-
// TODO handle self modifying code
90-
91-
// TODO log errors or panic or smth
92-
// let _ = pt.decode_with_callback(
93-
// |addr, out_buff| {
94-
// let _ = qemu.read_mem(out_buff, addr.into());
95-
// },
96-
// unsafe { &mut *slice_from_raw_parts_mut(self.map_ptr, self.map_len) },
97-
// );
9886

99-
let _ = pt.decode_traces_into_map(&mut self.image, self.map_ptr, self.map_len);
87+
let _ = pt
88+
.decode_traces_into_map(&mut self.image, self.map_ptr, self.map_len)
89+
.inspect_err(|e| log::warn!("Intel PT trace decode failed: {e}"));
10090

10191
#[cfg(feature = "intel_pt_export_raw")]
10292
{
@@ -105,22 +95,6 @@ where
10595
.inspect_err(|e| log::warn!("Intel PT trace save to file failed: {e}"));
10696
}
10797
}
108-
109-
// fn address_filter(&self) -> &Self::ModuleAddressFilter {
110-
// self
111-
// }
112-
//
113-
// fn address_filter_mut(&mut self) -> &mut Self::ModuleAddressFilter {
114-
// self
115-
// }
116-
//
117-
// fn page_filter(&self) -> &Self::ModulePageFilter {
118-
// unimplemented!()
119-
// }
120-
//
121-
// fn page_filter_mut(&mut self) -> &mut Self::ModulePageFilter {
122-
// unimplemented!()
123-
// }
12498
}
12599

126100
impl<T> AddressFilter for IntelPTModule<T>
@@ -177,6 +151,5 @@ where
177151

178152
intel_pt_module.pt = Some(pt);
179153

180-
// What does this bool mean? ignore for the moment
181154
true
182155
}

0 commit comments

Comments
 (0)