Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DarwinProcesses: add disable_watchdog() #312

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, SIGKILL, SIGTERM
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)