cradle_hooks/
breakpoints.rs1use crate::defs::HookHandler;
2use std::collections::HashMap;
3
4pub struct Breakpoint {
7 pub original_byte: u8,
9 pub handlers: Vec<HookHandler>,
11 pub module_name: String,
13 pub export_name: String,
15}
16
17impl Breakpoint {
18 pub fn new(original_byte: u8, handler: HookHandler, module: String, export: String) -> Self {
20 Self {
21 original_byte,
22 handlers: vec![handler],
23 module_name: module,
24 export_name: export,
25 }
26 }
27
28 pub fn push_handler(&mut self, handler: HookHandler) {
30 self.handlers.push(handler);
31 }
32}
33
34pub type BreakpointMap = HashMap<usize, Breakpoint>;
36pub type ModuleBaseCache = HashMap<String, usize>;