{"id":13721610,"url":"https://github.com/DerekSelander/dsdump","last_synced_at":"2025-05-07T14:30:39.365Z","repository":{"id":42424627,"uuid":"174772034","full_name":"DerekSelander/dsdump","owner":"DerekSelander","description":"An improved nm + Objective-C \u0026 Swift class-dump","archived":false,"fork":false,"pushed_at":"2024-02-05T18:03:39.000Z","size":29279,"stargazers_count":1151,"open_issues_count":20,"forks_count":113,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-08T15:06:28.863Z","etag":null,"topics":["class-dump","nlist","nlists","objc","objective-c","swift","symbols"],"latest_commit_sha":null,"homepage":"","language":"Objective-C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DerekSelander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-10T03:10:41.000Z","updated_at":"2025-04-06T07:38:45.000Z","dependencies_parsed_at":"2022-08-27T08:52:40.707Z","dependency_job_id":"9515be0b-1663-4a84-b9ee-4e5fcb3de8c7","html_url":"https://github.com/DerekSelander/dsdump","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2Fdsdump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2Fdsdump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2Fdsdump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2Fdsdump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DerekSelander","download_url":"https://codeload.github.com/DerekSelander/dsdump/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252895472,"owners_count":21821167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["class-dump","nlist","nlists","objc","objective-c","swift","symbols"],"created_at":"2024-08-03T01:01:19.251Z","updated_at":"2025-05-07T14:30:36.186Z","avatar_url":"https://github.com/DerekSelander.png","language":"Objective-C++","readme":"NOTE: around ~2021 Apple introduced new binding opcodes which I haven't gotten around to updating yet for dsdump. This results in bad output for objc class dumps.\nI recommend you check out [@blacktop](https://twitter.com/blacktop__)'s [ipsw](https://github.com/blacktop/ipsw) instead \n\n\n## dsdump \nAn improved nm + objc/swift class-dump ([writeup](https://derekselander.github.io/dsdump/))\n\nWorks great on Objective-C classes\n[![img](media/vmmap.png)](https://store.raywenderlich.com/products/advanced-apple-debugging-and-reverse-engineering)\n\n... and Swift types\n[![img](media/swift.png)](https://store.raywenderlich.com/products/advanced-apple-debugging-and-reverse-engineering)\n\n### man\n\n\u003c!--man_start---\u003e\n```\ndsdump(1)                 BSD General Commands Manual                dsdump(1)\n\nNAME\n     dsdump -- An improved nm + objc/swift class-dump\n\nSYNOPSIS\n     dsdump [option...] \u003cmach-o-file\u003e\n\nDESCRIPTION\n     Provides an \"nm-improved\" experience when working with Mach-O executa-\n     bles. dsdump has 3 \"primary\" modes: Symbol table (--sym), Objective-C\n     (--objc), and Swift (--swift, -s). Omitting all of these options will\n     default to the Swift mode.\n\nOPTIONS\n     -c, --color\n             Adds color to output\n    \n     -d, --demangle\n             Demangle Swift and C++ symbols in print symbol mode\n\n     -l, --library\n             Instead of dumping symbols, search all procs for library\n\n     -O, --opcs\n             Dump the DYLD opcodes used to bind external symbols at load time\n\n     -f, --filter FilterWord\n             Specify classes to filter by (case insensitive, can be used mul-\n             tiple times)\n\n     -a, --arch architecture\n             Specify the arichtecture if file is FAT. Understands x86_64h,\n             x86_64, arm64, arm64e\n\n     -u, --undefined\n             Only display undefined (externally referenced) symbols or classes\n\n     -U, --defined\n             Only display defined (internally implemented) symbols or classes\n\n     -v, --verbose\n             Specifies the verbosity level. The -v option can be used multiple\n             times, while the long argument sets the exact level 0-5. Kind of\n             like codesign(1)'s verbosity that everyone complains about...\n\n     --objc  Dump the Objective-C classes\n     \n     -o      Sets mode to Objective-C mode and verbosity to level 4\n\n     --swift\n             Dump the Swift type descriptors (classes, structs, enums)\n\n     -s      Sets mode to Swift mode and verbosity to level 4\n\n     -h, --help\n             Print out this beautiful, helpful document\n\nEXAMPLES\n     List ObjC internal/external classes referenced/implemented by vmmap:\n           dsdump --objc $(which vmmap)\n\n     List all alive processes that have the MobileDevice loaded\n           sudo dsdump -l /S*/L*/P*/MobileDevice.framework/MobileDevice\n\n     List the Objective-C external classes called by vmmap:\n           dsdump --objc $(which vmmap) -u\n\n     List the Objective-C internal classes implemented by vmmap:\n           dsdump --objc $(which vmmap) -U\n\n     Perform an Objective-C \"class-dump\" in color of vmmap\n           dsdump --objc $(which vmmap) -U -vvvc\n\n     Thoroughly dump the Swift content in color in the Console app\n           dsdump --swift\n           /Applications/Utilities/Console.app/Contents/MacOS/Console -cvvvv\n\nVERBOSITY\n     dsdump can output a range of verbosity between the 3 different modes\n     (--sym, --swift, --objc). The verbosity level can be set by the long form\n     (--verbose=3) or by specifying a count via short form (-vvv). The break-\n     down of these levels are shown below:\n\n     --sym:\n           0. Print symbol\n           1. 0 + library path or Mach-O section\n           2. 1 + fullpath to library\n           3. 2 + nlist struct output\n           4. Same as 3... for now\n           5. Same as 3... for now\n\n     --swift:\n           0. List swift types\n           1. 0 + Parent classes\n           2. 1 + Protocols\n           3. 2 + Swift type dump\n           4. 3 + Extended type dump, ObjC bridge methods\n           5. 4 + Commenting in methods\n\n     --objc:\n           0. List Objective-C classes\n           1. 0 + Parent classes \u0026 library basename for external\n           2. 1 + Fullpath to libraries for external + protocols\n           3. 2 + Objective-C class dump\n           4. 3 + Print properties\n           5. 4 + Print ivars \u0026 offsets\n\nENVIRONMENT\n     DSCOLOR Enables color. Alternatively, use -c\n\n     ARCH \u003carch\u003e Specify the architecture if inspecting a FAT executable,\n     Alternatively use --arch\n\nSEE ALSO\n     nm(1), objdump(1), vmmap(1)\n\nBUGS\n     There's a situation where occassionally dsdump will think the parent\n     class is a RO_ROOT where it will in fact won't be. I'll print this out\n     for now so I can hunt it down\n\n     ARM64e still needs some luv, especially on the Swift side, especially\n     with Protocols... and not crashing\n\nAUTHORS\n     Derek Selander @LOLgrep\n\nDarwin                          March 26, 2020                          Darwin\n```\n\u003c!--man_stop---\u003e\n\n## Compiling\n\nCompiling this will be a bit of a pain in the butt on your end. You'll need to clone the Swift language in the same directory. Swift can't be a submodule to this repo since some of their git cloning scripts won't work :| \n\n```bash\n# cd into the dsdump repo\ncd dsdump/\n\n# make a directory called swift-source, yes, name it exactly that\nmkdir swift-source\n\ncd swift-source/\n\n# clone the Swift repository into swift-source\ngit clone https://github.com/apple/swift.git\n\n# checkout \ncd swift\ngit checkout 75670c17272a993ed798cee7e31c20590e94118b\n\n# Use the Swift update helper script to grab everything else \n ./swift/utils/update-checkout --clone-with-ssh   --tag swift-5.1.4-RELEASE\n```\nComment out any remaining problematic code after a build, remove methods in `Metadata.h` as needed (i.e. problematic ARC bridging code on line 700)\n\nI've included the `libSwiftDemangling.a` static lib that I built into `dsdump/dsdump`.  If you want to build entirely from Swift source, you'll need to build this yourself. Otherwise you should be good to go to build `dsdump` via Xcode.\n\nAlternatively, you can skip all of this by simply grabbing the compiled `dsdump` version in the **compiled** directory [found here](https://github.com/DerekSelander/dsdump/tree/master/compiled). Make sure the SHA256 matches below if you're paranoid. \n\nCompiled SHA256\n```\nSHA256: 83eebd025b43b58a486235e1bec70a3239995be409605e3ff19bdae07adff917\n```\n\n### Credits\n\n* [https://opensource.apple.com/source/dyld/dyld-635.2/src/dyldInitialization.cpp.auto.html](https://opensource.apple.com/source/dyld/dyld-635.2/src/dyldInitialization.cpp.auto.html) Specifically the THREADED code for ARM64e\n* [https://opensource.apple.com/source/objc4/](https://opensource.apple.com/source/objc4/) Specifically, the objc_class swift_class structs (and all the property, protocol, method, ivar, etc structs)\n* [https://github.com/apple/swift](https://github.com/apple/swift) \n\n### TODO list for v1\n\n* Full ARM64e support\n* M1 support \n* Crashes\n* iOS 15/Monterey support\n* In process support (TODO TODO guess that means a libdsdump.a)\n  * Basic dsc listing with options to `dlopen` from cmdline\n* header files\n","funding_links":[],"categories":["Tools","Objective-C++","Awesome Mobile Application Penetration Testing  ![awesome](https://awesome.re/badge.svg)"],"sub_categories":["Reverse Engineering Tools","iOS Application Penetration Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDerekSelander%2Fdsdump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDerekSelander%2Fdsdump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDerekSelander%2Fdsdump/lists"}