diff --git a/src/hook.rs b/src/hook.rs new file mode 100644 index 0000000..b836588 --- /dev/null +++ b/src/hook.rs @@ -0,0 +1,24 @@ +pub trait Hook: Copy { + fn as_ptr_u8(self) -> *mut u8; + fn trampoline(f: F) -> Closure; +} + +pub struct HookGuard { + bytes: [u8; 16], +} + +impl HookGuard { + pub fn unhook(&self) {} +} + + +pub struct Closure { + inner: Box> +} + +#[repr(C)] +struct ClosureInner { + ptr: *const (), + data: F, +} + diff --git a/src/lib.rs b/src/lib.rs index ea0b9d0..9d8c870 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,8 @@ mod base; mod program; mod section; -pub use base::*; -pub use program::*; -pub use section::*; +pub mod hook; + +pub use base::Base; +pub use program::Program; +pub use section::Section;