Rizin
unix-like reverse engineering framework and cli tools
ios-syscalls.py
Go to the documentation of this file.
1 import json
2 
3 import rzpipe
4 
5 
6 def chk(x):
7  if x[1]["opcode"] == "svc 0x80":
8  name = x[0]["flags"][0][8:]
9  sysnum = int(x[0]["opcode"].split(" ")[2], 16)
10  print("%d\t%s" % (sysnum, name))
11 
12 
13 dev_pid = "23f88587e12c30376f8ab0b05236798fdfa4e853/4903"
14 
15 rz = rzpipe.open("frida://" + dev_pid)
16 print("Importing symbols from libSystem...")
17 rz.cmd(".=!i*")
18 rz.cmd(".=!ie* libSystem.B.dylib")
19 print("Finding syscalls...")
20 funcs = rz.cmd("pdj 2 @@f:sym.fun.*")
21 
22 for doc in funcs.split("\n"):
23  if len(doc) > 1:
24  chk(json.loads(doc))
25 rz.quit()
26 print("Thanks for waiting")
size_t len
Definition: 6502dis.c:15
def chk(x)
Definition: ios-syscalls.py:6
static int
Definition: sfsocketcall.h:114