From 010301ee8f3797b207149e36b6c669cf4cb4ed85 Mon Sep 17 00:00:00 2001 From: memN0ps <89628341+memN0ps@users.noreply.github.com> Date: Sun, 28 Jan 2024 17:24:11 +1300 Subject: [PATCH] Removed JMP hooks until it's stable --- hypervisor/src/utils/function_hook.rs | 29 --------------------------- 1 file changed, 29 deletions(-) diff --git a/hypervisor/src/utils/function_hook.rs b/hypervisor/src/utils/function_hook.rs index 98a6e28..11ffcde 100644 --- a/hypervisor/src/utils/function_hook.rs +++ b/hypervisor/src/utils/function_hook.rs @@ -67,35 +67,6 @@ impl FunctionHook { pub fn new(original_address: u64, hook_address: u64, handler: *const ()) -> Option { log::debug!("Setting up hooks"); - // Create the different trampolines. There's a few different ones available: - // - 1 Byte: CC shellcode - // - 14 Bytes: JMP shellcode - // - #[cfg(feature = "shellcode-hook")] - let (hook_type, trampoline) = - match Self::trampoline_shellcode(original_address, hook_address, JMP_SHELLCODE_LEN) { - Ok(trampoline) => (HookType::Jmp, trampoline), - Err(error) => { - log::warn!("Failed to create jmp trampoline: {:?}", error); - - // If jmp trampoline didn't work, let's try this one: - // - let trampoline = Self::trampoline_shellcode( - original_address, - hook_address, - BP_SHELLCODE_LEN, - ) - .map_err(|e| { - log::warn!("Failed to create bp trampoline: {:?}", e); - e - }) - .ok()?; - - (HookType::Breakpoint, trampoline) - } - }; - - #[cfg(not(feature = "shellcode-hook"))] let (hook_type, trampoline) = { let trampoline = Self::trampoline_shellcode(original_address, hook_address, BP_SHELLCODE_LEN)