00003658 00 00 00 00 8d 29 00 00 84 32 00 00 00 00 00 00
00003668 00 00 00 00 80 31 00 00 00 00 00 00 00 00 00 00
00003678 28 00 00 00 00 00 00 00 00 00 00 00 0e 2b 00 00
00003688 00 00 00 00 8c 32 00 00 00 00 00 00 00 00 00 00
00003698 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00
000036a8 00 00 00 00 48 2d 00 00 b8 34 00 00 00 00 00 00
000036b8 00 00 00 00 68 34 00 00 00 00 00 00 00 00 00 00
000036c8 28 00 00 00 00 00 00 00
可以通过otool –t直接查看代码段(__TEXT)的反汇编代码,也可以通过otool –d查看数据段内容,例如:Otool –tv ButtonFun得到如下内容(截取部分):
ButtonFun:
(__TEXT,__text) section
start:
00001b50 pushl $000
00001b52 movl %esp,%ebp
00001b54 andl $0xf0,%esp
00001b57 subl $010,%esp
00001b5a movl 004(%ebp),%ebx
00001b5d movl %ebx,(%esp)
00001b60 leal 008(%ebp),%ecx
00001b63 movl %ecx,004(%esp)
00001b67 addl $001,%ebx
00001b6a shll $002,%ebx
00001b6d addl %ecx,%ebx
00001b6f movl %ebx,008(%esp)
00001b73 movl (%ebx),%eax
00001b75 addl $004,%ebx
00001b78 testl %eax,%eax
00001b7a jne 0x00001b73
00001b7c movl %ebx,0x0c(%esp)
00001b80 calll 0x00001b90
00001b85 movl %eax,(%esp)
00001b88 calll 0x0000244c
00001b8d hlt
00001b8e nop
00001b8f nop
附件:
machine.h
loader.h
load command实例
参考资料:
@126/blog/static/166700480201129102259978/
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-42605-5.html
巴菲特不是人吗
有必要强制回归