iOS9 class dump header
获取系统私有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的更多相关文章
- 数据备份--dump(此作者有许多有用的博客文章)
数据中 心操作大量的数据.当遭到破坏时,这就是一场灾难.这时候需要备份来恢复,及时你又大量的备份数据都没用,备份也肯定不是在浪费时间.你也许很幸运从 来没有经历过数据丢失.但是, 由于这种事情极少发生 ...
- Linux完整备份工具 - dump, restore(现在基本不用这两个)
dump 其实 dump 的功能颇强,他除了可以备份整个文件系统之外,还可以制定等级喔!什么意思啊! 假设你的 /home 是独立的一个文件系统,那你第一次进行过 dump 后,再进行第二次 dump ...
- undo损坏故障恢复(二)ORA-01092,ORA-00604,ORA-01110
undo 故障诊断与恢复(二) 今天是2013-09-01,目前困扰我将近一周的问题,终于解决了,我非常感谢帮助我的朋友,也非常感谢管我要钱然后替我解决问题的朋友(我没采用).这更激发了我一定要解决这 ...
- 理解 B*tree index内部结构
转载请注明出处:http://write.blog.csdn.net/postedit/40589651 Oracle数据库里的B树索引就好象一棵倒长的树.它包括两种类型的数据块:一种是索引分支块,还 ...
- Oracle 如何提交手册Cluster Table事务
环境遇到ora-00600 4000错误,该目的是参与cluster table,什么我这里有以下简单的模拟.以供参考! ++++创建一个测试表 ? 1 2 3 4 5 6 7 8 9 10 11 1 ...
- 【BBED】BBED模拟并修复ORA-08102错误
[BBED]BBED模拟并修复ORA-08102错误 1.1 BLOG文档结构图 1.2 前言部分 1.2.1 导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其 ...
- pt-show-grants
用法: pt-show-grants [OPTION ... ] [DSN] 例子: pt-show-grants pt-show-grants --separate --revoke | dif ...
- pt-show-grants的用法
pt-show-grants的用法 1.先查找所有用户和Host 2.然后逐个执行show grants pt-show-grants的功能是格式化打印输出MySQL上的赋权,以便你可以有效地复制.比 ...
- Oracle降低高水位先(转载)
Oracle 降低高水位线的方法 高水位(HIGH WARTER MARK,HWM)好比水库中储水的水位,用于描述数据库中段的扩展方式.高水位对全表扫描方式有着至关重要的影响.当使用DELETE删除 ...
随机推荐
- 从浏览器的console获取angularjs的scope
http://ionicframework.com/blog/angularjs-console/ 1: Access Scopes We can access any scope (even iso ...
- D3D depth buffer的预览
在使用D3D开发游戏的过程中,很多情况下都会用到depth buffer来完成特定的效果,比如DOF,Shadows,SSAO等等.在这些情况下我们就可能需要预览depth buffer来确定它是正确 ...
- Shell 备忘录
此文收集工作中用到的Shell备忘,随用随机: 1.比较 -eq 等于,如:if [ "$a" -eq "$b" ] -ne 不等于,如 ...
- MEAN实践——LAMP的新时代替代方案(下)
在本系列文章的第一部分旨在介绍一些应用程序的基础技术细节和如何进行数据建模,而这个部分文章将着手建立验证应用程序行为的测试,并会指出如何启动和运行应用程序. 首先,编写测试 首先定义一些小型配置库.文 ...
- sqlite3中的数据类型
大多数的数据库引擎(到现在据我们所知的除了sqlite的每个sql数据库引擎)都使用静态的.刚性的类型,使用静态类型,数据的类型就由它的容器决定,这个容器是这个指被存放的特定列. Sqlite使用一个 ...
- iOS项目的完整重命名方法图文教程
原文链接:http://www.cocoachina.com/ios/20150104/10824.html iOS项目的完整重命名方法图文教程 前言:在iOS开发中,有时候想改一下项目的名字,都会遇 ...
- POJ 1988
#include<iostream> #include<stdio.h> #include<algorithm> #define MAXN 30005 using ...
- iOS多线程的初步研究(二)-- 锁
谈到线程同步,一般指如何对线程间共享数据的同步读写,如何避免混乱的读写结果.一个基本的解决办法就是使用锁(LOCK). iOS提供多种同步锁的类和方法,这里介绍下基本用法. 1. NSLock:最基本 ...
- EasyBCD 硬盘安装Pear OS
Pear OS是一个界面很像mac的Linux distro,基于Ubuntu,免费.可惜的是pear被一个大公司匿名收购,所以现在不更新啦,最后的版本是pear 8.有个pear的替代者elemen ...
- Shell脚本基础I
1.Linux shell类型 /bin/sh--已经被/bin/bash所取代 /bin/bash--就是Linux预设的shell /bin/ksh--由AT&T Bell lab发展出来 ...