2012-02-14 59 views
1

我试图找出哪些方法objc_msgSend()将调用。目标C选择表函数

虽然看着了AppKit或可可或基于Objective-C的框架的任何框架的任何功能的组件,我总是在stucked objc_msgSend()。

没有任何一个有任何想法如何实现从这里实际的函数调用?

我记得在浏览时我看到这是一种对地图哪个功能会根据选择器(整数)被调用的一些开源代码。我想这是来自苹果(不知道)。我试图从近2天内找到该链接,但无法找到它。如果有人链接,请分享。

在组装之后,我试图解决这个呼叫

__text:001C6E46     call _objc_msgSend 

它应该是很大的,如果有一个人能帮助我了解整个过程。

__text:001C6DC0 ; -[NSWindow _windowMovedToRect:] 
__text:001C6DC0 __NSWindow__windowMovedToRect__ proc near ; DATA XREF: __inst_meth:00993418o 
__text:001C6DC0 
__text:001C6DC0 var_C   = dword ptr -0Ch 
__text:001C6DC0 arg_0   = dword ptr 8 
__text:001C6DC0 arg_8   = dword ptr 10h 
__text:001C6DC0 arg_C   = dword ptr 14h 
__text:001C6DC0 arg_10   = dword ptr 18h 
__text:001C6DC0 arg_14   = dword ptr 1Ch 
__text:001C6DC0 
__text:001C6DC0     push ebp 
__text:001C6DC1     mov  ebp, esp 
__text:001C6DC3     push esi 
__text:001C6DC4     push ebx 
__text:001C6DC5     sub  esp, 30h 
__text:001C6DC8     call $+5 
__text:001C6DCD     pop  ebx 
__text:001C6DCE     mov  esi, [ebp+arg_0] 
__text:001C6DD1     lea  eax, [ebp+var_C] 
__text:001C6DD4     mov  [esp], eax 
__text:001C6DD7     call _PSbuttondown 
__text:001C6DDC     mov  edx, [ebp+var_C] 
__text:001C6DDF     test edx, edx 
__text:001C6DE1     jz  short loc_1C6E1D 
__text:001C6DE3     mov  eax, [esi+80h] 
__text:001C6DE9     or  dword ptr [eax+0B8h], 1000000h 
__text:001C6DF3     mov  eax, [ebp+arg_8] 
__text:001C6DF6     mov  edx, [ebp+arg_C] 
__text:001C6DF9     mov  [esp+8], eax 
__text:001C6DFD     mov  [esp+0Ch], edx 
__text:001C6E01     mov  eax, [esi+8] 
__text:001C6E04     mov  edx, [esi+0Ch] 
__text:001C6E07     mov  [esp], eax 
__text:001C6E0A     mov  [esp+4], edx 
__text:001C6E0E     call _NSEqualPoints 
__text:001C6E13     test al, al 
__text:001C6E15     jnz  loc_1C6ED6 
__text:001C6E1B     jmp  short loc_1C6E50 
__text:001C6E1D ; --------------------------------------------------------------------------- 
__text:001C6E1D 
__text:001C6E1D loc_1C6E1D:        ; CODE XREF: -[NSWindow _windowMovedToRect:]+21j 
__text:001C6E1D     mov  eax, [ebp+arg_8] 
__text:001C6E20     mov  [esp+8], eax 
__text:001C6E24     mov  eax, [ebp+arg_C] 
__text:001C6E27     mov  [esp+0Ch], eax 
__text:001C6E2B     mov  eax, [ebp+arg_10] 
__text:001C6E2E     mov  [esp+10h], eax 
__text:001C6E32     mov  eax, [ebp+arg_14] 
__text:001C6E35     mov  [esp+14h], eax 
__text:001C6E39     mov  eax, ds:(off_926DC8 - 1C6DCDh)[ebx] 
__text:001C6E3F     mov  [esp+4], eax 
__text:001C6E43     mov  [esp], esi 
__text:001C6E46     call _objc_msgSend 
__text:001C6E4B     jmp  loc_1C6ED6 
__text:001C6E50 ; --------------------------------------------------------------------------- 
__text:001C6E50 
__text:001C6E50 loc_1C6E50:        ; CODE XREF: -[NSWindow _windowMovedToRect:]+5Bj 
__text:001C6E50     mov  eax, [ebp+arg_8] 
__text:001C6E53     mov  [esp+8], eax 
__text:001C6E57     mov  eax, [ebp+arg_C] 
__text:001C6E5A     mov  [esp+0Ch], eax 
__text:001C6E5E     mov  eax, [ebp+arg_10] 
__text:001C6E61     mov  [esp+10h], eax 
__text:001C6E65     mov  eax, [ebp+arg_14] 
__text:001C6E68     mov  [esp+14h], eax 
__text:001C6E6C     mov  eax, ds:(off_91D198 - 1C6DCDh)[ebx] 
__text:001C6E72     mov  [esp+4], eax 
__text:001C6E76     mov  [esp], esi 
__text:001C6E79     call _objc_msgSend 
__text:001C6E7E     mov  eax, ds:(off_91A4B8 - 1C6DCDh)[ebx] 
__text:001C6E84     mov  [esp+4], eax 
__text:001C6E88     mov  eax, ds:(off_928EE8 - 1C6DCDh)[ebx] 
__text:001C6E8E     mov  [esp], eax 
__text:001C6E91     call _objc_msgSend 
__text:001C6E96     mov  [esp+0Ch], esi 
__text:001C6E9A     mov  edx, ds:(_NSWindowDidMoveNotification_ptr - 1C6DCDh)[ebx] 
__text:001C6EA0     mov  edx, [edx] 
__text:001C6EA2     mov  [esp+8], edx 
__text:001C6EA6     mov  edx, ds:(off_91B0DC - 1C6DCDh)[ebx] 
__text:001C6EAC     mov  [esp+4], edx 
__text:001C6EB0     mov  [esp], eax 
__text:001C6EB3     call _objc_msgSend 
__text:001C6EB8     mov  eax, ds:(_NSAccessibilityMovedNotification_ptr - 1C6DCDh)[ebx] 
__text:001C6EBE     mov  eax, [eax] 
__text:001C6EC0     mov  [esp+8], eax 
__text:001C6EC4     mov  eax, ds:(off_91B030 - 1C6DCDh)[ebx] 
__text:001C6ECA     mov  [esp+4], eax 
__text:001C6ECE     mov  [esp], esi 
__text:001C6ED1     call _objc_msgSend 
__text:001C6ED6 
__text:001C6ED6 loc_1C6ED6:        ; CODE XREF: -[NSWindow _windowMovedToRect:]+55j 
__text:001C6ED6           ; -[NSWindow _windowMovedToRect:]+8Bj 
__text:001C6ED6     add  esp, 30h 
__text:001C6ED9     pop  ebx 
__text:001C6EDA     pop  esi 
__text:001C6EDB     leave 
__text:001C6EDC     retn 
__text:001C6EDC __NSWindow__windowMovedToRect__ endp 

回答

0

site提到一个叫做otx工具似乎选择为你解码。

+0

我知道OTX并不能解决objc_msgSend()。 – MacGeek 2012-02-14 14:37:13

+0

我链接到的站点上的示例确实显示了otx解析objc_msgSend。也许如果你用otool和otx输出发布了一些示例程序集,我们可以进一步提供帮助。 – jcopenha 2012-02-14 14:57:39

+0

对不起,我混淆了我的评论。类转储和OTT。我已经更新了程序集问题。 – MacGeek 2012-02-15 10:09:51