zoukankan      html  css  js  c++  java
  • class-dump 使用

    转:class-dump 使用

    class-dump 官网地址:这里

    我这里下载的是 class-dump-3.5.dmg 版本的。双击.dmg 文件,将  拉倒 /usr / local / bin 目录下[用open /usr 命令打开用户文件夹],这样就可以在终端使用 class-dump 命令了。

    这里我演示dump系统自带的计算器,导出它的头文件。

    命令如下:

    class-dump -H /Applications/Calculator.app -o /Users/Rio/Desktop/calculate heads

    解释:

    /Applications/Calculator.app 是计算器app的路径

    /Users/Rio/Desktop/calculate heads 是存放dump出来头文件的文件夹路径

    -H表示导出头文件

    -o表示导出头文件的保存目录参数

    1. class-dump 3.5 (64 bit)  
    2. Usage: class-dump [options] <mach-o-file>  
    3.   
    4.   where options are:  
    5.         -a             show instance variable offsets  
    6.         -A             show implementation addresses  
    7.         --arch <arch>  choose a specific architecture from a universal binary (ppc, ppc64, i386, x86_64)  
    8.         -C <regex>     only display classes matching regular expression  
    9.         -f <str>       find string in method name  
    10.         -H             generate header files in current directory, or directory specified with -o  
    11.         -I             sort classes, categories, and protocols by inheritance (overrides -s)  
    12.         -o <dir>       output directory used for -H  
    13.         -r             recursively expand frameworks and fixed VM shared libraries  
    14.         -s             sort classes and categories by name  
    15.         -S             sort methods by name  
    16.         -t             suppress header in output, for testing  
    17.         --list-arches  list the arches in the file, then exit  
    18.         --sdk-ios      specify iOS SDK version (will look in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS<version>.sdk  
    19.         --sdk-mac      specify Mac OS X version (will look in /Developer/SDKs/MacOSX<version>.sdk  
    20.         --sdk-root     specify the full SDK root path (or use --sdk-ios/--sdk-mac for a shortcut)  


    运行命令,可以看到已经dump出头文件了,如下所示:

       class-dump 虽然非常有用,但有时我们会发现 class-dump 执行失败,无法得到我们想要的 .h 文件,或者 .h 文件的内容是加密的密文。出现这种现象的原因是:class-dump 额作用对象必须是未经加密的可执行文件,而从 App Store 下载的 App 都是经过签名加密的,可执行文件被加上了一层“壳”。可以使用 AppCrackr 来自动砸壳。[注:还有一个更简单的办法就是通过越狱渠道下载应用,这些ipa都是无壳的,可以直接dump]

    #dump出的.h文件中的属性和方法和实际的排序是相反的。

  • 相关阅读:
    JAVA中线程同步的方法(4种)汇总
    java
    指定的元素已经是另一个元素的逻辑子元素。请先将其断开连接。(解决问题总结)
    无法将类型为“System.Windows.Controls.SelectedItemCollection”的对象强制转换为类型“System.Collections.Generic.IList`1
    foreach---集合已修改;可能无法执行枚举操作。
    WPF_View中控件使用单例ViewModel
    判断s2是否能够被通过s1做循环移位(rotate)得到的字符串是否包含
    多列转1列 SqlServer 实现oracle10g的 wmsys.wm_concat()--for xml path('')
    异步对象(XMLHttpRequest)的帮助脚本
    在vs2010使用EF出现CS0012: 类型“System.Data.Objects.DataClasses.EntityObject”在未被引用的程序集中定义
  • 原文地址:https://www.cnblogs.com/ygm900/p/4555398.html
Copyright © 2011-2022 走看看