Ticket #514: wrapper_darwin.2.patch
| File wrapper_darwin.2.patch, 1.6 KB (added by , 20 years ago) |
|---|
-
wrapper.S
old new 1 . section .data1 .data 2 2 .globl caller_return 3 3 caller_return: 4 4 .long 0 5 .globl report_entry6 report_entry:5 .globl _report_entry 6 _report_entry: 7 7 .long null_call 8 .globl report_ret9 report_ret:8 .globl _report_ret 9 _report_ret: 10 10 .long null_call 11 .glob alwrapper_target12 wrapper_target:11 .globl _wrapper_target 12 _wrapper_target: 13 13 .long null_call 14 14 15 . section .text15 .text 16 16 .globl null_call 17 .type null_call, @function18 . balign 16,0x9017 # .type null_call, @function 18 .p2align 4,0x90 19 19 null_call: 20 20 ret 21 .globl wrapper22 .type wrapper, @function23 . balign 16,0x9024 wrapper:21 .globl _wrapper 22 # .type wrapper, @function 23 .p2align 4,0x90 24 _wrapper: 25 25 pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI) 26 26 pushf # store flags 27 27 … … 39 39 push %eax 40 40 push %edx 41 41 42 call * report_entry # report entry42 call *_report_entry # report entry 43 43 44 44 test %eax, %eax 45 45 jnz .Ldone … … 51 51 popl caller_return # switch return addresses 52 52 pushl $.Lwrapper_return 53 53 54 jmp * wrapper_target # wrapper_target should return at .Lwrapper_return54 jmp *_wrapper_target # wrapper_target should return at .Lwrapper_return 55 55 56 . balign 16, 0x9056 .p2align 4, 0x90 57 57 .Lwrapper_return: 58 58 pushl caller_return # restore the original return address 59 59 pusha # more for reference sake here … … 73 73 push %eax 74 74 push %edx 75 75 76 call * report_ret # report the return information (same args)76 call *_report_ret # report the return information (same args) 77 77 .Ldone: 78 78 79 79 leave
