From a7bfc94943b856f6f44cfa5e7620f8c38ccdb081 Mon Sep 17 00:00:00 2001 From: doronz Date: Mon, 17 Jul 2023 15:34:27 +0300 Subject: [PATCH] XPCDictionary: add `get_value()` and `set_value()` --- src/rpcclient/rpcclient/darwin/xpc.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rpcclient/rpcclient/darwin/xpc.py b/src/rpcclient/rpcclient/darwin/xpc.py index ff8249eb..75b28a3f 100644 --- a/src/rpcclient/rpcclient/darwin/xpc.py +++ b/src/rpcclient/rpcclient/darwin/xpc.py @@ -42,6 +42,9 @@ def set_dictionary(self, key: str, value: int) -> None: def set_object(self, obj: XPCObject) -> None: self._client.symbols.xpc_dictionary_set_object(self, obj) + def set_value(self, obj: XPCObject) -> None: + self._client.symbols.xpc_dictionary_set_value(self, obj) + def get_string(self, key: str) -> str: return self._client.symbols.xpc_dictionary_get_string(self, key).peek_str() @@ -67,8 +70,11 @@ def get_uuid(self, key: str) -> str: def get_dictionary(self, key: str) -> 'XPCDictionary': return XPCDictionary.create(self._client.symbols.xpc_dictionary_get_dictionary(self, key), self._client) - def get_object(self) -> XPCObject: - return XPCObject.create(self._client.symbols.xpc_dictionary_get_object(), self._client) + def get_object(self, key: str) -> XPCObject: + return XPCObject.create(self._client.symbols.xpc_dictionary_get_object(self, key), self._client) + + def get_value(self, key: str) -> XPCObject: + return XPCObject.create(self._client.symbols.xpc_dictionary_get_value(self, key), self._client) class Xpc: