MCPcopy Index your code
hub / github.com/ab-rizk/xpcspy

github.com/ab-rizk/xpcspy @v0.9.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.9.0 ↗ · + Follow
46 symbols 115 edges 19 files 6 documented · 13%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

xpcspy - Bidirectional XPC message interception and more

Features:

  • Bidirectional XPC message interception.
  • iOS and macOS support.
  • bplist00, and the infamous bplist15 deserialization.
  • Filter by message direction (incoming or outgoing) and service name.
  • More to come?

Showcase

Usage: xpcspy [options] target

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -D ID, --device=ID    connect to device with the given ID
  -U, --usb             connect to USB device
  -R, --remote          connect to remote frida-server
  -H HOST, --host=HOST  connect to remote frida-server on HOST
  -f FILE, --file=FILE  spawn FILE
  -F, --attach-frontmost
                        attach to frontmost application
  -n NAME, --attach-name=NAME
                        attach to NAME
  -p PID, --attach-pid=PID
                        attach to PID
  --stdio=inherit|pipe  stdio behavior when spawning (defaults to “inherit”)
  --aux=option          set aux option when spawning, such as “uid=(int)42”
                        (supported types are: string, bool, int)
  --runtime=qjs|v8      script runtime to use
  --debug               enable the Node.js compatible script debugger
  --squelch-crash       if enabled, will not dump crash report to console
  -O FILE, --options-file=FILE
                        text file containing additional command line options
  -t FILTER, --filter=FILTER
                        Filter by message direction and service name. 'i'
                        denotes incoming and 'o' denotes outgoing. Service
                        name can include the wildcard character '*'. For
                        exmaple 'i:com.apple.*' or 'o:com.apple.apsd'.
  -r, --parse           Parse XPC dictionary keys that include `bplist` data.
                        Currently `bplist00` and `bplist16` are officially
                        supported, while `bplist15` and `bplist17` support is
                        still experimental..
  -d, --print-date      Print a current timestamp before every XPC message

screenshot_1.png

Installation

pip3 install xpcspy

TODO:

  • Deserialize data within the parsed bplists recursively.
  • Improve script loading performance, kinda slow for some reason.
  • Add an option to get the address, perhaps ASLR adjusted, for the XPC event handler, by spawning the process and hooking xpc_connection_set_event_handler.
  • More pretty printing?

FAQ

  • Why are you reinventing the wheel?
    • I'm not; XPoCe doesn't intercept incoming messages, and doesn't support bplist00 or bplist15. `

License

Apache License 2.0

Extension points exported contracts — how you extend this code

IFilter (Interface)
(no doc)
agent/src/lib/interfaces.ts
IParsingResult (Interface)
(no doc)
agent/src/lib/interfaces.ts
IFunctionPointer (Interface)
(no doc)
agent/src/lib/interfaces.ts

Core symbols most depended-on inside this repo

objcObjectDebugDesc
called by 8
agent/src/lib/helpers.ts
highlight_divider
called by 2
xpcspy/lib/highlighter.py
debugDescriptionForXPCDictionary
called by 2
agent/src/lib/helpers.ts
parseBPListKeysRecursively
called by 2
agent/src/lib/parsers.ts
start_hooking
called by 1
xpcspy/utils/agent.py
_on_message
called by 1
xpcspy/utils/agent.py
flush_pending_events
called by 1
xpcspy/utils/agent.py
main
called by 1
xpcspy/console/cli.py

Shape

Function 21
Method 15
Class 6
Interface 3
Enum 1

Languages

Python59%
TypeScript41%

Modules by API surface

xpcspy/lib/types.py8 symbols
xpcspy/console/cli.py7 symbols
xpcspy/utils/agent.py6 symbols
xpcspy/lib/highlighter.py6 symbols
agent/src/lib/parsers.ts6 symbols
agent/src/lib/helpers.ts5 symbols
agent/src/lib/interfaces.ts3 symbols
agent/src/lib/formatters.ts2 symbols
agent/src/hooking.ts2 symbols
agent/src/lib/types.ts1 symbols

For agents

$ claude mcp add xpcspy \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact