我正在尝试修补OS中Dock的外观。
我有来自Dock的Mach-O可执行文件的原始数据,但我对它们知之甚少。我正在试图弄清楚我可能会在哪里找到Dock实际绘制的分段/部分。例如,我看到各种各样的节,比如__DATA,__mod_init_func和__DATA,__cfstring,我只是想知道是否有一种简单的方法来区分这些节(甚至特定的段)中包含我正在寻找的数据,或者有一种方法将数据反编译成更具可读性的格式。
发布于 2017-05-21 09:09:25
除非您了解mach-o文件的所有内容,否则您无法真正“反编译”该文件。你可以从原始数据中获得一些“人类可读”的内容,比如它的方法和实例。
-[AClass anInstance:] 应该是这样的:
-(id)anInstance:(id)arg1;我会推荐一些其他的工具来理解这一点。有几个命令行可以使用:
nm /path/to/mach-o // Prints all the strings of a Mach-O Executable
hexdump -C /path/to/mach-o // Shows the Hexadecimal Code of a Mach-O Executable
otool -t /path/to/mach-o // Outputs the raw (Hexadecimal) "_TEXT,__text" section of a Mach-O Executable (Compare this with the hexdump -C command)
otool -tV /path/to/mach-o // Outputs the converted (Human Readable-ish) "__TEXT,__text" section of a Mach-O Executable但如果你真的想了解关于马赫-O的一切
我建议从https://www.hopperapp.com下载Hopper,它可以很好地显示mach-o二进制文件的字节数和它们的用途。然后您可以查看这里:https://www3.nd.edu/~dthain/courses/cse40243/fall2015/intel-intro.html,它将教您如何理解mach-o是如何编译的,以及如何读取执行方法。
例如:
1. Open Hopper and drag and drop in the Mach-O executable then wait for it to load.
2. Execute "otool -tV /path/to/mach-o" in Terminal.app您可以注意到料斗和终端的输出之间的差异,并开始将这些差异拼凑在一起。然后,您可以打开我提供的website,了解所有输出函数的用途。
我希望这对你有一点帮助,让你开始寻找知识。
欢迎光临。
https://stackoverflow.com/questions/38562568
复制相似问题