├── .gitignore ├── LICENSE ├── README.md └── extract.sh /.gitignore: -------------------------------------------------------------------------------- 1 | /.extract.sh.swp 2 | /.DS_Store 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Derek 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dsc_symbols 2 | symbol dumps of iOS shared caches 3 | 4 | 5 | This script will extract the shared cache and make a file tree that matches the images in the dsc. 6 | * Symbols that begin with `||` mean they are defined (implemented in that module) 7 | * Symbols that begin with `__` mean they are undefined and referenced in a different module 8 | * Undefined symbols will include the module its referenced in, defined symbols will include the Mach-o segment/section it's included in 9 | 10 | ## Howto 11 | 12 | git clone, then... 13 | 14 | List currently available iOS versions to compare 15 | ``` 16 | git branch -r 17 | ``` 18 | 19 | Compare all the new shit in `libsystem_c.dylib` from iOS 14.0.0 -> 15.7.0 20 | 21 | ``` 22 | git diff 14.0.0:usr/lib/system/libsystem_c.dylib 15.7.0:usr/lib/system/libsystem_c.dylib 23 | ``` 24 | 25 | List all modules that were removed between iOS 14.0.0 and iOS 15.7.0 26 | ``` 27 | git diff 14.0.0 15.7.0 --diff-filter=D --name-status 28 | ``` 29 | 30 | List all modules that were created between iOS 14.0.0 and iOS 15.7.0 31 | ``` 32 | git diff 14.0.0 15.7.0 --diff-filter=A --name-status 33 | ``` 34 | 35 | Tip: Get on a branch of interest and use your shell's autocomplete with an existing file in the directory. That way you don't have to type out the fullpath 36 | ``` 37 | git switch 14.0.0 38 | git diff 14.0.0 15.7.0 **/libsystem_c.dylib 39 | ``` 40 | 41 | List all new symbols between iOS 14.0.0 to iOS 15.7.0 in UIKitCore 42 | ``` 43 | git diff 14.0.0 15.7.0 **/UIKitCore | grep -E "^\+\|\|" 44 | ``` 45 | 46 | List all new external references that have been referenced by UIKitCore between iOS 14.0.0 to iOS 15.7.0 47 | ``` 48 | git diff 14.0.0 15.7.0 **/UIKitCore | grep -E "^\+__" 49 | ``` 50 | 51 | List all external references that have been removed UIKitCore between iOS 14.0.0 to iOS 15.7.0 52 | ``` 53 | git diff 14.0.0 15.7.0 **/UIKitCore | grep -E "^\+__" 54 | ``` 55 | 56 | List all new Objective-C classes in UIKitCore between iOS 14.0.0 to iOS 15.7.0 57 | ``` 58 | git diff 14.0.0 15.7.0 **/UIKitCore | grep -E "^\+\|\|" | grep OBJC_CLASS_ 59 | ``` 60 | -------------------------------------------------------------------------------- /extract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -x 3 | 4 | ssh -n root@$1 'OUT_BASE="/tmp/dsc_symbols"; rm -rf $OUT_BASE; mkdir -p "$OUT_BASE"; /usr/local/bin/dsdump -l | grep -v \* | awk '"'"'{print $2}'"'"' | while read line; do echo "processing \"$line\""; mkdir -p "$OUT_BASE/$(dirname $line)"; /usr/local/bin/dsdump "$line" -vUp | awk '"'"'{print "|| " $2 " " $3}'"'"' | sort > "$OUT_BASE/$line"; /usr/local/bin/dsdump "$line" -vu | awk '"'"'{print "__ " $2 " " $3}'"'"' | sort >> "$OUT_BASE/$line"; if /usr/local/bin/dsdump "$line" -vU | grep -q OBJC_CLASS_; then /usr/local/bin/dsdump -o "$line" | sed -E '"'"'s/0x............//g'"'"' >> "$OUT_BASE/$line"; fi ; done' 5 | 6 | 7 | echo "extracted some shit" 8 | ssh root@$1 "tar -zcf /tmp/dsc_symbols.zip /tmp/dsc_symbols" 9 | scp "root@$1:/tmp/dsc_symbols.zip" "/tmp/dsc_symbols.zip" 10 | 11 | open -R "/tmp/dsc_symbols.zip" 12 | --------------------------------------------------------------------------------