rpcclient.darwin

rpcclient.darwin.bluetooth

class rpcclient.darwin.bluetooth.Bluetooth(client)[source]

Bases: object

bluetooth utils

property address: str | None
property connected: bool
property discoverable: bool
is_on()[source]
turn_off()[source]
turn_on()[source]

rpcclient.darwin.cfpreferences

class rpcclient.darwin.cfpreferences.CFPreferences(client)[source]

Bases: object

API to the CFPreferences* functions - preferences managed by cfprefsd. https://developer.apple.com/documentation/corefoundation/preferences_utilities?language=objc

clear(application_id: str, username: str = 'kCFPreferencesCurrentUser', hostname: str = 'kCFPreferencesCurrentHost')[source]

remove all values from given preference

get_dict(application_id: str, username: str = 'kCFPreferencesCurrentUser', hostname: str = 'kCFPreferencesCurrentHost') Mapping | None[source]

get a dictionary representation of given preference

get_keys(application_id: str, username: str = 'kCFPreferencesCurrentUser', hostname: str = 'kCFPreferencesCurrentHost') List[str] | None[source]

wrapper for CFPreferencesCopyKeyList

get_value(key: str, application_id: str, username: str = 'kCFPreferencesCurrentUser', hostname: str = 'kCFPreferencesCurrentHost') str | None[source]

wrapper for CFPreferencesCopyValue

remove(key: str, application_id: str, username: str = 'kCFPreferencesCurrentUser', hostname: str = 'kCFPreferencesCurrentHost')[source]

remove a given key from a preference

set(key: str, value, application_id: str, username: str = 'kCFPreferencesCurrentUser', hostname: str = 'kCFPreferencesCurrentHost')[source]

wrapper for CFPreferencesSetValue

set_dict(d: Mapping, application_id: str, username: str = 'kCFPreferencesCurrentUser', hostname: str = 'kCFPreferencesCurrentHost')[source]

set entire preference dictionary (erase first if exists)

sync(application_id: str, username: str = 'kCFPreferencesCurrentUser', hostname: str = 'kCFPreferencesCurrentHost')[source]
update_dict(d: Mapping, application_id: str, username: str = 'kCFPreferencesCurrentUser', hostname: str = 'kCFPreferencesCurrentHost')[source]

update preference dictionary

rpcclient.darwin.client

class rpcclient.darwin.client.DarwinClient(sock, sysname: str, arch: <Enum <FormatField>>, create_socket_cb: ~typing.Callable)[source]

Bases: Client

cf(o: Mapping[str, Any] | List | Tuple[Any, ...] | str | bool | float | bytes | datetime | None) DarwinSymbol[source]

construct a CFObject from a given python object

decode_cf(symbol: Symbol) Mapping[str, Any] | List | Tuple[Any, ...] | str | bool | float | bytes | datetime | None[source]
get_class_list() Mapping[str, Class][source]
property images: List[DyldImage]
interactive(additional_namespace: Mapping = None)[source]

Start an interactive shell

is_idevice
is_objc_type(symbol: DarwinSymbol) bool[source]

Test if a given symbol represents an objc object :param symbol: :return:

load_all_libraries(rebind_symbols=True) None[source]
load_framework(name: str) DarwinSymbol[source]
objc_get_class(name: str)[source]

Get ObjC class object :param name: :return:

objc_symbol(address) ObjectiveCSymbol[source]

Get objc symbol wrapper for given address :param address: :return: ObjectiveC symbol object

rebind_symbols(populate_global_scope=True) None[source]
property roots: List[str]

get a list of all accessible darwin roots when used for lookup of files/preferences/…

showclass(class_address: Symbol) Mapping[source]
showobject(object_address: Symbol) Mapping[source]
symbol(symbol: int)[source]

at a symbol object from a given address

uname
class rpcclient.darwin.client.DyldImage(name: str, base_address: int)[source]

Bases: object

base_address: int
name: str
class rpcclient.darwin.client.IsaMagic(mask, value)

Bases: tuple

mask

Alias for field number 0

value

Alias for field number 1

rpcclient.darwin.common

rpcclient.darwin.consts

class rpcclient.darwin.consts.ARMThreadFlavors(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

ARM_DEBUG_STATE = 4
ARM_EXCEPTION_STATE = 3
ARM_EXCEPTION_STATE64 = 7
ARM_THREAD_STATE = 1
ARM_THREAD_STATE64 = 6
ARM_VFP_STATE = 2
ARN_THREAD_STATE_NONE = 5
class rpcclient.darwin.consts.AVAudioSessionCategoryOptions(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntFlag

AllowAirPlay = 64
AllowBluetooth = 4
AllowBluetoothA2DP = 32
DefaultToSpeaker = 8
DuckOthers = 2
InterruptSpokenAudioAndMixWithOthers = 17
MixWithOthers = 1
OverrideMutedMicrophoneInterruption = 128
class rpcclient.darwin.consts.AVAudioSessionRouteSharingPolicy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Default = 0
Independent = 2
LongForm = 1
LongFormAudio = 1
LongFormVideo = 3
class rpcclient.darwin.consts.CFPropertyListFormat(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

kCFPropertyListBinaryFormat_v1_0 = 200
kCFPropertyListOpenStepFormat = 1
kCFPropertyListXMLFormat_v1_0 = 100
class rpcclient.darwin.consts.CFPropertyListMutabilityOptions(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

kCFPropertyListImmutable = 0
kCFPropertyListMutableContainers = 1
kCFPropertyListMutableContainersAndLeaves = 2
class rpcclient.darwin.consts.CFStringEncoding(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

kCFStringEncodingASCII = 1536
kCFStringEncodingISOLatin1 = 513
kCFStringEncodingMacRoman = 0
kCFStringEncodingNextStepLatin = 2817
kCFStringEncodingNonLossyASCII = 3071
kCFStringEncodingUTF16 = 256
kCFStringEncodingUTF16BE = 268435712
kCFStringEncodingUTF16LE = 335544576
kCFStringEncodingUTF32 = 201326848
kCFStringEncodingUTF32BE = 402653440
kCFStringEncodingUTF32LE = 469762304
kCFStringEncodingUTF8 = 134217984
kCFStringEncodingUnicode = 256
kCFStringEncodingWindowsLatin1 = 1280
class rpcclient.darwin.consts.IOHIDDigitizerEventMask(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

kIOHIDDigitizerEventAttribute = 64
kIOHIDDigitizerEventCancel = 128
kIOHIDDigitizerEventEstimatedAltitude = 268435456
kIOHIDDigitizerEventEstimatedAzimuth = 536870912
kIOHIDDigitizerEventEstimatedPressure = 1073741824
kIOHIDDigitizerEventForcePopped = 65536
kIOHIDDigitizerEventFromCorner = 4096
kIOHIDDigitizerEventFromEdgeFlat = 1024
kIOHIDDigitizerEventFromEdgeForceActive = 32768
kIOHIDDigitizerEventFromEdgeForcePending = 16384
kIOHIDDigitizerEventFromEdgeTip = 2048
kIOHIDDigitizerEventIdentity = 32
kIOHIDDigitizerEventPeak = 16
kIOHIDDigitizerEventPosition = 4
kIOHIDDigitizerEventRange = 1
kIOHIDDigitizerEventResting = 512
kIOHIDDigitizerEventStart = 256
kIOHIDDigitizerEventStop = 8
kIOHIDDigitizerEventSwipeDown = 33554432
kIOHIDDigitizerEventSwipeLeft = 67108864
kIOHIDDigitizerEventSwipeMask = 251658240
kIOHIDDigitizerEventSwipePending = 8192
kIOHIDDigitizerEventSwipeRight = 134217728
kIOHIDDigitizerEventSwipeUp = 16777216
kIOHIDDigitizerEventTouch = 2
class rpcclient.darwin.consts.IOHIDDigitizerTransducerType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

kIOHIDDigitizerTransducerTypeFinger = 2
kIOHIDDigitizerTransducerTypeHand = 3
kIOHIDDigitizerTransducerTypePuck = 1
kIOHIDDigitizerTransducerTypeStylus = 0
class rpcclient.darwin.consts.IOHIDEventField(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

kIOHIDEventFieldIsBuiltIn = 4
kIOHIDEventFieldIsCenterOrigin = 3
kIOHIDEventFieldIsCollection = 1
kIOHIDEventFieldIsPixelUnits = 2
kIOHIDEventFieldIsRelative = 0
rpcclient.darwin.consts.IOHIDEventFieldBase(type_)[source]
class rpcclient.darwin.consts.IOHIDEventFieldDigitizer(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

kIOHIDEventFieldDigitizerAltitude = 720911
kIOHIDEventFieldDigitizerAuxiliaryPressure = 720907
kIOHIDEventFieldDigitizerAzimuth = 720912
kIOHIDEventFieldDigitizerButtonMask = 720899
kIOHIDEventFieldDigitizerChildEventMask = 720920
kIOHIDEventFieldDigitizerCollection = 720918
kIOHIDEventFieldDigitizerCollectionChord = 720919
kIOHIDEventFieldDigitizerDensity = 720914
kIOHIDEventFieldDigitizerDidUpdateMask = 720925
kIOHIDEventFieldDigitizerEstimatedMask = 720926
kIOHIDEventFieldDigitizerEventMask = 720903
kIOHIDEventFieldDigitizerGenerationCount = 720923
kIOHIDEventFieldDigitizerIdentity = 720902
kIOHIDEventFieldDigitizerIndex = 720901
kIOHIDEventFieldDigitizerIrregularity = 720915
kIOHIDEventFieldDigitizerIsDisplayIntegrated = 720921
kIOHIDEventFieldDigitizerMajorRadius = 720916
kIOHIDEventFieldDigitizerMinorRadius = 720917
kIOHIDEventFieldDigitizerPressure = 720906
kIOHIDEventFieldDigitizerQuality = 720913
kIOHIDEventFieldDigitizerQualityRadiiAccuracy = 720922
kIOHIDEventFieldDigitizerRange = 720904
kIOHIDEventFieldDigitizerTiltX = 720909
kIOHIDEventFieldDigitizerTiltY = 720910
kIOHIDEventFieldDigitizerTouch = 720905
kIOHIDEventFieldDigitizerTwist = 720908
kIOHIDEventFieldDigitizerType = 720900
kIOHIDEventFieldDigitizerWillUpdateMask = 720924
kIOHIDEventFieldDigitizerX = 720896
kIOHIDEventFieldDigitizerY = 720897
kIOHIDEventFieldDigitizerZ = 720898
rpcclient.darwin.consts.IOHIDEventFieldOffsetOf(field)[source]
class rpcclient.darwin.consts.IOHIDEventOptionBits(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

kIOHIDEventOptionIsAbsolute = 1
kIOHIDEventOptionIsBuiltIn = 16
kIOHIDEventOptionIsCenterOrigin = 8
kIOHIDEventOptionIsCollection = 2
kIOHIDEventOptionIsPixelUnits = 4
kIOHIDEventOptionNone = 0
kIOHIDEventOptionPixelUnits = 4
class rpcclient.darwin.consts.IOHIDEventType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

kIOHIDEventTypeAccelerometer = 13
kIOHIDEventTypeAmbientLightSensor = 12
kIOHIDEventTypeAtmosphericPressure = 31
kIOHIDEventTypeBiometric = 29
kIOHIDEventTypeBoundaryScroll = 28
kIOHIDEventTypeBrightness = 38
kIOHIDEventTypeButton = 2
kIOHIDEventTypeCollection = 37
kIOHIDEventTypeCompass = 21
kIOHIDEventTypeCount = 39
kIOHIDEventTypeDigitizer = 11
kIOHIDEventTypeDockSwipe = 23
kIOHIDEventTypeFluidTouchGesture = 27
kIOHIDEventTypeForce = 32
kIOHIDEventTypeGameController = 35
kIOHIDEventTypeGyro = 20
kIOHIDEventTypeHumidity = 36
kIOHIDEventTypeKeyboard = 3
kIOHIDEventTypeLED = 26
kIOHIDEventTypeMotionActivity = 33
kIOHIDEventTypeMotionGesture = 34
kIOHIDEventTypeMouse = 17
kIOHIDEventTypeMultiAxisPointer = 19
kIOHIDEventTypeNULL = 0
kIOHIDEventTypeNavigationSwipe = 16
kIOHIDEventTypeOrientation = 10
kIOHIDEventTypePointer = 17
kIOHIDEventTypePower = 25
kIOHIDEventTypeProgress = 18
kIOHIDEventTypeProximity = 14
kIOHIDEventTypeRotation = 5
kIOHIDEventTypeScale = 7
kIOHIDEventTypeScroll = 6
kIOHIDEventTypeSwipe = 16
kIOHIDEventTypeSymbolicHotKey = 24
kIOHIDEventTypeTemperature = 15
kIOHIDEventTypeTranslation = 4
kIOHIDEventTypeUnicode = 30
kIOHIDEventTypeVelocity = 9
kIOHIDEventTypeVendorDefined = 1
kIOHIDEventTypeZoom = 8
kIOHIDEventTypeZoomToggle = 22
rpcclient.darwin.consts.IOHIDEventTypeMask(type_)[source]
class rpcclient.darwin.consts.IOHIDSwipeMask(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

kIOHIDRotateCCW = 128
kIOHIDRotateCW = 64
kIOHIDScaleContract = 32
kIOHIDScaleExpand = 16
kIOHIDSwipeDown = 2
kIOHIDSwipeLeft = 4
kIOHIDSwipeNone = 0
kIOHIDSwipeRight = 8
kIOHIDSwipeUp = 1
class rpcclient.darwin.consts.IOPMUserActiveType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

kIOPMUserActiveLocal = 0
kIOPMUserActiveRemote = 1
class rpcclient.darwin.consts.NSStringEncoding(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

NSASCIIStringEncoding = 1
NSISO2022JPStringEncoding = 21
NSISOLatin1StringEncoding = 5
NSISOLatin2StringEncoding = 9
NSJapaneseEUCStringEncoding = 3
NSMacOSRomanStringEncoding = 30
NSNEXTSTEPStringEncoding = 2
NSNonLossyASCIIStringEncoding = 7
NSShiftJISStringEncoding = 8
NSSymbolStringEncoding = 6
NSUTF16BigEndianStringEncoding = 2415919360
NSUTF16LittleEndianStringEncoding = 2483028224
NSUTF16StringEncoding = 10
NSUTF32BigEndianStringEncoding = 2550137088
NSUTF32LittleEndianStringEncoding = 2617245952
NSUTF32StringEncoding = 2348810496
NSUTF8StringEncoding = 4
NSUnicodeStringEncoding = 10
NSWindowsCP1250StringEncoding = 15
NSWindowsCP1251StringEncoding = 11
NSWindowsCP1252StringEncoding = 12
NSWindowsCP1253StringEncoding = 13
NSWindowsCP1254StringEncoding = 14
class rpcclient.darwin.consts.OsLogLevel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

LogLevel. Extracted by reversing LevelForKey(id prefs, NSString *key)

DEBUG = 4
DEFAULT = 2
INFO = 3
NONE = 0
OFF = 0
UNDEFINED = 1

rpcclient.darwin.core_graphics

class rpcclient.darwin.core_graphics.CoreGraphics(client)[source]

Bases: object

Manage Core Graphics events.

send_key_press(key_code: int, interval: float | int = 0)[source]

Send a key-press event. Accessibility features must be allowed.

send_keyboard_event(key_code: int, down: bool)[source]

send a CG keyboard event https://developer.apple.com/documentation/coregraphics/1456564-cgeventcreatekeyboardevent

property window_list

get a list of all opened windows https://developer.apple.com/documentation/coregraphics/1455137-cgwindowlistcopywindowinfo?language=objc

rpcclient.darwin.crash_reports

class rpcclient.darwin.crash_reports.CrashReports(client, crash_reports_dir)[source]

Bases: object

” manage crash reports

clear(prefixed='')[source]

remove all existing crash reports

list(prefixed='') List[CrashReportBase][source]

get a list of all crash reports as CrashReport parsed objects

set_symbolicated(enabled: bool = True)[source]

enable/disable crash reports symbolication https://github.com/dlevi309/Symbolicator

rpcclient.darwin.darwin_lief

class rpcclient.darwin.darwin_lief.DarwinLief(client)[source]

Bases: Lief

get_entitlements(path: str) Mapping[source]

rpcclient.darwin.fs

class rpcclient.darwin.fs.DarwinFs(client)[source]

Bases: Fs

chflags(path: str, flags: int) None[source]

call chflags(path, flags) at remote. see manpage for more info

dictxattr(path: str) Mapping[str, bytes][source]

get a dictionary of all extended attributes

getxattr(path: str, name: str) bytes[source]

get an extended attribute value

listxattr(path: str) List[str][source]

list extended attribute names

lstat(path: str)[source]

lstat(filename) at remote. read man for more details.

removexattr(path: str, name: str)[source]

remove an extended attribute value

setxattr(path: str, name: str, value: bytes)[source]

set an extended attribute value

stat(path: str)[source]

stat(filename) at remote. read man for more details.

statfs(path: str)[source]
rpcclient.darwin.fs.do_stat(client, stat_name, filename: str)[source]

stat(filename) at remote. read man for more details.

rpcclient.darwin.hid

class rpcclient.darwin.hid.Hid(client)[source]

Bases: object

Control HID devices and simulate events

create_digitizer_event(type_: IOHIDDigitizerTransducerType | int, index: int, identity: int, event_mask: int, button_mask: int, x: float, y: float, z: float, tip_pressure: float, barrel_pressure: float, range_: bool, touch: bool, options: int, timestamp=None)[source]
create_digitizer_finger_event(index: int, identity: int, event_mask: int, button_mask: int, x: float, y: float, z: float, tip_pressure: float, twist: float, range_: bool, touch: bool, options: int, timestamp=None)[source]
create_hid_client()[source]
dispatch(event)[source]
send_double_home_button_press()[source]
send_fast_forward_button_press()[source]
send_home_button_press()[source]
send_key_press(page: int, key_code: int, interval: float | int = 0)[source]
send_keyboard_event(page: int, key_code: int, down: bool)[source]
send_mute_button_press()[source]
send_pause_button_press()[source]
send_play_button_press()[source]
send_play_pause_button_press()[source]
send_power_button_press(interval: int = 0)[source]
send_random_play_button_press()[source]
send_repeat_button_press()[source]
send_rewind_button_press()[source]
send_search_button_press()[source]
send_swipe(from_x: float, from_y: float, to_x: float, to_y: float)[source]
send_swipe_down()[source]
send_swipe_left()[source]
send_swipe_right()[source]
send_swipe_up()[source]
send_touch_event(event_type: TouchEventType, x: float, y: float, pressure: float = 0.4)[source]
send_volume_down_button_press(interval: int = 0)[source]
send_volume_up_button_press(interval: int = 0)[source]
class rpcclient.darwin.hid.TouchEventType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

TOUCH_DOWN = 0
TOUCH_MOVE = 2
TOUCH_UP = 1

rpcclient.darwin.ioregistry

class rpcclient.darwin.ioregistry.BacklightControlService(client, service)[source]

Bases: IOService

property brightness: int
property display_parameters: Mapping
class rpcclient.darwin.ioregistry.IORegistry(client)[source]

Bases: object

IORegistry utils https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/TheRegistry/TheRegistry.html

property backlight_control: BacklightControlService
property power_source: PowerSourceService
property root: IOService
class rpcclient.darwin.ioregistry.IOService(client, service)[source]

Bases: Allocated

representation of a remote IOService

get(key: str)[source]
property name: str
property properties: Mapping
set(properties: Mapping)[source]
class rpcclient.darwin.ioregistry.PowerSourceService(client, service)[source]

Bases: IOService

property at_warn_level: bool
property battery_voltage: int
property charging: bool
property current_capacity: int
property external_connected: bool
property temperature: int
property time_remaining: int

rpcclient.darwin.keychain

class rpcclient.darwin.keychain.Keychain(client)[source]

Bases: object

keychain utils

add_internet_password(account: str, server: str, password: str)[source]
query_apple_share_passwords() List[Mapping][source]
query_certificates() List[Mapping][source]
query_generic_passwords() List[Mapping][source]
query_identities() List[Mapping][source]
query_internet_passwords() List[Mapping][source]
query_keys() List[Mapping][source]

rpcclient.darwin.location

class rpcclient.darwin.location.CLAuthorizationStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

classmethod from_value(value: int)[source]
kCLAuthorizationStatusAuthorized = 3
kCLAuthorizationStatusAuthorizedAlways = 3
kCLAuthorizationStatusAuthorizedWhenInUse = 4
kCLAuthorizationStatusDenied = 2
kCLAuthorizationStatusNotDetermined = 0
kCLAuthorizationStatusRestricted = 1
class rpcclient.darwin.location.Location(client)[source]

Bases: object

Wrapper to CLLocationManager https://developer.apple.com/documentation/corelocation/cllocationmanager?language=objc

property authorization_status: CLAuthorizationStatus

authorization status for current server process of accessing location services

property last_sample: Mapping | None

last taken location sample (or None if there isn’t any)

property location_services_enabled: bool

opt-in status for location services

request_oneshot_location()[source]

requests the one-time delivery of the user’s current location

start_updating_location()[source]

request location updates from CLLocationManager

stop_updating_location()[source]

stop requesting location updates from CLLocationManager

rpcclient.darwin.media

class rpcclient.darwin.media.AVAudioSessionCategory(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

https://developer.apple.com/documentation/avfaudio/AVAudioSessionCategory?language=objc

Ambient = 'AVAudioSessionCategoryAmbient'
AudioProcessing = 'AVAudioSessionCategoryAudioProcessing'
MultiRoute = 'AVAudioSessionCategoryMultiRoute'
PlayAndRecord = 'AVAudioSessionCategoryPlayAndRecord'
Playback = 'AVAudioSessionCategoryPlayback'
Record = 'AVAudioSessionCategoryRecord'
SoloAmbient = 'AVAudioSessionCategorySoloAmbient'
class rpcclient.darwin.media.AVAudioSessionMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

https://developer.apple.com/documentation/avfaudio/avaudiosessionmode?language=objc

Default = 'AVAudioSessionModeDefault'
GameChat = 'AVAudioSessionModeGameChat'
Measurement = 'AVAudioSessionModeMeasurement'
MoviePlayback = 'AVAudioSessionModeMoviePlayback'
SpokenAudio = 'AVAudioSessionModeSpokenAudio'
VideoChat = 'AVAudioSessionModeVideoChat'
VideoRecording = 'AVAudioSessionModeVideoRecording'
VoiceChat = 'AVAudioSessionModeVoiceChat'
VoicePrompt = 'AVAudioSessionModeVoicePrompt'
class rpcclient.darwin.media.AudioSession(client)[source]

Bases: object

wrapper for AVAudioSession https://developer.apple.com/documentation/avfaudio/avaudiosession?language=objc

property available_categories: List[str]
property other_audio_playing: bool
override_output_audio_port(port: int)[source]
property record_permission
set_active(is_active: bool)[source]
set_category(category: AVAudioSessionCategory, mode: AVAudioSessionMode = AVAudioSessionMode.Default, route_sharing_policy: AVAudioSessionRouteSharingPolicy = AVAudioSessionRouteSharingPolicy.Default, options: AVAudioSessionCategoryOptions = 0)[source]
set_mode(mode: AVAudioSessionMode)[source]
class rpcclient.darwin.media.DarwinMedia(client)[source]

Bases: object

Media utils

get_player(filename: str) Player[source]
get_recorder(filename: str) Recorder[source]
class rpcclient.darwin.media.Player(client, session: AudioSession, player: DarwinSymbol)[source]

Bases: Allocated

Wrapper for AVAudioPlayer https://developer.apple.com/documentation/avfaudio/avaudioplayer?language=objc

property loops: int
pause()[source]
play()[source]
property playing: bool
set_volume(value: float)[source]
stop()[source]
class rpcclient.darwin.media.Recorder(client, session: AudioSession, recorder: DarwinSymbol)[source]

Bases: Allocated

Wrapper for AVAudioRecorder https://developer.apple.com/documentation/avfaudio/avaudiorecorder?language=objc

delete_recording()[source]
pause()[source]
record()[source]
property recording: bool
stop()[source]

rpcclient.darwin.network

class rpcclient.darwin.network.DarwinNetwork(client)[source]

Bases: Network

” Network utils

flush_dns() None[source]
property proxy_settings: Mapping
remove_certificate_pinning() None[source]

rpcclient.darwin.objc

class rpcclient.darwin.objc.Method(name: str, client: rpcclient.client.Client, address: int, imp: int, type_: str, return_type: str, is_class: bool, args_types: list)[source]

Bases: object

address: int
always_return(value: bool) None[source]

Patch the method to always return the given value.

args_types: list
client: Client
static from_data(data: Mapping, client)[source]

Create Method object from raw data. :param data: Data as loaded from get_objectivec_symbol_data.m. :param rpcclient.darwin.client.DarwinClient client: Darwin client.

imp: int
is_class: bool
name: str
return_type: str
set_implementation(new_imp: int)[source]
type_: str
class rpcclient.darwin.objc.Property(name, attributes)

Bases: tuple

attributes

Alias for field number 1

name

Alias for field number 0

class rpcclient.darwin.objc.PropertyAttributes(synthesize, type_, list)

Bases: tuple

list

Alias for field number 2

synthesize

Alias for field number 0

type_

Alias for field number 1

rpcclient.darwin.objc.convert_encoded_property_attributes(encoded)[source]

rpcclient.darwin.objective_c_class

class rpcclient.darwin.objective_c_class.Class(client, class_object=0, class_data: Mapping = None, lazy=False)[source]

Bases: object

Wrapper for ObjectiveC Class object.

property bundle_path: Path
static from_class_name(client, class_name: str)[source]

Create ObjectiveC Class from given class name. :param rpcclient.darwin.client.DarwinClient client: Darwin client. :param class_name: Class name.

get_method(name: str)[source]

Get a specific method implementation. :param name: Method name. :return: Method.

iter_supers()[source]

Iterate over the super classes of the class.

objc_call(sel: str, *args, **kwargs)[source]

Invoke a selector on the given class object. :param sel: Selector name. :return: whatever the selector returned as a symbol.

reload()[source]

Reload class object data. Should be used whenever the class layout changes (for example, during method swizzling)

static sanitize_name(name: str)[source]

Sanitize python name to ObjectiveC name.

show(dump_to: str | None = None)[source]

Print to terminal the highlighted class description. :param dump_to: directory to dump.

property symbols_jar: SymbolsJar

Get a SymbolsJar object for quick operations on all methods

class rpcclient.darwin.objective_c_class.Ivar(name, type_, offset)

Bases: tuple

name

Alias for field number 0

offset

Alias for field number 2

type_

Alias for field number 1

rpcclient.darwin.objective_c_symbol

class rpcclient.darwin.objective_c_symbol.Ivar(name: str, value: rpcclient.darwin.symbol.DarwinSymbol, type_: str, offset: int)[source]

Bases: object

name: str
offset: int
type_: str
value: DarwinSymbol
class rpcclient.darwin.objective_c_symbol.ObjectiveCSymbol[source]

Bases: DarwinSymbol

Wrapper object for an objective-c symbol. Allowing easier access to its properties, methods and ivars.

classmethod create(value: int, client)[source]

Create an ObjectiveCSymbol object. :param value: Symbol address. :param rpcclient.darwin.client.Client client: client. :return: ObjectiveCSymbol object. :rtype: ObjectiveCSymbol

objc_call(selector: str, *params, **kwargs)[source]

Make objc_call() from self return ObjectiveCSymbol when it’s an objc symbol. :param selector: Selector to execute. :param params: Additional parameters. :return: ObjectiveCSymbol when return type is an objc symbol.

reload()[source]

Reload object’s in-memory layout.

show(dump_to: str | None = None, recursive: bool = False)[source]

Print to terminal the highlighted class description. :param dump_to: directory to dump. :param recursive: Show methods of super classes.

property symbols_jar: SymbolsJar

Get a SymbolsJar object for quick operations on all methods

exception rpcclient.darwin.objective_c_symbol.SettingIvarError[source]

Bases: RpcClientException

Raise when trying to set an Ivar too early or when the Ivar doesn’t exist.

rpcclient.darwin.preferences

class rpcclient.darwin.preferences.Preferences(client)[source]

Bases: object

Preferences utils

rpcclient.darwin.processes

class rpcclient.darwin.processes.ArmThread64(client, thread_id: int)[source]

Bases: Thread

get_state()[source]
resume()[source]
set_state(state: Mapping)[source]
suspend()[source]
class rpcclient.darwin.processes.Backtrace(vmu_backtrace: rpcclient.darwin.symbol.DarwinSymbol)[source]

Bases: object

dispatch_queue_serial_num: int
flavor: str
frames: List[Frame]
pid: int
thread_id: int
time_end: float
time_start: float
class rpcclient.darwin.processes.DarwinProcesses(client)[source]

Bases: Processes

manage processes

fuser(path: str) List[Process][source]

get a list of all processes have an open hande to the specified path

get_by_basename(name: str) Process[source]

get process object by basename

get_by_name(name: str) Process[source]

get process object by name

get_by_pid(pid: int) Process[source]

get process object by pid

get_processes_by_listening_port(port: int) List[Process][source]

get a process object listening on the specified port

get_self() Process[source]

get self process

grep(name: str) List[Process][source]

get process list by basename filter

list() List[Process][source]

list all currently running processes

lsof() Mapping[int, List[Fd]][source]

get dictionary of pid to its opened fds

class rpcclient.darwin.processes.Fd(fd: int)[source]

Bases: object

fd: int
class rpcclient.darwin.processes.FdStruct(fd, struct)

Bases: tuple

fd

Alias for field number 0

struct

Alias for field number 1

class rpcclient.darwin.processes.FileFd(fd: int, path: str)[source]

Bases: Fd

path: str
class rpcclient.darwin.processes.Frame(depth: int, address: int, section: str, offset: int, symbol_name: str)[source]

Bases: object

address: int
depth: int
offset: int
section: str
symbol_name: str
class rpcclient.darwin.processes.Image(address, path)

Bases: tuple

address

Alias for field number 0

path

Alias for field number 1

class rpcclient.darwin.processes.IntelThread64(client, thread_id: int)[source]

Bases: Thread

get_state()[source]
set_state(state: Mapping)[source]
class rpcclient.darwin.processes.Ipv4SocketFd(fd: int, local_address: str, local_port: int, remote_address: str, remote_port: int)[source]

Bases: SocketFd

local_address: str
local_port: int
remote_address: str
remote_port: int
class rpcclient.darwin.processes.Ipv4TcpFd(fd: int, local_address: str, local_port: int, remote_address: str, remote_port: int)[source]

Bases: Ipv4SocketFd

class rpcclient.darwin.processes.Ipv4UdpFd(fd: int, local_address: str, local_port: int, remote_address: str, remote_port: int)[source]

Bases: Ipv4SocketFd

class rpcclient.darwin.processes.Ipv6SocketFd(fd: int, local_address: str, local_port: int, remote_address: str, remote_port: int)[source]

Bases: SocketFd

local_address: str
local_port: int
remote_address: str
remote_port: int
class rpcclient.darwin.processes.Ipv6TcpFd(fd: int, local_address: str, local_port: int, remote_address: str, remote_port: int)[source]

Bases: Ipv6SocketFd

class rpcclient.darwin.processes.Ipv6UdpFd(fd: int, local_address: str, local_port: int, remote_address: str, remote_port: int)[source]

Bases: Ipv6SocketFd

class rpcclient.darwin.processes.KQueueFd(fd: int)[source]

Bases: Fd

class rpcclient.darwin.processes.LoadedClass(name: str, type_name: str, binary_path: str)[source]

Bases: object

binary_path: str
name: str
type_name: str
class rpcclient.darwin.processes.PipeFd(fd: int)[source]

Bases: Fd

class rpcclient.darwin.processes.Process(client, pid: int)[source]

Bases: object

PEEK_STR_CHUNK_SIZE = 256
property app_images: List[Image]
property arguments: List[str]
property backtraces: List[Backtrace]
basename
dump_app(output_dir: str, chunk_size=65536) None[source]

Based on: https://github.com/AloneMonkey/frida-ios-dump/blob/master/dump.js

property environ: List[str]
property fd_structs: List[FdStruct]

get a list of process opened file descriptors as raw structs

property fds: List[Fd]

get a list of process opened file descriptors

get_process_symbol(address: int) ProcessSymbol[source]
get_symbol_address(name: str, lib: str = None) ProcessSymbol[source]
get_symbol_class_info(address: int) DarwinSymbol[source]
get_symbol_image(name: str) Image[source]
get_symbol_name(address: int) str[source]
gid
property images: List[Image]

get loaded image list

kill(sig: int = 15)[source]

kill(pid, sig) at remote. read man for more details.

property loaded_classes
name
property parent: Process
path

call proc_pidpath(filename, …) at remote. review xnu header for more details.

peek(address: int, size: int) bytes[source]

peek at memory address

peek_str(address: int, encoding='utf-8') str[source]

peek string at memory address

property pid: int

get pid

poke(address: int, buf: bytes)[source]

poke at memory address

ppid
property procargs2: Container
property raw_procargs2: bytes
property regions: List[Region]
rgid
ruid
start_time
task
property task_all_info

get a list of process opened file descriptors

property threads: List[Thread]
uid
vm_allocate(size: int) ProcessSymbol[source]
vmu_object_identifier
vmu_proc_info
vmu_region_identifier
waitpid(flags: int = 0)[source]

waitpid(pid, stat_loc, 0) at remote. read man for more details.

class rpcclient.darwin.processes.ProcessSymbol[source]

Bases: Symbol

classmethod create(value: int, client, process)[source]

Create a Symbol object. :param value: Symbol address. :param rpcclient.darwin_client.Client client: client. :return: Symbol object. :rtype: Symbol

property dl_info: Container
property filename: str
property name: str
peek(count: int) bytes[source]
peek_str(encoding='utf-8') str[source]

peek string at given address

poke(buf: bytes) None[source]
class rpcclient.darwin.processes.Region(region_type: str, start: 'ProcessSymbol', end: int, vsize: str, protection: str, protection_max: str, region_detail: str)[source]

Bases: object

end: int
protection: str
protection_max: str
region_detail: str
region_type: str
property size: int
start: ProcessSymbol
vsize: str
class rpcclient.darwin.processes.SocketFd(fd: int)[source]

Bases: Fd

class rpcclient.darwin.processes.Thread(client, thread_id: int)[source]

Bases: object

get_state()[source]
resume()[source]
set_state(state: Mapping)[source]
suspend()[source]
property thread_id: int
class rpcclient.darwin.processes.UnixFd(fd: int, path: str)[source]

Bases: Fd

path: str

rpcclient.darwin.reports

class rpcclient.darwin.reports.Reports(client, crash_reports_dir)[source]

Bases: object

equivalent to the data that can be found using the Console app inside the Reports section

get_logs(prefix='') List[Path][source]
property system_log: str

rpcclient.darwin.scpreferences

class rpcclient.darwin.scpreferences.Plist(preference: SCPreference)[source]

Bases: UserDict

commit()[source]
class rpcclient.darwin.scpreferences.SCPreference(client, preferences_id: str, ref)[source]

Bases: Allocated

clear()[source]

clear dictionary and commit

get(key: str)[source]

wrapper for SCPreferencesGetValue

get_dict() Mapping[source]

get a dictionary representation

interactive()[source]

open an interactive IPython shell for viewing and editing

property keys: List[str]

wrapper for SCPreferencesCopyKeyList

remove(key: str)[source]

remove given key and commit

set(key: str, value)[source]

set key:value and commit the change

set_dict(d: Mapping)[source]

set the entire preference dictionary (clear if already exists) and commit the change

update_dict(d: Mapping)[source]

update preference dictionary and commit

class rpcclient.darwin.scpreferences.SCPreferences(client)[source]

Bases: object

API to the SCPreferences* functions - preferences managed by SystemConfiguration framework. https://developer.apple.com/documentation/systemconfiguration/scpreferences?language=objc

get_dict(preferences_id: str)[source]

get dict from given preferences_id

get_keys(preferences_id: str) List[str][source]

get all keys from given preferences_id

open(preferences_id: str) SCPreference[source]

get an SCPreference from a given preferences_id

rpcclient.darwin.structs

class rpcclient.darwin.structs.IpAddressAdapter(subcon)[source]

Bases: Adapter

rpcclient.darwin.symbol

class rpcclient.darwin.symbol.DarwinSymbol[source]

Bases: Symbol

property cfdesc

Get output from CFCopyDescription() :return: CFCopyDescription()’s output as a string

objc_call(selector, *params, **kwargs)[source]

call an objc method on a given object

property objc_symbol

Get an ObjectiveC symbol of the same address :return: Object representing the ObjectiveC symbol

property osstatus: List[ErrorCode] | None
py(*args, **kwargs)[source]

get a python object from a core foundation one

property region

get corresponding region

rpcclient.darwin.syslog

class rpcclient.darwin.syslog.OsLogPreferencesBase(client, obj: DarwinSymbol)[source]

Bases: object

property default_enabled_level: OsLogLevel
property default_persisted_level: OsLogLevel
property enabled_level: OsLogLevel
property name: str
property persisted_level: OsLogLevel
reset() None[source]
class rpcclient.darwin.syslog.OsLogPreferencesCategory(client, category: str, subsystem: DarwinSymbol)[source]

Bases: OsLogPreferencesBase

property name: str
class rpcclient.darwin.syslog.OsLogPreferencesManager(client)[source]

Bases: OsLogPreferencesBase

get_subsystem(name: str) OsLogPreferencesSubsystem[source]
property subsystem_strings: List[str]
property subsystems: List[OsLogPreferencesSubsystem]
class rpcclient.darwin.syslog.OsLogPreferencesSubsystem(client, subsystem: str)[source]

Bases: OsLogPreferencesBase

property categories: List[OsLogPreferencesCategory]
property category_strings: List[OsLogPreferencesCategory]
get_category(name: str) OsLogPreferencesCategory[source]
class rpcclient.darwin.syslog.Syslog(client)[source]

Bases: object

” manage syslog

set_har_capture_global(enable: bool = True)[source]

enable/disable HAR logging https://github.com/doronz88/harlogger

set_harlogger_for_all(value: bool, expression: str = None) None[source]
set_harlogger_for_process(value: bool, pid: int) None[source]
set_unredacted_logs(enable: bool = True)[source]

enable/disable unredacted logs (allows seeing the <private> strings) https://github.com/EthanArbuckle/unredact-private-os_logs

rpcclient.darwin.time

class rpcclient.darwin.time.Time(client)[source]

Bases: object

boot_time() datetime[source]
property is_set_automatically

tell is time settings are set to automatic

now() datetime[source]

get current time

set_auto()[source]

opt-in automatic time settings

set_current(new_time: datetime)[source]

set current time

rpcclient.darwin.xpc

class rpcclient.darwin.xpc.XPCDictionary[source]

Bases: XPCObject

get_bool(key: str) None[source]
get_data(key: str) bytes[source]
get_dictionary(key: str) XPCDictionary[source]
get_fd(key: str) int[source]
get_int64(key: str) int[source]
get_object(key: str) XPCObject[source]
get_string(key: str) str[source]
get_uint64(key: str) int[source]
get_uuid(key: str) str[source]
get_value(key: str) XPCObject[source]
set_bool(key: str, value: bool) None[source]
set_data(key: str, value: bytes) None[source]
set_dictionary(key: str, value: int) None[source]
set_fd(key: str, value: int) None[source]
set_int64(key: str, value: int) None[source]
set_object(obj: XPCObject) None[source]
set_string(key: str, value: str) None[source]
set_uint64(key: str, value: int) None[source]
set_uuid(key: str, value: str) None[source]
set_value(obj: XPCObject) None[source]
class rpcclient.darwin.xpc.XPCObject[source]

Bases: DarwinSymbol

property type: int
class rpcclient.darwin.xpc.Xpc(client)[source]

Bases: object

create_xpc_dictionary() XPCDictionary[source]
decode_xpc_message_using_cf_serialization(address: DarwinSymbol) Mapping[str, Any] | List | Tuple[Any, ...] | str | bool | float | bytes | datetime | None[source]

Convert a CFObject serialized over an XPCObject to python object

decode_xpc_object_using_cf_serialization(address: DarwinSymbol) Mapping[str, Any] | List | Tuple[Any, ...] | str | bool | float | bytes | datetime | None[source]

Convert XPC object to python object using CF serialization.

encode_xpc_message_using_cf_serialization(obj: Mapping[str, Any] | List | Tuple[Any, ...] | str | bool | float | bytes | datetime | None) DarwinSymbol[source]

Convert python object to a CFObject serialized over an XPCObject

encode_xpc_object_using_cf_serialization(obj: Mapping[str, Any] | List | Tuple[Any, ...] | str | bool | float | bytes | datetime | None) DarwinSymbol[source]

Convert python object to XPC object using CF conversion.

force_run_activities(activities: List[str]) None[source]
property loaded_activities: Mapping
send_message_raw(service_name: str, message_raw: DarwinSymbol) DarwinSymbol[source]

Send a RAW xpc object to given service_name and wait reply.

send_message_using_cf_serialization(service_name: str, message: Mapping[str, Any] | List | Tuple[Any, ...] | str | bool | float | bytes | datetime | None, decode_cf: bool = True) Mapping[str, Any] | List | Tuple[Any, ...] | str | bool | float | bytes | datetime | None[source]

Send a CFObject serialized over an XPC object to a XPC service synchronously and return reply.

Parameters:
  • service_name – mach service name

  • message – xpc message to send

  • decode_cf – should response be decoded as CFObject-over-XPCObject or a native XPC object

Returns:

received response

send_object_using_cf_serialization(service_name: str, message: Mapping[str, Any] | List | Tuple[Any, ...] | str | bool | float | bytes | datetime | None) Mapping[str, Any] | List | Tuple[Any, ...] | str | bool | float | bytes | datetime | None[source]

Send a native XPC object serialized over a CFObject to a XPC service synchronously and return reply.

Parameters:
  • service_name – mach service name

  • message – xpc message to send

Returns:

received response

send_xpc_dictionary(service_name: str, message: XPCDictionary) XPCDictionary[source]

Send a native XPC dictionary to a XPC service synchronously and return result.

Parameters:
  • service_name – mach service name

  • message – xpc message to send

Returns:

received response

set_activity_base_date(name: str, date: datetime) None[source]