this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fixing objc_msgSendSuper for x86

+35 -5
+35 -5
src/libobjcdarwin/objc_msgSendSuper.nasm
··· 100 100 BITS 32 101 101 section text 102 102 103 - ; TODO: needs fixing like above 103 + %macro DereferenceArgument 1 104 + mov [esp-4], eax ; save the IMP 105 + mov eax, [esp+(%1*4)] ; get objc_super* 106 + mov eax, [eax] ; get the first member's value 107 + mov [esp+(%1*4)], eax ; fix the first argument 108 + mov eax, [esp-4] ; restore the IMP 109 + %endmacro 110 + 104 111 __darwin_objc_msgSendSuper2: 105 - mov eax, [esp+4] 106 - mov eax, [eax+4] 107 - mov [esp+4], eax 112 + mov eax, [esp+4] ; get objc_super* 113 + ; make a copy on the stack 114 + mov ecx, [eax] ; 1st elem 115 + mov [esp-8], ecx 116 + mov ecx, [eax+4] ; 2nd elem 117 + mov ecx, [ecx+4] ; get superclass from objc_class 118 + mov [esp-4], ecx 119 + 120 + sub esp, 8 121 + mov eax, [esp+16]; SEL (2nd argument) 122 + push eax 123 + lea eax, [esp+12]; fixed objc_super (1st argument) 124 + push eax 125 + 126 + call objc_msg_lookup_super 127 + 128 + add esp, 16 ; remove args & struct from the stack 129 + 130 + DereferenceArgument 1 131 + 132 + jmp eax 108 133 109 134 __darwin_objc_msgSendSuper: 110 135 ··· 114 139 push eax 115 140 call objc_msg_lookup_super 116 141 add esp, 8 142 + 143 + DereferenceArgument 1 144 + 117 145 jmp eax 118 146 119 147 __darwin_objc_msgSendSuper2_stret: 120 148 mov eax, [esp+12] 121 149 push eax 122 - mov eax, [esp+20] 150 + mov eax, [esp+12] 123 151 push eax 124 152 125 153 call objc_msg_lookup_super 126 154 sub esp, 8 155 + 156 + DereferenceArgument 2 127 157 128 158 jmp eax 129 159