From 1a4cd5ab3b7932f351f675fed572df42fb9c8b65 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 28 Mar 2023 22:29:56 +0200 Subject: [PATCH] feat: added remote munmap --- src/needle/syscalls.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/needle/syscalls.rs b/src/needle/syscalls.rs index 0a67d85..2b6f9d0 100644 --- a/src/needle/syscalls.rs +++ b/src/needle/syscalls.rs @@ -52,6 +52,25 @@ impl RemoteSyscall for RemoteMMap { } } +pub struct RemoteMUnmap { + addr: usize, + len: usize, +} + +impl RemoteMUnmap { + pub fn args(addr: usize, len: usize) -> Self { + RemoteMUnmap { addr, len } + } +} + +impl RemoteSyscall for RemoteMUnmap { + fn registers(&self, regs: &mut user_regs_struct) { + regs.rax = 11; + regs.rdi = self.addr as u64; + regs.rsi = self.len as u64; + } +} + pub struct RemoteOpen { filename: RemoteString, flags: u64,