Using p0tools I am able to run a simple program compiled for iOS, with a manual trick[1] though, because the amfi part does not seem to work anymore.
I patched TinyInst to use posix_spawnattr_set_platform_np(..., PLATFORM_IOS, ...) and jackalope is able to spawn the program, and with the manual trick, everything runs[2]. However, tinyinst does not ever detect the target function to be called, and if the program exits it complains with WARNING: Target function not reached, retrying with a clean process.
My question is if there is a simple fix for continuing this experiment, or if the nature of TinyInst does not allow to fuzz iOS-on-Mac binaries.
Thank you in advance.
[1] Manual trick: after the target program has been spawned in paused mode, keep Jackalope paused (using a getc() after the posix_spawn), and do the following with lldb:
- attach to the target program
break set -n xpc_copy_entitlements_for_self, continue and hit the breakpoint
- get the address of my_xpc_copy_entitlements_for_self (from interpose.c of p0tools )
re write $pc 0x100dce000 -- where the address is from step 2
- continue and detach, tell Jackalope to continue
- last note: for doing step 4. the program must wait some seconds to give time to jacklope to attach before starting the target function
[2] ./fuzzer -t 1000 -in in -out out -delivery shmem -target_module testcrashme -instrument_module crashme2_ios.dylib -target_method __Z4fuzzPc -nargs 1 -iterations 10000 -persist -loop -cmp_coverage -- ./testcrashme -m @@
Using p0tools I am able to run a simple program compiled for iOS, with a manual trick[1] though, because the amfi part does not seem to work anymore.
I patched TinyInst to use
posix_spawnattr_set_platform_np(..., PLATFORM_IOS, ...)and jackalope is able to spawn the program, and with the manual trick, everything runs[2]. However, tinyinst does not ever detect the target function to be called, and if the program exits it complains withWARNING: Target function not reached, retrying with a clean process.My question is if there is a simple fix for continuing this experiment, or if the nature of TinyInst does not allow to fuzz iOS-on-Mac binaries.
Thank you in advance.
[1] Manual trick: after the target program has been spawned in paused mode, keep Jackalope paused (using a getc() after the posix_spawn), and do the following with lldb:
break set -n xpc_copy_entitlements_for_self, continue and hit the breakpointre write $pc 0x100dce000-- where the address is from step 2[2]
./fuzzer -t 1000 -in in -out out -delivery shmem -target_module testcrashme -instrument_module crashme2_ios.dylib -target_method __Z4fuzzPc -nargs 1 -iterations 10000 -persist -loop -cmp_coverage -- ./testcrashme -m @@