From 6d9a77336baded961054242b052dd299e0f2f86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Srokosz?= Date: Tue, 23 Jul 2024 17:15:11 +0200 Subject: [PATCH] Basic support for injector TID pinning (#935) --- drakrun/drakrun/lib/injector.py | 5 +++++ drakrun/drakrun/lib/util.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/drakrun/drakrun/lib/injector.py b/drakrun/drakrun/lib/injector.py index 87e7c0916..2c80c9b89 100644 --- a/drakrun/drakrun/lib/injector.py +++ b/drakrun/drakrun/lib/injector.py @@ -60,6 +60,11 @@ def _get_cmdline_generic(self, method: str) -> List[str]: hex(self.runtime_info.vmi_offsets.kpgd), "-m", method, + *( + ["-I", str(self.runtime_info.inject_tid)] + if self.runtime_info.inject_tid is not None + else [] + ), ] def _get_cmdline_writefile(self, local: str, remote: str) -> List[str]: diff --git a/drakrun/drakrun/lib/util.py b/drakrun/drakrun/lib/util.py index 69e0fa37b..164b18d22 100644 --- a/drakrun/drakrun/lib/util.py +++ b/drakrun/drakrun/lib/util.py @@ -5,6 +5,7 @@ import re import subprocess from dataclasses import dataclass, field +from typing import Optional from dataclasses_json import config, dataclass_json @@ -52,6 +53,7 @@ def from_tool_output(output: str) -> "VmiOffsets": class RuntimeInfo: vmi_offsets: VmiOffsets inject_pid: int + inject_tid: Optional[int] = None @staticmethod def load(file_path: str) -> "RuntimeInfo":