./runner main does all the steps but fails with
[*] Sending SIGCONT to continue child
[*] Child exited with status 5
However, I am able to run the main program with a manual trick: after the program has been spawned in paused mode, keep runner paused (using a getc() after the posix_spawn), and do the following with lldb:
- attach to the target program (
main)
break set -n xpc_copy_entitlements_for_self, continue and hit the breakpoint
- get the address of my_xpc_copy_entitlements_for_self
re write $pc 0x100dce000 -- where the address is from step 2
- continue and detach