class-dump + DumpFrameworks.pl
目的:实现生成 private framework 的 .h,以便倒入项目使用私有 api。
一、class-dump
下载地址: http://stevenygard.com/download/
安装步骤:
a) 下载了 dmg 打开并把 class-dump copy 到 /usr/bin/ 目录下;
b) 修改 class-dump 的权限,
$ chmod 777 /usr/bin/class-dump
二、DumpFrameworks.pl
从 github 上别人越狱的工程上下载: https://github.com/shuhongwu/HackSpringDemo/blob/master/DumpFrameworks.pl
a) 放到任意目录可行。
b) 根据自己 framework 的地址,修改路径。
c) cd 到 DumpFrameworks.pl 的路径,并执行
$ ./DumpFrameworks.pl
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
dump_frameworks('/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks',
'Frameworks'); # Private Frameworks
dump_frameworks('/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.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";
} chdir($cwd) or die "Could not chdir($cwd) - $!";
}
}
三、使用
$ class-dump -H xxx(打包好的文件) -o xxx.h
四、其他
class-dump 作用的对象必须是未经过加密的可执行文件,而从 app store 下载的 app 都是经过签名加密的。
class-dump + DumpFrameworks.pl的更多相关文章
- iOS9 class dump header
获取系统私有API,网上有很多资料总结了一下就三种方式: 使用class-dump可以提取系统私有API列表 使用class-dump+DumpFrameworks.pl,这个可以一次性提取所有系统F ...
- iOS逆向之class-dump
1.class-dump class-dump是用来dump目标文件的类信息的工具.它利用Objective-C语言的runtime的特性,将存储在mach-O文件中的@interface和@prot ...
- iphone越狱开发之Class-Dump
刚刚开始接触ios越狱开发,现在开始纪录每天的点滴进展 装载请注明 http://www.cnblogs.com/xiongwj0910/archive/2012/08/16/2642988.html ...
- 怎么获取iOS的私有API
前言 作为iOS开发人员,相信大多数伙伴都对怎么获取iOS的私有API很有兴趣,最近通过查找资料,总结了以下三种方法,希望对你有用. 第一种(class-dump) 不得不说这是一个很棒的工具,安装和 ...
- iPhone私有API
一.基本知识 iPhone中的API除了公开的API:Published API外(或者叫文档中记录的API:Documented API),还有两类API:私有API:Private API和未公开 ...
- 导出Private API
首先介绍下private API 它共分为两类: 1 在官方文档中没有呈现的API(在frameworks 下隐藏) 2 苹果明确申明不能使用的API ,在privateFrameworks 下 然后 ...
- iOS应用之间的跳转与数据传递
在开发的时候遇到需要从其他APP调用自己的APP的需求,比如从Safari中打开APP,并且传递一些信息的需要 1.首先设置自己的URL types 打开项目中的工程文件,打开info选项,在下面的U ...
- IOS私人API用法
先要使用class-dump 和dumpFrameworks.pl 工具 将ios的framework导出来. 下面是工具的下载地址: class-dump下载地址http://www.codethe ...
- (iOS)私有API的使用(原创)
最近在做企业级程序,需要搞设备的udid等信息,但是ios7把udid私有化了,不公开使用.所以研究了一下ios的私有api. 调查了一下文章,发现这方面的文章不多,国内更是不全,高手们都懒得写基础教 ...
随机推荐
- WPF – pass multiple parameters to a Command
public class SendCommand : ICommand { public void Execute(object parameter) { var labels = ((object[ ...
- ajax与HTML5 history pushState/replaceState实例
一.本文就是个实例展示 三点: 我就TM想找个例子,知道如何个使用,使用语法什么的滚粗 跟搜索引擎搞基 自己备忘 精力总是有限的,昨天一冲动,在上海浦东外环之外订了个90米的房子,要借钱筹首付.贷款和 ...
- 洛谷 P1029 最大公约数和最小公倍数问题 Label:Water&&非学习区警告
题目描述 输入二个正整数x0,y0(2<=x0<100000,2<=y0<=1000000),求出满足下列条件的P,Q的个数 条件: 1.P,Q是正整数 2.要求P,Q以x0为 ...
- Android -- 自定义ImageView(圆形头像)
1. 原图
- GUI之绘画控制
一.绘制的动力 GUI的绘画是根据消息动作驱动的 主循环应该是 二.绘制的过程 绘画过程应该是这样的: 首先窗口存在上下层关系-> 在绘制时应该从底部窗口开始绘制,逐一绘制 下面是一些特殊的窗口 ...
- js之获取窗口大小和位置信息
除IE外的浏览器查看窗口大小和位置信息: //The overall size of the browser window on the desktop var windowWidth = windo ...
- JAVA生成带Logo的二维码
1.下载生成二维码所需要的jar包qrcode.jar: 2.直接上生成二维码的java代码 //需要导入的包 import java.awt.Color;import java.awt.Graphi ...
- Windows Phone 8 Sync
A lot of the below depends on the types of data, how often it is changing, and how often it is likel ...
- - dequeueReusableCellWithIdentifier:
与之对应的还有一个方法: - dequeueReusableCellWithIdentifier:forIndexPath: 1 > - dequeueReusableCellWithIdent ...
- 【LeetCode】16. 4Sum
题目:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = ...