tyilo/insert_dylib

Doesn't work on iOS 11.3.1 ?

ChrisYang2009 opened this issue · 1 comments

iPhone:~ root# /usr/bin/hellotest
Hello, World!
iPhone:~ root# cp /usr/bin/hellotest ./
iPhone:~ root# ldid -e hellotest > hello.xml
iPhone:~ root# 
iPhone:~ root# insert_dylib /usr/lib/hellodylib.dylib hellotest --inplace
LC_CODE_SIGNATURE load command found. Remove it? [y/n] y
Added LC_LOAD_DYLIB to hellotest
iPhone:~ root# 
iPhone:~ root# ldid -Shello.xml hellotest 
iPhone:~ root# ./hellotest          
-sh: ./hellotest: cannot execute binary file: Operation not permitted
iPhone:~ root# cp hellotest /usr/bin/hellotest2
iPhone:~ root# /usr/bin/hellotest2
dyld: Library not loaded: /usr/lib/hellodylib.dylib
  Referenced from: /usr/bin/hellotest2
  Reason: no suitable image found.  Did find:
	/usr/lib/hellodylib.dylib: code signing blocked mmap() of '/usr/lib/hellodylib.dylib'
	/usr/lib/hellodylib.dylib: code signing blocked mmap() of '/usr/lib/hellodylib.dylib'
Abort trap: 6

The exact same steps work great on iOS 10, but failed on iOS 11.3.1 with error code signing blocked mmap().
I also tried ldid -S /usr/lib/hellodylib.dylib but still the same error.

Does that mean insert_dylib will never work os iOS 11+ due to codesigning issue ?

adding com.apple.private.skip-library-validation entitlement fixes this issue.