Search code examples
objective-ccosx-mountain-lioninter-process-communicatxpc

Seeing available dictionaries in a XPC service daemon?


There are a bunch of launch daemons and agents running on an osx machine which support xpc. To see whether they support IPC over xpc, I look for any xpc functions, particularly xpc_connection_create. My understanding is that in order to speak with these processes, a dictionary has to be made through the xpc api which is then passed to the advertised com.* service. Instead of passing in random stuff, is there any way to see what the arguments of the dictionary should be per process?

If I have any of the above logic wrong, please feel free to correct it. Any advice or comment is helpful, thanks.


Solution

  • XPC connections are used to create a connection with an XPC service or to do IPC with another process that advertises a mach service.

    "xpc_connection_create" creates the connection which you use to send messages to the other peer of the connection. The protocol of the communication should be defined, and therefore, usually the two peers are owned by the same party.

    In other words, if you don't own these daemons/agents, and if there is no public documentation about the protocol of the communication with it (whether it's over XPC or not). It will be almost impossible to do IPC with these processes.