Open MCApollo opened 2 years ago
Here's some bash code to download swift if someone wants to play with this. The swift/utils/
pull script is messed up since the master
to main
changes.
#!/usr/bin/env bash
# https://src.fedoraproject.org/rpms/swift-lang/blob/80c3f9215c329712f744aa4ff49382637784c0c9/f/swift-lang.spec
export TAG="swift-5.1.4-RELEASE";
export FILES=(
"https://github.com/apple/swift/archive/${TAG}.tar.gz#/swift.tar.gz"
"https://github.com/apple/swift-corelibs-libdispatch/archive/${TAG}.tar.gz#/corelibs-libdispatch.tar.gz"
"https://github.com/apple/swift-corelibs-foundation/archive/${TAG}.tar.gz#/corelibs-foundation.tar.gz"
"https://github.com/apple/swift-integration-tests/archive/${TAG}.tar.gz#/swift-integration-tests.tar.gz"
"https://github.com/apple/swift-corelibs-xctest/archive/${TAG}.tar.gz#/corelibs-xctest.tar.gz"
"https://github.com/apple/swift-package-manager/archive/${TAG}.tar.gz#/package-manager.tar.gz"
"https://github.com/apple/swift-llbuild/archive/${TAG}.tar.gz#/llbuild.tar.gz"
"https://github.com/apple/swift-cmark/archive/${TAG}.tar.gz#/cmark.tar.gz"
"https://github.com/apple/swift-xcode-playground-support/archive/${TAG}.tar.gz#/swift-xcode-playground-support.tar.gz"
"https://github.com/apple/sourcekit-lsp/archive/${TAG}.tar.gz#/sourcekit-lsp.tar.gz"
"https://github.com/apple/indexstore-db/archive/${TAG}.tar.gz#/indexstore-db.tar.gz"
"https://github.com/apple/llvm-project/archive/${TAG}.tar.gz#/llvm-project.tar.gz"
"https://github.com/apple/swift-syntax/archive/${TAG}.zip#/swift-syntax.zip"
);
for url in ${FILES[@]}; do
file="$(basename "${url}")";
base="${file%%.*}";
wget "${url}" -O "${file}";
if [[ "${file}" == *".tar"* ]]; then
tar xf "${file}";
elif [[ "${file}" == *".zip"* ]]; then
unzip "${file}";
else
echo "No prog to extract ${file}";
fi
mv "${base}-${TAG}" "${file}";
done
exit 0;
Hey :wave:,
./dsdump -vvvvv --swift <app>
segfaults, this- in my case- comes from not checking ifself->dyldInfo
exists.Adding a quick check, I'm able to get some borked output but dsdump will crash eventually.
Here's some documentation and line where dyldInfo is set;
LC_DYLD_INFO{,_ONLY}
is missing & replaced on newer binaries that target 15 for "load-time improvements".Thanks
https://github.com/qyang-nj/llios/blob/main/exported_symbol/README.md https://github.com/qyang-nj/llios/blob/main/dynamic_linking/chained_fixups.md https://medium.com/geekculture/how-ios-15-makes-your-app-launch-faster-51cf0aa6c520
TLDR:
"If the binary is targeted at iOS 14+ or is linked with -fixup_chains linker flag, the same information is stored in LC_DYLD_EXPORTS_TRIE load command instead."