{"id":19311278,"url":"https://github.com/derekselander/dynadump","last_synced_at":"2025-04-13T05:13:33.207Z","repository":{"id":242006734,"uuid":"772265368","full_name":"DerekSelander/dynadump","owner":"DerekSelander","description":"A runtime ObjC class-dump","archived":false,"fork":false,"pushed_at":"2024-12-20T21:10:22.000Z","size":63,"stargazers_count":70,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T05:13:23.898Z","etag":null,"topics":[],"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":"2024-03-14T21:13:38.000Z","updated_at":"2025-02-24T21:30:52.000Z","dependencies_parsed_at":"2024-05-31T05:25:41.545Z","dependency_job_id":"9edb62a6-0e90-4c67-8f82-1c8ad4a23671","html_url":"https://github.com/DerekSelander/dynadump","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"04c76026c5a10df5c3abc297bc3fbf1e43b79927"},"previous_names":["derekselander/dynadump"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2Fdynadump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2Fdynadump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2Fdynadump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2Fdynadump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DerekSelander","download_url":"https://codeload.github.com/DerekSelander/dynadump/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665746,"owners_count":21142123,"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":[],"created_at":"2024-11-10T00:28:31.389Z","updated_at":"2025-04-13T05:13:33.178Z","avatar_url":"https://github.com/DerekSelander.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dynadump\n\nYet another Objective-C class-dump CLI tool\n\n## Why?\n\nFor fun. I got burnt out on the complexity of `dsdump` trying to grab all of Apple's dyld/objc4 opensource code and compiling it. This attempts to class-dump ObjC code via mostly public or unlikely to change private APIs\n\n## Features\n```\n  dynadump (built: May 30 2024, 00:59:46) - yet another class-dump done via dlopen \u0026 exception catching\n\n\tParameters:\n\tlist                list all the dylibs in the dyld shared cache (dsc)\n\tlist  $DYLIB        list all the objc classes in a dylib $DYLIB\n\tdump  $DYLIB        dump all the ObjC classes found in a dylib on disk\n\tdump  $DYLIB $CLASS dump a specific ObjC class found in dylib $DYLIB\n\tsig   $SIGSTR       prints the demangled objc signature\n\tsign  $DYLIB        attempts to sign a dylib in place\n\tlist  $DYLIB $CLASS Same cmd as above (convenience for listing then dumping)\n\n\tEnvironment Variables:\n\tNOCOLOR - Forces no color, color will be on by default unless piped\n\tCOLOR   - Forces color, regardless of stdout destination\n\tVERBOSE - Verbose output\n\tNOEXC   - Don't use an exception handler (on in x86_64)\n\tDEBUG   - Used internally to hunt down f ups\n```\n\n\nThe following example looks for any images in the dsc with `Shaz`, which can display a numerical number to print for `list`ing or `dump`ing. You can dump every ObjC class in the module or just a specific class. Use the **`VERBOSE`** flag to provide more detail, like load addresses or offsets.\n\u003cimg width=\"1402\" alt=\"screenshot\" src=\"https://github.com/DerekSelander/dynadump/assets/1037191/7d18a258-fb6f-4044-bc67-cafbad641d55\"\u003e\n\nIf the color hurts the eyes, a `NOCOLOR` environment variable can calm it down.\n\n\u003cimg width=\"1402\" alt=\"screenshot2\" src=\"https://github.com/DerekSelander/dynadump/assets/1037191/d58f2b51-b6a3-481f-8f44-575ccd36fae8\"\u003e\n\n\n### Neat/bad design choices\n\nSince this loads an image through `dlopen`, one has to be careful to prevent the image constructors from doing something bad, like crashing the program (I am looking at you, `/S*/L*/PrivateFrameworks/SpringBoard.framework`). To get around this, exception handlers are created on all callouts to load addresses. So when an image loads, an exception (a breakpoint) is hit and the exception handler steps over the code. This will prevent all constructors from executing for good or for bad. If you see something not working try using the **`NOEXC=1`** to prevent exception handlers from being setup\n\nThe other shitty consequence of this design is that `dlopen` really is limited to dylibs and not standalone executables. In addition, a platform could be for iOS while being opened for Mac Catalyst. To deal with this, after `dlopen` fails for the first time, `dynadump` will copy the image of interest and patch the needed commands needed to be able to `dlopen`. This gets more fun when dealing with things like `LC_RPATH`.\n\n## Caveats\n\nDue to the different platforms and the architectures that can be run, you will need to use `arch -arm64` or `arch -arm64e` depending on the desired images to inspect. Apple will use arm64e on their stuff, while 3rd party code will be in arm64 (at the time of writing). You also need to be aware of any images that are Mac Catalyst builds as they're viewed as a different platform and will import different libraries when loaded. As a result, there's a Xcode scheme to build a Catalyst versino of `dynadump`\n\n\nHere's an example of looking at `Amazon Prime` which appears to be ported from the iPad version.\n\n\u003cimg width=\"1562\" alt=\"Screenshot 2024-05-30 at 2 25 07 AM\" src=\"https://github.com/DerekSelander/dynadump/assets/1037191/410eba7a-e708-4e3f-a9c0-ab15bbe31675\"\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderekselander%2Fdynadump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderekselander%2Fdynadump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderekselander%2Fdynadump/lists"}