DerekSelander / dsdump

An improved nm + Objective-C & Swift class-dump
1.12k stars 111 forks source link

Dumping classes to files? #20

Closed joshuaseltzer closed 3 years ago

joshuaseltzer commented 4 years ago

I was wondering if using this tool there's the ability to dump separate classes/protocols as separate files on disk. Basically, I'm looking for a similar feature to using "-H -o " with the class-dump tool (https://github.com/nygard/class-dump).

If this isn't possible natively with the tool, I'm sure I could do some text manipulation by just outputting the entire output to a file...

DerekSelander commented 4 years ago

This doesn’t have the functionality at the moment, but it could definitely get there. The additional gotcha is that this aims to also be swift compatible so there needs to be a .h for ObjC and a Swift module for anything Swift. PRs are welcome if you decide to go down that rabbit hole.

joshuaseltzer commented 4 years ago

Thanks for the response. Unfortunately, I have very little Swift knowledge, so I might not be able to do a nice, clean PR to add this support, but I might look into at least creating a version that can do this in the objc mode.

Worst case scenario, I'm sure I can write some bash scripts that parses the output from your tool into separate files.

yur1xpp commented 3 years ago

@joshuaseltzer I'm very interested in the script, if you did wrote it. Do you mind sharing it here?

joshuaseltzer commented 3 years ago

@joshuaseltzer I'm very interested in the script, if you did wrote it. Do you mind sharing it here?

Unfortunately no, I did not have time unfortunately. I did find a tool that did what I needed though: classdumpios.

paradiseduo commented 3 years ago

@joshuaseltzer I'm very interested in the script, if you did wrote it. Do you mind sharing it here?

I implemented this function with Python3 & dsdump

joshuaseltzer commented 3 years ago

@joshuaseltzer I'm very interested in the script, if you did wrote it. Do you mind sharing it here?

I implemented this function with Python3 & dsdump

Nice! I’ll be sure to check this out. Will close this ticket then.

yur1xpp commented 3 years ago

@joshuaseltzer I'm very interested in the script, if you did wrote it. Do you mind sharing it here?

I implemented this function with Python3 & dsdump

Love it, thanks @paradiseduo