hostPort
The port for the host that the task is in.
var hostPort: Mach.Host { get throws }
The port for the host that the task is in.
var hostPort: Mach.Host { get throws }
import MachCore
The core module for interacting with the Mach kernel.
class Task
A task (port).
struct Mach
The Mach kernel.
class Host
A host.
struct TaskSpecialPort
A special port for a task.
func getSpecialPort<PortType>(_ specialPort: Mach.TaskSpecialPort, as type: PortType.Type = PortType.self) throws -> PortType where PortType : Mach.Port
Gets a special port for the task.
func setSpecialPort(_ specialPort: Mach.TaskSpecialPort, to port: Mach.Port) throws
Sets a special port for the task.
var bootstrapPort: Mach.BootstrapPort { get throws }
The task’s bootstrap port.
var debugPort: Mach.Port { get throws }
The task’s debug port.
static func debugPortForPID(_ pid: pid_t) throws -> Mach.Port
Atomically gets the debug port for the task with the given PID.
var controlPort: Mach.TaskControl { get throws }
The task’s control port.
var readPort: Mach.TaskRead { get throws }
The task’s read port.
var inspectPort: Mach.TaskInspect { get throws }
The task’s inspect port.
var namePort: Mach.TaskName { get throws }
The task name port.
var accessPort: Mach.Port { get throws }
The access port for the task.
convenience init(forPID pid: pid_t) throws
Gets the task port for a process.
static var current: TaskControl { get }
The current task.
var exceptionPorts: [Mach.ExceptionPort] { get throws }
All the exception ports for the task.
var identityToken: Mach.TaskIdentityToken { get throws }
The task’s identity token.
var info: Mach.TaskInfoManager { get }
The task’s info.
var inspectInfo: Mach.TaskInspectInfoManager { get }
A task inspect info manager.
var isCurrentTask: Bool { get }
If the task is the current task.
var pid: pid_t { get throws }
The PID of the task.
var policy: Mach.TaskPolicyManager { get }
The task’s policy.
var ports: [Mach.Port] { get throws }
The ports (really, port names) in the task’s name space.
var role: task_role { get throws }
The task’s role.
var stashedPorts: [Mach.Port] { get throws }
The task’s stashed ports.
var threads: [Mach.Thread] { get throws }
The threads in the task.
var voucher: Mach.Voucher { get throws }
The task’s voucher.
func addExceptionPort(_ exceptionPort: Mach.ExceptionPort) throws
Adds an exception port to the task.
func allocateMemory(_ address: inout vm_address_t, size: vm_size_t, flags: Mach.VMAllocationFlags = []) throws
Allocates a new VM region in the task’s address space.
func allocatePhysicallyContiguous(_ address: inout vm_address_t, size: vm_size_t, flags: Mach.VMAllocationFlags = []) throws
Allocates a new VM region of physically contiguous memory in the task’s address space.
func clearDefaultThreadState() throws
Clears the default state to be inherited by new threads created in the task.
func exceptionPorts(mask: Mach.ExceptionMask) throws -> [Mach.ExceptionPort]
Gets the exception ports for the task that catch the exception types specified by the mask.
func generateCorpse() throws -> Mach.TaskCorpse
Generates a corpse for the task.
func getDefaultThreadState<DataType>(_ flavor: Mach.ThreadStateFlavor, as type: DataType.Type = DataType.self) throws -> DataType where DataType : BitwiseCopyable
Gets the default state inherited by new threads created in the task.
func kernelcacheData(of kcObject: Mach.Port) throws -> Data
Gets the data of a kernelcache object.
func kernelcacheData<DataType>(of kcObject: Mach.Port, as type: DataType.Type) throws -> DataType
Gets the data of a kernelcache object.
func registerHardenedExceptionHandler(_ exceptionPort: Mach.ExceptionPort, signedPCKey: UInt32) throws
Registers a hardened exception handler for the task.
func resume() throws
Resumes the task.
func resume2(token: Mach.TaskSuspensionToken) throws
Resumes the task with a suspension token.
func setDefaultThreadState<DataType>(_ flavor: Mach.ThreadStateFlavor, to value: DataType) throws where DataType : BitwiseCopyable
Sets the default state to be inherited by new threads created in the task.
func setPhysicalFootprintLimit(_ limit: Int32) throws -> Int32
Sets the physical footprint limit for the task.
func setRole(to role: task_role) throws
Sets the task’s role.
func setVoucher(_ voucher: Mach.Voucher) throws
Sets the task’s voucher.
func stashPorts(_ ports: [Mach.Port]) throws
Stashes the given ports in the task.
func suspend() throws
Suspends the task.
func suspend2() throws -> Mach.TaskSuspensionToken
Suspends the task and receive a suspension token.
func swapExceptionPort(_ exceptionPort: Mach.ExceptionPort) throws -> [Mach.ExceptionPort]
Swaps an exception port for the task and returns the previous exception ports.
func swapVoucher(with voucher: Mach.Voucher) throws -> Mach.Voucher
Swaps the task’s voucher with another.
func terminate() throws
Terminates the task.
func unwireMemory(_ address: vm_address_t, size: vm_size_t) throws
Unwires a range of memory.
func wireMemory(_ address: vm_address_t, size: vm_size_t, options: Mach.VMProtectionOptions) throws
Wires a range of memory.