Skip to content

Commit

Permalink
DarwinProcesses: add disable_watchdog()
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Nov 6, 2023
1 parent 605525f commit be9e386
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/rpcclient/rpcclient/darwin/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import posixpath
import re
import struct
import time
from collections import namedtuple
from datetime import datetime
from pathlib import Path
Expand All @@ -25,7 +26,7 @@
RpcClientException, SymbolAbsentError
from rpcclient.processes import Processes
from rpcclient.protocol import arch_t
from rpcclient.structs.consts import RTLD_NOW, SEEK_SET, SIGTERM
from rpcclient.structs.consts import RTLD_NOW, SEEK_SET, SIGTERM, SIGKILL
from rpcclient.symbol import ADDRESS_SIZE_TO_STRUCT_FORMAT, Symbol
from rpcclient.sysctl import CTL, KERN

Expand Down Expand Up @@ -879,3 +880,11 @@ def list(self) -> List[Process]:
pid = int(pid_buf[i])
result.append(Process(self._client, pid))
return result

def disable_watchdog(self) -> None:
while True:
try:
self.get_by_basename('watchdogd').kill(SIGKILL)
except ArgumentError:
pass
time.sleep(1)

0 comments on commit be9e386

Please sign in to comment.