然而出现了权限问题:
cp: /usr/bin/mvim: Operation not permitted
搜索之后发现,是El Capitan
加入了Rootless机制
,不再能够随心所欲的读写很多路径下了。设置 root 权限也不行。
Rootless机制将成为对抗恶意程序的最后防线
于是尝试关闭 Rootless。
重启按住 Command+R,进入恢复模式,打开Terminal。
csrutil disable
重启即可。如果要恢复默认,那么
csrutil enable
class-dump 下载地址:http://stevenygard.com/projects/class-dump
选择dmg文件下载后,将dmg文件中的class-dump复制到/usr/bin目录,并在Terminal中执行"sudo chmod 777 /usr/bin/class-dump" 命令赋予其执行权限。
注意:class-dump的作用对象必须是未经加密的可执行文件,而从App Store下载的App都是经过加密签名的,相当于有一层“壳”,class-dump应付不了这样的文件。一般要先用AppCrackr来砸壳,或者dumpdecrypted砸壳方式后面肯定会进行介绍。p107页
有一个简单的方法,在一些第三方软件下载应用的越狱安装版,这样版本的壳已经被手动砸开了。
将下载的.ipa文件更改为.zip文件,解压后找到目标文件。
以去哪儿网为例:
找到Unix可执行文件,将其复制到认可一个目录下,然后再用class-dump来提取我们想要的信息。
在Terminal中执行:class-dump -H 去哪儿旅行 -o 去哪儿旅行.h
class-dump -S -s -H Log Guru -o~/Heads/LogGuru
export THEOS=/opt/theos
sudo git clone git://github.com/DHowett/theos.git $THEOS安装命令如下:
curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1
当brew安装成功后,就可以随意安装自己想要的软件了,例如wget,命令如下:
sudo brew install wget
卸载的话,命令如下:
sudo brew uninstall wget
查看安装软件的话,命令如下:
sudo brew search /apache*/
/Applications/XCode.app/Contents/Developer/usr/bin/lldb
【自编号:28】【Cydia上最知名的共享源——xsellize能够快速破解几乎所有收费软件】【2015-03-21 22:19:41 by beyond】
主要介绍iOS系统结构
【查看原文】 【2015-03-23 15:02:33 by beyond】
主要介绍各种工具使用
【查看原文】 【2015-03-23 15:05:43 by beyond】
下载http://stevenygard.com/projects/class-dump/,
复制到/usr/bin;
执行sudo chmod 777 /usr/bin/class-dump;
运行class-dump;
进入app目录 cd /Users/juns/SGCode/TESTIDA.app;
使用plutil命令查看Info.plist,如下:plutil -p Info.plist;
可以在命令行中看到: "CFBundleExecutable" => "TESTIDA";
继续使用命令导出头文件到指定文件夹:class-dump -S -s -H TESTIDA -o /Users/juns/SGCode/heads/app1
【2015-03-24 19:50:03 by beyond】
1、指定XCode:sudo xcode-select -s /Applications/Xcode2.app/Contents/Developer
2、配置环境变量:export THEOS=/opt/theos
3、下载Theos:sudo git clone git://github.com/DHowett/theos.git $THEOS
4、配置ldid:joedj.net/ldid下载后,放在/opt/theos/bin目录下,
赋予权限:sudo chmod 777 /opt/theos/bin/ldid
5、配置CydiaSubstrate 执行:sudo /opt/theos/bin/bootstrap.sh substrate,
此时遇到Theos的Bug,它无法自动生成一个有效的libsubstrate.dylib文件,需在Cydia中搜索并安装CydiaSubstrate,
然后用iFunBox或scp方式将iOS中的/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate拷贝到电脑中,
将其重命名为libsubstrate后,放到/opt/theos/lib/libsubstrate.dylib进行替换,
6:配置dpkg-deb工具,
从https://raw.githubusercontent.com/DHowett/dm.pl/master/dm.pl下载或拷贝并重命名为dpkg-deb后,
放到/opt/theos/bin目录下,赋予权限;
7、从http://github.com/DHowett/theos-nic-templates/archive/master.zip下载其他NIC模板,
解压放到/opt/theos/templates/iphone下面
【2015-03-24 19:52:30 by beyond】
@interface QZUserEngine:NSObject
- (id)sid;
+ (id)instance;
@end
%hook QQChatViewController
- (void)viewDidAppear:(BOOL)animated
{ %orig;
// hook类方法
QZUserEngine *engine = [%c(QZUserEngine) instance];
}
%end
【2015-03-24 19:54:29 by beyond】
class-dump用法 [options]
选项可以是
-H 在当前目录生成头文件,或者在用-o选项指定的目录生成
-o
为-H选项指定输出目录
-a 显示实例变量偏移
-A 显示实现地址
–arch 选择一个指定的架构,如ppc, ppc7400, ppc64, i386, x86_64
-C 只显示同正则表达式匹配的类
-f 在方法名中查找字符串
-I 对类,目录,协议 按照继承关系(inheritance)进行排序(覆盖-s选项)
-r 递归扩展framework,并修复VM共享库
-s 按名称对classes和categories进行排序
-S 按名称对方法(method)进行排序
–list-arches 类出文件中的arches,然后退出
–sdk-root 指定 SDK root 路径(完全路径,或者 4.1等)
【2015-03-25 10:09:58 by beyond】
【进入网址】 【2015-03-25 10:18:34 by beyond】error: failed to launch '/private/var/mobile/Containers/Bundle/Application/B4D6EABF-3458-435D-A3E7-17D5F33457D3/Beyond.app' -- process launch failed: Locked【2015-03-25 21:18:06 by beyond】
NSClassFromString这个和objc_getClass的区别在于参数,前者的参数是NSString,后者是char *
【2015-03-26 14:20:50 by beyond】
既然没有实现该方法,就到父类里面看看,发现
UIBButtonItem实现了_sendAction: withEvent方法,
那么把UIKit的二进制文件拖到IDA中???????
【2015-04-06 13:30:37 by beyond】
cbz r0,label
如果r0为0就跳到label
类似还有cbnz r0,label
【2015-04-06 14:12:13 by beyond】
从右往左压栈,r11先入栈,高地址
类似情况还有函数调用,
p(,,,,,,,),前四个参数r0~r3中,
其余参数从右往左依次入栈,返回值存r0中
【2015-04-06 14:49:34 by beyond】
结合action定义,猜测类型是 SEL ,
使用p (char *)$r2 打印
【2015-04-06 15:01:53 by beyond】
(lldb) help
Debugger commands:
apropos -- Find a list of debugger commands related to a particular
word/subject.
breakpoint -- A set of commands for operating on breakpoints. Also see
_regexp-break.
command -- A set of commands for managing or customizing the
debugger commands.
disassemble -- Disassemble bytes in the current function, or elsewhere
in the executable program as specified by the user.
expression -- Evaluate a C/ObjC/C++ expression in the current program
context, using user defined variables and variables
currently in scope.
frame -- A set of commands for operating on the current thread's
frames.
gdb-remote -- Connect to a remote GDB server. If no hostname is
provided, localhost is assumed.
gui -- Switch into the curses based GUI mode.
help -- Show a list of all debugger commands, or give details
about specific commands.
kdp-remote -- Connect to a remote KDP server. udp port 41139 is the
default port number.
log -- A set of commands for operating on logs.
memory -- A set of commands for operating on memory.
platform -- A set of commands to manage and create platforms.
plugin -- A set of commands for managing or customizing plugin
commands.
process -- A set of commands for operating on a process.
quit -- Quit out of the LLDB debugger.
register -- A set of commands to access thread registers.
script -- Pass an expression to the script interpreter for
evaluation and return the results. Drop into the
interactive interpreter if no expression is given.
settings -- A set of commands for manipulating internal settable
debugger variables.
source -- A set of commands for accessing source file information
target -- A set of commands for operating on debugger targets.
thread -- A set of commands for operating on one or more threads
within a running process.
type -- A set of commands for operating on the type system
version -- Show version of LLDB debugger.
watchpoint -- A set of commands for operating on watchpoints.
Current command abbreviations (type 'help command alias' for more info):
add-dsym -- ('target symbols add') Add a debug symbol file to one of the
target's current modules by specifying a path to a debug symbols
file, or using the options to specify a module to download
symbols for.
attach -- ('_regexp-attach') Attach to a process id if in decimal,
otherwise treat the argument as a process name to attach to.
b -- ('_regexp-break') Set a breakpoint using a regular expression
to specify the location, where is in decimal and
is in hex.
bt -- ('_regexp-bt') Show a backtrace. An optional argument is
accepted; if that argument is a number, it specifies the number
of frames to display. If that argument is 'all', full
backtraces of all threads are displayed.
c -- ('process continue') Continue execution of all threads in the
current process.
call -- ('expression --') Evaluate a C/ObjC/C++ expression in the
current program context, using user defined variables and
variables currently in scope.
continue -- ('process continue') Continue execution of all threads in the
current process.
detach -- ('process detach') Detach from the current process being
debugged.
di -- ('disassembl
【2015-04-09 17:09:48 by beyond】
di -- ('disassemble') Disassemble bytes in the current function, or
elsewhere in the executable program as specified by the user.
dis -- ('disassemble') Disassemble bytes in the current function, or
elsewhere in the executable program as specified by the user.
display -- ('_regexp-display') Add an expression evaluation stop-hook.
down -- ('_regexp-down') Go down "n" frames in the stack (1 frame by
default).
env -- ('_regexp-env') Implements a shortcut to viewing and setting
environment variables.
exit -- ('quit') Quit out of the LLDB debugger.
f -- ('frame select') Select a frame by index from within the
current thread and make it the current frame.
file -- ('target create') Create a target using the argument as the
main executable.
finish -- ('thread step-out') Finish executing the function of the
currently selected frame and return to its call site in
specified thread (current thread, if none specified).
image -- ('target modules') A set of commands for accessing information
for one or more target modules.
j -- ('_regexp-jump') Sets the program counter to a new address.
jump -- ('_regexp-jump') Sets the program counter to a new address.
kill -- ('process kill') Terminate the current process being debugged.
l -- ('_regexp-list') Implements the GDB 'list' command in all of
its forms except FILE:FUNCTION and maps them to the appropriate
'source list' commands.
list -- ('_regexp-list') Implements the GDB 'list' command in all of
its forms except FILE:FUNCTION and maps them to the appropriate
'source list' commands.
n -- ('thread step-over') Source level single step in specified
thread (current thread, if none specified), stepping over
calls.
next -- ('thread step-over') Source level single step in specified
thread (current thread, if none specified), stepping over
calls.
nexti -- ('thread step-inst-over') Single step one instruction in
specified thread (current thread, if none specified), stepping
over calls.
ni -- ('thread step-inst-over') Single step one instruction in
specified thread (current thread, if none specified), stepping
over calls.
p -- ('expression --') Evaluate a C/ObjC/C++ expression in the
current program context, using user defined variables and
variables currently in scope.
po -- ('expression -O -- ') Evaluate a C/ObjC/C++ expression in the
current program context, using user defined variables and
variables currently in scope.
print -- ('expression --') Evaluate a C/ObjC/C++ expression in the
current program context, using user defined variables and
variables currently in scope.
q -- ('quit') Quit out of the LLDB debugger.
r -- ('process launch -c /bin/sh --') Launch the executable in the
debugger.
rbreak -- ('breakpoint set -r %1') Sets a breakpoint or set of
breakpoints in the executable.
repl -- ('expression -r -- ') Evaluate a C/ObjC/C++ expression in the
current program context, using user defined variables and
variables currently in scope.
run -- ('process launch -c /bin/sh --') Launch the executable in the
debugger.
s -- ('thread step-in') Source level single step in specified thread
(current thread, if none specified).
si -- ('thread step-inst') Single step one instruction in specified
thread (current thread, if none specified).
step -- ('thread step-in') Source level single step in specified thread
(current thread,
【2015-04-09 17:11:23 by beyond】
1.每次旋转都会调用 appdelegate
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
// 全局的设置:允许竖屏+横屏
NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
BOOL isAllowLandscape = [userDefault boolForKey:@"userDefault_isAllowLandscape"];
if (isAllowLandscape) {
return UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskLandscape;
} else {
return UIInterfaceOrientationMaskPortrait;
}
}
2.NJNavigationController
// 支持横竖屏显示 1111
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationPortrait;
}
// 支持设备自动旋转 2222
- (BOOL)shouldAutorotate
{
return NO;
}
3.BaseViewController
// 支持横竖屏显示 3333
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationPortrait;
}
// 支持设备自动旋转 4444
- (BOOL)shouldAutorotate
{
return NO;
}
通过 进系统断点得知:br s -a
每次用户调整屏幕的时候,会发出一个通知
// 发出通知
NSDictionary *dict = [NSDictionary dictionaryWithObject:@(1) forKey:@"UIDeviceOrientationRotateAnimatedUserInfoKey"];
[[NSNotificationCenter defaultCenter]postNotificationName:@"UIDeviceOrientationDidChangeNotification" object:[UIDevice currentDevice] userInfo:dict];
【2015-04-10 14:13:28 by beyond】
lldb: br s -a,其中s 是set的意思
【2015-04-16 10:50:33 by beyond】
lldb: help image list
List current executable and dependent shared library images.
Syntax: target modules list []
Command Options Usage:
target modules list [-ghou] [-a ] [-A[]] [-t[]] [-f[]] [-d[]] [-b[]] [-s[]] [-S[]] [-m[]] [-r[]] [-p[]]
-A[] ( --arch=[] )
Display the architecture when listing images.
-S[] ( --symfile-unique=[] )
Display the symbol file with optional width only if it is different
from the executable object file.
-a ( --address )
Display the image at this address.
-b[] ( --basename=[] )
Display the basename with optional width for the image object file.
-d[] ( --directory=[] )
Display the directory with optional width for the image object
file.
-f[] ( --fullpath=[] )
Display the fullpath to the image object file.
-g ( --global )
Display the modules from the global module list, not just the
current target.
-h ( --header )
Display the image header address as a load address if debugging, a
file address otherwise.
-m[] ( --mod-time=[] )
Display the modification time with optional width of the module.
-o ( --offset )
Display the image header address offset from the header file
address (the slide amount).
-p[] ( --pointer=[] )
Display the module pointer.
-r[] ( --ref-count=[] )
Display the reference count if the module is still in the shared
module cache.
-s[] ( --symfile=[] )
Display the fullpath to the image symbol file with optional width.
-t[] ( --triple=[] )
Display the triple when listing images.
-u ( --uuid )
Display the UUID when listing images.
'image' is an abbreviation for 'target modules'
【2015-04-16 11:27:39 by beyond】
po $r2,提示 no objective-c description available
就用打印SEL
p (char *)$r2
【2015-04-17 16:59:40 by beyond】
栈,开口向下,上面是高地址,下面是低地址
从右开始,参数入栈,先入的是高地址
x/10 $SP 从$sp开始,从低到高,打印连续的10个
【2015-04-17 17:03:26 by beyond】
br disable
disable -- Disable the specified breakpoint(s) without removing it/them.
If no breakpoints are specified, disable them all.
enable -- Enable the specified disabled breakpoint(s). If no breakpoints
are specified, enable all of them.
【2015-05-08 15:25:27 by beyond】
下载:http://download.csdn.net/download/map625/8191343
http://stevenygard.com/projects/class-dump/
拷贝到:/usr/local/bin
找到目标源:xxx.app 或者是库 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks
使用命令:class-dump -H /Users/pzh/iTunesStore.framework -o /Users/pzh
【2015-09-16 10:54:48 by beyond】