Skip to content

Commit

Permalink
Basic support for injector TID pinning (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 authored Jul 23, 2024
1 parent c5b56e8 commit 6d9a773
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drakrun/drakrun/lib/injector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
2 changes: 2 additions & 0 deletions drakrun/drakrun/lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import re
import subprocess
from dataclasses import dataclass, field
from typing import Optional

from dataclasses_json import config, dataclass_json

Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit 6d9a773

Please sign in to comment.