Skip to content

Commit

Permalink
processes: add kill and waitpid to Process
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Feb 28, 2022
1 parent 978d2d3 commit cb54513
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rpcclient/rpcclient/darwin/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
arm_thread_state64_t
from rpcclient.exceptions import BadReturnValueError, ArgumentError
from rpcclient.processes import Processes
from rpcclient.structs.consts import SIGTERM

FdStruct = namedtuple('FdStruct', 'fd struct')

Expand Down Expand Up @@ -159,6 +160,14 @@ def __init__(self, client, pid: int):
if self._client.uname.machine != 'x86_64':
self._thread_class = ArmThread64

def kill(self, sig: int = SIGTERM):
""" kill(pid, sig) at remote. read man for more details. """
return self._client.processes.kill(self._pid, sig)

def waitpid(self, pid: int):
""" waitpid(pid, sig) at remote. read man for more details. """
return self._client.processes.waitpid(self._pid)

def peek(self, address: int, size: int) -> bytes:
""" peek at memory address """
with self._client.safe_malloc(8) as p_buf:
Expand Down

0 comments on commit cb54513

Please sign in to comment.