当你说你做了递归时otool -L
,你是什么意思?完成这项工作需要很多共享库,例如:
otool -L /bin/bash
/bin/bash:
/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
然后你必须otool -L
在那些(然后otool -L
在那些)上运行:
otool -L /usr/lib/libSystem.B.dylib
/usr/lib/libSystem.B.dylib:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/usr/lib/system/libcache.dylib (compatibility version 1.0.0, current version 62.0.0)
/usr/lib/system/libcommonCrypto.dylib (compatibility version 1.0.0, current version 60049.0.0)
/usr/lib/system/libcompiler_rt.dylib (compatibility version 1.0.0, current version 35.0.0)
/usr/lib/system/libcopyfile.dylib (compatibility version 1.0.0, current version 103.0.0)
/usr/lib/system/libcorecrypto.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/system/libdispatch.dylib (compatibility version 1.0.0, current version 339.1.9)
/usr/lib/system/libdyld.dylib (compatibility version 1.0.0, current version 239.3.0)
/usr/lib/system/libkeymgr.dylib (compatibility version 1.0.0, current version 28.0.0)
/usr/lib/system/liblaunch.dylib (compatibility version 1.0.0, current version 842.1.4)
/usr/lib/system/libmacho.dylib (compatibility version 1.0.0, current version 845.0.0)
/usr/lib/system/libquarantine.dylib (compatibility version 1.0.0, current version 71.0.0)
/usr/lib/system/libremovefile.dylib (compatibility version 1.0.0, current version 33.0.0)
/usr/lib/system/libsystem_asl.dylib (compatibility version 1.0.0, current version 217.1.4)
/usr/lib/system/libsystem_blocks.dylib (compatibility version 1.0.0, current version 63.0.0)
/usr/lib/system/libsystem_c.dylib (compatibility version 1.0.0, current version 997.1.1)
/usr/lib/system/libsystem_configuration.dylib (compatibility version 1.0.0, current version 596.12.0)
/usr/lib/system/libsystem_dnssd.dylib (compatibility version 1.0.0, current version 522.1.11)
/usr/lib/system/libsystem_info.dylib (compatibility version 1.0.0, current version 449.1.3)
/usr/lib/system/libsystem_kernel.dylib (compatibility version 1.0.0, current version 2422.1.72)
/usr/lib/system/libsystem_m.dylib (compatibility version 1.0.0, current version 3047.16.0)
/usr/lib/system/libsystem_malloc.dylib (compatibility version 1.0.0, current version 23.1.10)
/usr/lib/system/libsystem_network.dylib (compatibility version 1.0.0, current version 241.3.0)
/usr/lib/system/libsystem_notify.dylib (compatibility version 1.0.0, current version 121.0.0)
/usr/lib/system/libsystem_platform.dylib (compatibility version 1.0.0, current version 24.1.4)
/usr/lib/system/libsystem_pthread.dylib (compatibility version 1.0.0, current version 53.1.4)
/usr/lib/system/libsystem_sandbox.dylib (compatibility version 1.0.0, current version 278.10.0)
/usr/lib/system/libsystem_stats.dylib (compatibility version 1.0.0, current version 93.1.26)
/usr/lib/system/libunc.dylib (compatibility version 1.0.0, current version 28.0.0)
/usr/lib/system/libunwind.dylib (compatibility version 1.0.0, current version 35.3.0)
/usr/lib/system/libxpc.dylib (compatibility version 1.0.0, current version 300.1.17)
我做了一个快速测试:
mkdir -p /Users/chroot/bin /Users/chroot/usr/lib/system
cp /bin/bash /Users/chroot/bin
cp /usr/lib/* /Users/chroot/usr/lib
cp /usr/lib/system/* /Users/chroot/usr/lib/system
chroot /Users/chroot /bin/bash
这行得通,所以我假设您缺少所需的共享库。您可能可以编写一个脚本来完全执行递归otool -L
并获得您需要的确切共享库,但是进行批量复制可能更容易。