首页
社区
课程
招聘
[求助]分析 hopper
发表于: 2014-11-30 01:14 15921

[求助]分析 hopper

2014-11-30 01:14
15921
mac上的hopper出到3.6.4了。我还在用低版本, 地址:  http://www.hopperapp.com/
2.x版本很好xx掉, 今天分析了下V3的版本,感觉变得这么强大了。

1 入口地址一堆的0, mach-o文件里面也找不到有用的信息,比如类名,sel name , pro name 和cstring等等

__text:00000001000066C0 __text          segment para public 'CODE' use64
__text:00000001000066C0                 assume cs:__text
__text:00000001000066C0                 ;org 1000066C0h
__text:00000001000066C0                 assume es:nothing, ss:nothing, ds:nothing, fs:nothing, gs:nothing
__text:00000001000066C0                 public start
__text:00000001000066C0 start           db 0
__text:00000001000066C1                 db    0
__text:00000001000066C2                 db    0
__text:00000001000066C3                 db    0
__text:00000001000066C4                 db    0
__text:00000001000066C5                 db    0
__text:00000001000066C6                 db    0
__text:00000001000066C7                 db    0
__text:00000001000066C8                 db    0
__text:00000001000066C9                 db    0
__text:00000001000066CA                 db    0


2  还以为__mod_init_func里面会去做修改 , 看了一下,这个表就一项,而且指向无效的地址

_mod_init_func:00000001003B7DD8 ; Segment type: Pure data
__mod_init_func:00000001003B7DD8 ; Segment alignment 'qword' can not be represented in assembly
__mod_init_func:00000001003B7DD8 __mod_init_func segment para public 'DATA' use64
__mod_init_func:00000001003B7DD8                 assume cs:__mod_init_func
__mod_init_func:00000001003B7DD8                 ;org 1003B7DD8h
__mod_init_func:00000001003B7DD8                 dq 100112E1000h
__mod_init_func:00000001003B7DD8 __mod_init_func ends
__mod_init_func:00000001003B7DD8


3  lldb 和gdb 不管启动调试还是附加都会推出。。
localhost:~ xx$ lldb "/Users/xx/Downloads/Hopper Disassembler v3.app/Contents/MacOS/Hopper Disassembler v3"
(lldb) target create "/Users/xx/Downloads/Hopper Disassembler v3.app/Contents/MacOS/Hopper Disassembler v3"
error: unable to find CIE at 0xfffffa09 for cie_id = 0x000019ff for entry at 0x00001404.
Current executable set to '/Users/xx/Downloads/Hopper Disassembler v3.app/Contents/MacOS/Hopper Disassembler v3' (x86_64).
(lldb) r
Process 5501 launched: '/Users/xx/Downloads/Hopper Disassembler v3.app/Contents/MacOS/Hopper Disassembler v3' (x86_64)
Process 5501 exited with status = 45 (0x0000002d)


试着下断点把每个模块初始化要调用的全局函数都打印出来,貌似木有看出什么,除了系统外就是自身目录下的libLLVM-3.5.dylib。。。  打印差不多程序又退出了。。

。。。。。。。。。。
(省略类似的)

Process 4643 resuming
Command #2 'c' continued the target.
     rbx = 0x0000000101b3df60  libLLVM-3.5.dylib`_GLOBAL__I_a
Process 4643 resuming
Command #2 'c' continued the target.
     rbx = 0x0000000101b6d210  libLLVM-3.5.dylib`_GLOBAL__I_a
Process 4643 resuming
Command #2 'c' continued the target.
     rbx = 0x0000000101b70170  libLLVM-3.5.dylib`_GLOBAL__I_a
Process 4643 resuming
Command #2 'c' continued the target.
     rbx = 0x0000000101b71d30  libLLVM-3.5.dylib`_GLOBAL__I_a
Process 4643 resuming
Command #2 'c' continued the target.
     rbx = 0x0000000101b7a440  libLLVM-3.5.dylib`_GLOBAL__I_a
Process 4643 resuming
Command #2 'c' continued the target.
     rbx = 0x0000000101b7c9a0  libLLVM-3.5.dylib`_GLOBAL__I_a
Process 4643 resuming
Command #2 'c' continued the target.
     rbx = 0x00007fff8bfeadd0  libobjc.A.dylib`_GLOBAL__I_a
Process 4643 resuming
Command #2 'c' continued the target.
     rbx = 0x00007fff9467dc20  vImage`_GLOBAL__I_a
Process 4643 resuming
Command #2 'c' continued the target.
     rbx = 0x00007fff939621a2  Kerberos`heim_load_frameworks
Process 4643 resuming
Command #2 'c' continued the target.
     rbx = 0x00007fff92c27292  libGLImage.dylib`glCreateMallocZone()
Process 4643 resuming
Command #2 'c' continued the target.
Process 4643 exited with status = 45 (0x0000002d)


有分析过的大牛吗,求指点一二,哪里忽略?。。

[课程]Android-CTF解题方法汇总!

收藏
免费 0
支持
分享
最新回复 (15)
雪    币: 2443
活跃值: (464)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
2
新版的加壳了。hoho~
2014-11-30 15:44
0
雪    币: 100
活跃值: (323)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
有看过mach-o的格式, 可能是忽略了某些东西,第一个门槛就卡死了,壳都脱不了。。
2014-11-30 17:40
0
雪    币: 100
活跃值: (323)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
是mach-o里面的section的信息被修改了。 要修复一下。嘿嘿。
2014-11-30 23:49
0
雪    币: 100
活跃值: (323)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
第一次mach-o上脱壳,,以前碰到的都是无花无壳的,,搞了一天3.6.4版本,搞定了,长知识了
上传的附件:
2014-12-1 18:27
0
雪    币: 201
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
能详细说下脱壳过程或者section修复细节么?
2014-12-3 11:58
0
雪    币: 189
活跃值: (20)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
tbl
7
关注中。
2015-1-2 21:32
0
雪    币: 189
活跃值: (20)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
tbl
8
Mac上脱壳用的是什么调试器?
2015-1-2 21:34
0
雪    币: 189
活跃值: (20)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
tbl
9
sh-3.2# otool -L "Hopper Disassembler v3"
Hopper Disassembler v3:
	@rpath/libLLVM-3.5.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57031.1.34)
	@loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle (compatibility version 1.6.0, current version 1.8.0)
	/usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
	/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.6)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
	/usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.10.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 21.0.0)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1151.16.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1343.14.0)
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 48.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1151.16.0)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 62.0.0)
sh-3.2#


最近也在折腾这个程序的脱壳,用gdb调试总是异常退出,Mach-o的脱壳也不是太了解,求楼主和各位大神指点
2015-1-5 23:31
0
雪    币: 14006
活跃值: (3624)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
最新版脱壳?关注下。
2015-1-6 18:52
0
雪    币: 573
活跃值: (979)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
11
Mark
要是能说下,怎么加密的就好了。
2015-1-10 16:02
0
雪    币: 32
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
12
新手,2.x 都还不太会用
2015-1-28 11:23
0
雪    币: 6
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
13
之前也试过一下,不能lldb的原因是其中有代码调用了ptrace anti-debug, 并且是直接调用系统调用的,没有通过ptrace()(2). 这段代码有壳,不好直接断下来。

Arcade大牛说说方法吧
2015-2-8 02:34
0
雪    币: 43
活跃值: (388)
能力值: ( LV9,RANK:140 )
在线值:
发帖
回帖
粉丝
14
兄弟我在脱3.7.8,bin是全都解开了,能完美载入ida等来分析。
脱出来的bin也能运行,并且能显示主界面,但是大约显示一秒钟左右,就退出了。
报错是在objc_release的时候 access bad address。
由于没有去掉ant-ptrace,所以没法载入gdb分析,现在一筹莫展,兄弟你看看能不能看出啥门道
2015-2-28 11:46
0
雪    币: 100
活跃值: (323)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
15
先修复section offset和size。
然后在 class load的函数下断点, 单步,看到被anti的就跟进去,就能看到ptrace的内联的调用了。
这个壳会自修改内存Bin的二进制,也可以dump出来分析。

不得不说lldb调试太蛋疼了。 没有像od这样的神器。
我用的adg 调试
2015-2-28 21:16
0
雪    币: 26
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
16
希望有人能秉持知識共享的精神分享成功脫殼的完整過程。
2015-5-30 17:04
0
游客
登录 | 注册 方可回帖
返回
//