diff --git a/src/rpcclient/rpcclient/darwin/processes.py b/src/rpcclient/rpcclient/darwin/processes.py index b74db5ef..7d3c6d08 100644 --- a/src/rpcclient/rpcclient/darwin/processes.py +++ b/src/rpcclient/rpcclient/darwin/processes.py @@ -15,7 +15,7 @@ vnode_fdinfowithpath, PROC_PIDFDVNODEPATHINFO, proc_taskallinfo, PROC_PIDTASKALLINFO, PROX_FDTYPE_SOCKET, \ PROC_PIDFDSOCKETINFO, socket_fdinfo, so_kind_t, so_family_t, PROX_FDTYPE_PIPE, PROC_PIDFDPIPEINFO, pipe_info, \ task_dyld_info_data_t, TASK_DYLD_INFO_COUNT, all_image_infos_t, dyld_image_info_t, x86_thread_state64_t, \ - arm_thread_state64_t + arm_thread_state64_t, PROX_FDTYPE_KQUEUE from rpcclient.darwin.symbol import DarwinSymbol from rpcclient.exceptions import BadReturnValueError, ArgumentError, SymbolAbsentError, MissingLibraryError from rpcclient.processes import Processes @@ -34,6 +34,11 @@ class Fd: fd: int +@dataclasses.dataclass() +class KQueueFd(Fd): + pass + + @dataclasses.dataclass() class PipeFd(Fd): pass @@ -341,6 +346,9 @@ def fds(self) -> List[Fd]: if fd.proc_fdtype == PROX_FDTYPE_VNODE: result.append(FileFd(fd=fd.proc_fd, path=parsed.pvip.vip_path)) + elif fd.proc_fdtype == PROX_FDTYPE_KQUEUE: + result.append(KQueueFd(fd=fd.proc_fd)) + elif fd.proc_fdtype == PROX_FDTYPE_PIPE: result.append(PipeFd(fd=fd.proc_fd)) @@ -394,6 +402,9 @@ def fd_structs(self) -> List[FdStruct]: FdStruct(fd=fd, struct=vnode_fdinfowithpath.parse(vi_buf.peek(vnode_fdinfowithpath.sizeof())))) + elif fd.proc_fdtype == PROX_FDTYPE_KQUEUE: + result.append(FdStruct(fd=fd, struct=None)) + elif fd.proc_fdtype == PROX_FDTYPE_SOCKET: # socket vs = self._client.symbols.proc_pidfdinfo(self.pid, fd.proc_fd, PROC_PIDFDSOCKETINFO, vi_buf,