Skip to main content

timer

Macro timer 

Source
macro_rules! timer {
    ($base:expr, $size:expr, $time:expr) => { ... };
    ($base:expr, $size:expr, $time:expr, $mode:expr) => { ... };
}
Expand description

Initiates execution obfuscation using the TpSetTimer.

ยงExample

#![no_std]
#![no_main]

extern crate alloc;
 
use hypnus::{foliage, ObfMode};
use hypnus::allocator::HypnusHeap;
use core::ffi::c_void;
 
#[global_allocator]
static ALLOCATOR: HypnusHeap = HypnusHeap;
 
// Pointer to the memory region you want to obfuscate (e.g., shellcode)
let data = b"\x90\x90\x90\xCC";
let ptr = data.as_ptr() as *mut c_void;
let size = data.len() as u64;

// Sleep duration in seconds
let delay = 5;
loop {
    // Full obfuscation with heap encryption and RWX memory protection
    timer!(ptr, size, delay, ObfMode::Heap | ObfMode::Rwx);
}