获取系统私有API,网上有很多资料总结了一下就三种方式:

  • 使用class-dump可以提取系统私有API列表
  • 使用class-dump+DumpFrameworks.pl,这个可以一次性提取所有系统Framework与PrivateFrameworks的API列表
  • 直接使用已经提取好的API列表github地址

DumpFrameworks.pl代码如下:

#!/usr/bin/perl
#
# 24 November 2008
# Framework Dumping utility; requires class-dump
# use strict; use Cwd;
use File::Path; my $HOME = (getpwuid($<))[7] || $ENV{'HOME'}
or die "Could not find your home directory!"; # This command must be in your path.
# http://www.codethecode.com/projects/class-dump/
my $CLASS_DUMP = 'class-dump'; # Public Frameworks /xcode4/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk////Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library
# /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks /xcode4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library
dump_frameworks('/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks',
'Frameworks'); # Private Frameworks
dump_frameworks('/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/PrivateFrameworks',
'PrivateFrameworks'); sub dump_frameworks
{
my($dir, $subdir) = @_; opendir(my $dirh, $dir) or die "Could not opendir($dir) - $!"; # Iterate through each framework found in the directory
foreach my $file (grep { /\.framework$/ } readdir($dirh))
{
# Extract the framework name
(my $fname = $file) =~ s/\.framework$//;
print "Framework: $fname\n"; my $headers_dir = "$HOME/Headers/$subdir/$fname"; # Create the folder to store the headers
mkpath($headers_dir); # Perform the class-dump
my $cwd = cwd();
chdir($headers_dir) or die "Could not chdir($headers_dir) - $!"; system($CLASS_DUMP, '-H', "$dir/$file"); if($? == -1)
{
die "Could not execute $CLASS_DUMP - $!\n";
}
#
# elsif($? & 127)
# {
# printf("$CLASS_DUMP died with signal %d, %s coredump\n",
# ($? & 127), ($? & 128) ? 'with' : 'without');
# exit;
# }
#
# elsif(my $ret = $? >> 8)
# {
# die "The command '$CLASS_DUMP -H $dir/$file' failed, returning $ret\n";
# }
#*/
chdir($cwd) or die "Could not chdir($cwd) - $!";
}
}

注意使用DumpFrameworks.pl时要更改系统库的路径为你自己的路径。


但是从class-dump官网下载的最新版本class-dump-3.5.dmg却不能获取iOS9以后版本的API列表。报错信息:

Warning: This file does not contain any Objective-C runtime information.

具体原因Google了一下:

class-dump依赖于__DATA段下的几个sect里的数据。

iOS9 dyld解包的生成macho不在标准__DATA段,导致某些classdump无法识别

原答案地址

然后我从github上获取class-dump开源代码重新编译class-dump的可执行文件,并把这个可执行文件导出重新dump成功获取iOS9以后的系统私有API。具体方法如下:

1.打开class-dump并在TARGETS选中class-dump可执行文件

2.Xcode->Perferences->Locations

3.Advanced->Custom

不要更改任何路径选择后编译该项目。

编译成功后在~Library/Developer/Xcode/DerivedData/Build/Products可以找到这个可执行文件然后用这文件获取系统私有API。

iOS9 class dump header的更多相关文章

  1. 数据备份--dump(此作者有许多有用的博客文章)

    数据中 心操作大量的数据.当遭到破坏时,这就是一场灾难.这时候需要备份来恢复,及时你又大量的备份数据都没用,备份也肯定不是在浪费时间.你也许很幸运从 来没有经历过数据丢失.但是, 由于这种事情极少发生 ...

  2. Linux完整备份工具 - dump, restore(现在基本不用这两个)

    dump 其实 dump 的功能颇强,他除了可以备份整个文件系统之外,还可以制定等级喔!什么意思啊! 假设你的 /home 是独立的一个文件系统,那你第一次进行过 dump 后,再进行第二次 dump ...

  3. undo损坏故障恢复(二)ORA-01092,ORA-00604,ORA-01110

    undo 故障诊断与恢复(二) 今天是2013-09-01,目前困扰我将近一周的问题,终于解决了,我非常感谢帮助我的朋友,也非常感谢管我要钱然后替我解决问题的朋友(我没采用).这更激发了我一定要解决这 ...

  4. 理解 B*tree index内部结构

    转载请注明出处:http://write.blog.csdn.net/postedit/40589651 Oracle数据库里的B树索引就好象一棵倒长的树.它包括两种类型的数据块:一种是索引分支块,还 ...

  5. Oracle 如何提交手册Cluster Table事务

    环境遇到ora-00600 4000错误,该目的是参与cluster table,什么我这里有以下简单的模拟.以供参考! ++++创建一个测试表 ? 1 2 3 4 5 6 7 8 9 10 11 1 ...

  6. 【BBED】BBED模拟并修复ORA-08102错误

    [BBED]BBED模拟并修复ORA-08102错误 1.1  BLOG文档结构图 1.2  前言部分 1.2.1  导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其 ...

  7. pt-show-grants

    用法: pt-show-grants [OPTION ... ] [DSN]   例子: pt-show-grants pt-show-grants --separate --revoke | dif ...

  8. pt-show-grants的用法

    pt-show-grants的用法 1.先查找所有用户和Host 2.然后逐个执行show grants pt-show-grants的功能是格式化打印输出MySQL上的赋权,以便你可以有效地复制.比 ...

  9. Oracle降低高水位先(转载)

    Oracle  降低高水位线的方法 高水位(HIGH WARTER MARK,HWM)好比水库中储水的水位,用于描述数据库中段的扩展方式.高水位对全表扫描方式有着至关重要的影响.当使用DELETE删除 ...

随机推荐

  1. Visual Event插件----查看html元素绑定的事件与方法的利器

    WEB标准提倡结构.表现和行为相 分离,现在越来越多采用这种表现和行为的方式,但它也为我们开发调试带来一些问题,网页载入一堆JavaScript,,我们很难搞清楚最后在哪些元素的哪个动作绑定了事件,尤 ...

  2. Fbric、Ansible、Docker、Chaos Monkey:DevOps工具的年中回顾

    Fbric.Ansible.Docker.Chaos Monkey:DevOps工具的年中回顾 [编者按]近日,Cyber Engineering Solutions Group 技术经理 Hasan ...

  3. MySQL 百万级分页优化

    MySQL 百万级分页优化 http://www.jb51.net/article/31868.htm 一般刚开始学SQL的时候,会这样写 : , ; 但在数据达到百万级的时候,这样写会慢死 : , ...

  4. [STL]heap和priority_queue

    一.heap 在STL中,priority_queue(优先权队列)的底层机制是最大堆,因此有必要先来了解一下heap.heap采用完全二叉树的结构,当然不是真正的binary tree,因为对于完全 ...

  5. java 如何从配置文件(.properties)中读取内容

    1.如何创建.properties文件 很简单,建立一个txt文件,并把后缀改成.properties即可 2.将.properties文件拷入src的根目录下 3..properties文件内容格式 ...

  6. (转)【移动开发】Android中三种超实用的滑屏方式汇总(ViewPager、ViewFlipper、ViewFlow)

    转自: http://smallwoniu.blog.51cto.com/3911954/1308959 现如今主流的Android应用中,都少不了左右滑动滚屏这项功能,(貌似现在好多人使用智能机都习 ...

  7. Integral类型的跨平台使用

    fundamental integral types or extended integral types 我们先通过下图,来了解可以跨平台使用的整数类型: 之所以我们需要以上各种明确指定宽度的int ...

  8. 545C. Woodcutters

    题目链接 题意: n个树,在x1,x2,...,xn的位置,树的高度依次是h1,h2,...,hn 求的是当把树砍倒时候,不占用相邻树的位置,最大砍树个数 可向左 向右砍,即树向左向右倒,很显然 当树 ...

  9. 【android原生应用】之闹钟应用搭起篇

    由于工作原因接触android开发一段时间了,对于开发有了一些了解,于是萌生了搭起android原生应用进行分析和学习的想法.先从闹钟应用开始吧. 1.首先要下载原生应用,原生应用在原生系统里面(当然 ...

  10. Eclipse提示Tomcat miss丢失bug:The Tomcat server configuration at \Servers\Tomcat v5.5 Server at localhost-config is missing.

    Eclipse提示Tomcat miss丢失bug:The Tomcat server configuration at \Servers\Tomcat v5.5 Server at localhos ...