mirror of
https://github.com/frida/frida-python
synced 2026-06-08 14:16:17 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| facd6756b2 | |||
| f29f486c0d | |||
| 2135414777 | |||
| ba032180c6 | |||
| b29cbcd499 | |||
| 55cdadea6a | |||
| 17d39c725c | |||
| 72f1d651b6 | |||
| 6d5c64d215 | |||
| 2b5f6492a2 | |||
| 316f88974d | |||
| fee73e852b | |||
| 37847fd8c9 | |||
| 7158638eb9 | |||
| 77d9c51109 | |||
| 040fa5536b | |||
| c9226b976a | |||
| d851e4eb6a | |||
| ccea05e00b |
@@ -3,7 +3,5 @@ import frida
|
||||
device = frida.get_usb_device()
|
||||
|
||||
diag = device.open_service("plist:com.apple.mobile.diagnostics_relay")
|
||||
diag.request({"type": "query", "payload": {"Request": "RSDCheckin", "ProtocolVersion": "2", "Label": "Frida"}})
|
||||
diag.request({"type": "read"})
|
||||
diag.request({"type": "query", "payload": {"Request": "Sleep", "WaitForDisconnect": True}})
|
||||
diag.request({"type": "query", "payload": {"Request": "Goodbye"}})
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import pprint
|
||||
import sys
|
||||
from threading import Thread
|
||||
|
||||
import frida
|
||||
|
||||
|
||||
def main():
|
||||
device = frida.get_usb_device()
|
||||
|
||||
stdout_uuid, stdout_stream = create_stdio_socket(device)
|
||||
stderr_uuid, stderr_stream = create_stdio_socket(device)
|
||||
|
||||
appservice = device.open_service("xpc:com.apple.coredevice.appservice")
|
||||
response = appservice.request(
|
||||
{
|
||||
"CoreDevice.featureIdentifier": "com.apple.coredevice.feature.launchapplication",
|
||||
"CoreDevice.action": {},
|
||||
"CoreDevice.input": {
|
||||
"applicationSpecifier": {
|
||||
"bundleIdentifier": {"_0": "no.oleavr.HelloIOS"},
|
||||
},
|
||||
"options": {
|
||||
"arguments": [],
|
||||
"environmentVariables": {},
|
||||
"standardIOUsesPseudoterminals": True,
|
||||
"startStopped": False,
|
||||
"terminateExisting": True,
|
||||
"user": {"active": True},
|
||||
"platformSpecificOptions": b'<?xml version="1.0" encoding="UTF-8"?><plist version="1.0"><dict/></plist>',
|
||||
},
|
||||
"standardIOIdentifiers": {
|
||||
"standardOutput": ("uuid", stdout_uuid),
|
||||
"standardError": ("uuid", stderr_uuid),
|
||||
},
|
||||
},
|
||||
}
|
||||
)
|
||||
pprint.pp(response)
|
||||
|
||||
workers = set()
|
||||
for stream, sink in {(stdout_stream, sys.stdout), (stderr_stream, sys.stderr)}:
|
||||
t = Thread(target=process_console_output, args=(stream, sink))
|
||||
t.start()
|
||||
workers.add(t)
|
||||
for worker in workers:
|
||||
worker.join()
|
||||
|
||||
|
||||
def create_stdio_socket(device):
|
||||
stream = device.open_channel("tcp:com.apple.coredevice.openstdiosocket")
|
||||
return (stream.read_all(16), stream)
|
||||
|
||||
|
||||
def process_console_output(stream, sink):
|
||||
while True:
|
||||
chunk = stream.read(4096)
|
||||
if not chunk:
|
||||
break
|
||||
sink.write(chunk.decode("utf-8"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+16
-17
@@ -546,7 +546,6 @@ static void PyCancellable_destroy_callback (PyObject * callback);
|
||||
static PyObject * PyCancellable_cancel (PyCancellable * self);
|
||||
|
||||
static PyObject * PyFrida_raise (GError * error);
|
||||
static gboolean PyFrida_is_string (PyObject * obj);
|
||||
static gchar * PyFrida_repr (PyObject * obj);
|
||||
static guint PyFrida_get_max_argument_count (PyObject * callable);
|
||||
|
||||
@@ -1722,7 +1721,7 @@ PyGObject_marshal_variant_array (GVariant * variant)
|
||||
static gboolean
|
||||
PyGObject_unmarshal_variant (PyObject * value, GVariant ** variant)
|
||||
{
|
||||
if (PyFrida_is_string (value))
|
||||
if (PyUnicode_Check (value))
|
||||
{
|
||||
gchar * str;
|
||||
|
||||
@@ -1733,6 +1732,13 @@ PyGObject_unmarshal_variant (PyObject * value, GVariant ** variant)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (PyBool_Check (value))
|
||||
{
|
||||
*variant = g_variant_new_boolean (value == Py_True);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (PyLong_Check (value))
|
||||
{
|
||||
PY_LONG_LONG l;
|
||||
@@ -1753,13 +1759,6 @@ PyGObject_unmarshal_variant (PyObject * value, GVariant ** variant)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (PyBool_Check (value))
|
||||
{
|
||||
*variant = g_variant_new_boolean (value == Py_True);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (PyBytes_Check (value))
|
||||
{
|
||||
char * buffer;
|
||||
@@ -1836,11 +1835,14 @@ propagate_error:
|
||||
static gboolean
|
||||
PyGObject_unmarshal_variant_from_sequence (PyObject * sequence, GVariant ** variant)
|
||||
{
|
||||
gboolean is_tuple;
|
||||
GVariantBuilder builder;
|
||||
Py_ssize_t n, i;
|
||||
PyObject * val = NULL;
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
||||
is_tuple = PyTuple_Check (sequence);
|
||||
|
||||
g_variant_builder_init (&builder, is_tuple ? G_VARIANT_TYPE_TUPLE : G_VARIANT_TYPE ("av"));
|
||||
|
||||
n = PySequence_Length (sequence);
|
||||
if (n == -1)
|
||||
@@ -1857,7 +1859,10 @@ PyGObject_unmarshal_variant_from_sequence (PyObject * sequence, GVariant ** vari
|
||||
if (!PyGObject_unmarshal_variant (val, &raw_value))
|
||||
goto propagate_error;
|
||||
|
||||
g_variant_builder_add (&builder, "v", raw_value);
|
||||
if (is_tuple)
|
||||
g_variant_builder_add_value (&builder, raw_value);
|
||||
else
|
||||
g_variant_builder_add (&builder, "v", raw_value);
|
||||
|
||||
Py_DECREF (val);
|
||||
}
|
||||
@@ -5351,12 +5356,6 @@ PyFrida_raise (GError * error)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
PyFrida_is_string (PyObject * obj)
|
||||
{
|
||||
return PyUnicode_Check (obj);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
PyFrida_repr (PyObject * obj)
|
||||
{
|
||||
|
||||
+1
-1
Submodule releng updated: b0e46f7b69...54cc29651c
@@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/frida/frida-core.git
|
||||
revision = 16.3.0
|
||||
revision = 16.4.0
|
||||
depth = 1
|
||||
|
||||
[provide]
|
||||
|
||||
Reference in New Issue
Block a user