1 2#ifdef _M_ARM 3 4#include <kxarm.h> 5 6 MACRO 7 DEFINE_WRAPPER_FUNC $n, $off, $x 8 LCLS _FuncName 9_FuncName SETS "_wrapper_func_":CC:"$n" 10 NESTED_ENTRY $_FuncName 11 __assertfail 12 NESTED_END $_FuncName 13 MEND 14 15#else 16 17#include <asm.inc> 18 19.code 20 21MACRO(DEFINE_WRAPPER_FUNC, n, off, x) 22#ifdef _M_IX86 23PUBLIC _wrapper_func_&n& 24_wrapper_func_&n&: 25 mov eax, [esp+4] 26 mov eax, [eax+4] 27 mov [esp+4], eax 28 mov eax, [eax] 29 jmp dword ptr [eax+off] 30#elif defined(_M_AMD64) 31PUBLIC wrapper_func_&n& 32wrapper_func_&n&: 33 mov rcx, [rcx+4] 34 mov rax, [rcx] 35 jmp qword ptr [rax+off] 36#else 37#error Unimplemented 38#endif 39ENDM 40 41#endif 42 43 DEFINE_WRAPPER_FUNC 3, 12, 24 44 DEFINE_WRAPPER_FUNC 4, 16, 32 45 DEFINE_WRAPPER_FUNC 5, 20, 40 46 DEFINE_WRAPPER_FUNC 6, 24, 48 47 DEFINE_WRAPPER_FUNC 7, 28, 56 48 DEFINE_WRAPPER_FUNC 8, 32, 64 49 DEFINE_WRAPPER_FUNC 9, 36, 72 50 DEFINE_WRAPPER_FUNC 10, 40, 80 51 DEFINE_WRAPPER_FUNC 11, 44, 88 52 DEFINE_WRAPPER_FUNC 12, 48, 96 53 DEFINE_WRAPPER_FUNC 13, 52, 104 54 DEFINE_WRAPPER_FUNC 14, 56, 112 55 DEFINE_WRAPPER_FUNC 15, 60, 120 56 DEFINE_WRAPPER_FUNC 16, 64, 128 57 DEFINE_WRAPPER_FUNC 17, 68, 136 58 DEFINE_WRAPPER_FUNC 18, 72, 144 59 DEFINE_WRAPPER_FUNC 19, 76, 152 60 DEFINE_WRAPPER_FUNC 20, 80, 160 61 DEFINE_WRAPPER_FUNC 21, 84, 168 62 DEFINE_WRAPPER_FUNC 22, 88, 176 63 DEFINE_WRAPPER_FUNC 23, 92, 184 64 DEFINE_WRAPPER_FUNC 24, 96, 192 65 DEFINE_WRAPPER_FUNC 25, 100, 200 66 DEFINE_WRAPPER_FUNC 26, 104, 208 67 DEFINE_WRAPPER_FUNC 27, 108, 216 68 DEFINE_WRAPPER_FUNC 28, 112, 224 69 DEFINE_WRAPPER_FUNC 29, 116, 232 70 DEFINE_WRAPPER_FUNC 30, 120, 240 71 DEFINE_WRAPPER_FUNC 31, 124, 248 72 DEFINE_WRAPPER_FUNC 32, 128, 256 73 DEFINE_WRAPPER_FUNC 33, 132, 264 74 DEFINE_WRAPPER_FUNC 34, 136, 272 75 DEFINE_WRAPPER_FUNC 35, 140, 280 76 DEFINE_WRAPPER_FUNC 36, 144, 288 77 DEFINE_WRAPPER_FUNC 37, 148, 296 78 DEFINE_WRAPPER_FUNC 38, 152, 304 79 DEFINE_WRAPPER_FUNC 39, 156, 312 80 DEFINE_WRAPPER_FUNC 40, 160, 320 81 DEFINE_WRAPPER_FUNC 41, 164, 328 82 DEFINE_WRAPPER_FUNC 42, 168, 336 83 DEFINE_WRAPPER_FUNC 43, 172, 344 84 DEFINE_WRAPPER_FUNC 44, 176, 352 85 DEFINE_WRAPPER_FUNC 45, 180, 360 86 DEFINE_WRAPPER_FUNC 46, 184, 368 87 DEFINE_WRAPPER_FUNC 47, 188, 376 88 DEFINE_WRAPPER_FUNC 48, 192, 384 89 DEFINE_WRAPPER_FUNC 49, 196, 392 90 DEFINE_WRAPPER_FUNC 50, 200, 400 91 DEFINE_WRAPPER_FUNC 51, 204, 408 92 DEFINE_WRAPPER_FUNC 52, 208, 416 93 DEFINE_WRAPPER_FUNC 53, 212, 424 94 DEFINE_WRAPPER_FUNC 54, 216, 432 95 DEFINE_WRAPPER_FUNC 55, 220, 440 96 DEFINE_WRAPPER_FUNC 56, 224, 448 97 DEFINE_WRAPPER_FUNC 57, 228, 456 98 DEFINE_WRAPPER_FUNC 58, 232, 464 99 DEFINE_WRAPPER_FUNC 59, 236, 472 100 DEFINE_WRAPPER_FUNC 60, 240, 480 101 DEFINE_WRAPPER_FUNC 61, 244, 488 102 DEFINE_WRAPPER_FUNC 62, 248, 496 103 DEFINE_WRAPPER_FUNC 63, 252, 504 104 DEFINE_WRAPPER_FUNC 64, 256, 512 105 DEFINE_WRAPPER_FUNC 65, 260, 520 106 DEFINE_WRAPPER_FUNC 66, 264, 528 107 DEFINE_WRAPPER_FUNC 67, 268, 536 108 DEFINE_WRAPPER_FUNC 68, 272, 544 109 DEFINE_WRAPPER_FUNC 69, 276, 552 110 DEFINE_WRAPPER_FUNC 70, 280, 560 111 DEFINE_WRAPPER_FUNC 71, 284, 568 112 DEFINE_WRAPPER_FUNC 72, 288, 576 113 DEFINE_WRAPPER_FUNC 73, 292, 584 114 DEFINE_WRAPPER_FUNC 74, 296, 592 115 DEFINE_WRAPPER_FUNC 75, 300, 600 116 DEFINE_WRAPPER_FUNC 76, 304, 608 117 DEFINE_WRAPPER_FUNC 77, 308, 616 118 DEFINE_WRAPPER_FUNC 78, 312, 624 119 DEFINE_WRAPPER_FUNC 79, 316, 632 120 DEFINE_WRAPPER_FUNC 80, 320, 640 121 DEFINE_WRAPPER_FUNC 81, 324, 648 122 DEFINE_WRAPPER_FUNC 82, 328, 656 123 DEFINE_WRAPPER_FUNC 83, 332, 664 124 DEFINE_WRAPPER_FUNC 84, 336, 672 125 DEFINE_WRAPPER_FUNC 85, 340, 680 126 DEFINE_WRAPPER_FUNC 86, 344, 688 127 DEFINE_WRAPPER_FUNC 87, 348, 696 128 DEFINE_WRAPPER_FUNC 88, 352, 704 129 DEFINE_WRAPPER_FUNC 89, 356, 712 130 DEFINE_WRAPPER_FUNC 90, 360, 720 131 DEFINE_WRAPPER_FUNC 91, 364, 728 132 DEFINE_WRAPPER_FUNC 92, 368, 736 133 DEFINE_WRAPPER_FUNC 93, 372, 744 134 DEFINE_WRAPPER_FUNC 94, 376, 752 135 DEFINE_WRAPPER_FUNC 95, 380, 760 136 DEFINE_WRAPPER_FUNC 96, 384, 768 137 DEFINE_WRAPPER_FUNC 97, 388, 776 138 DEFINE_WRAPPER_FUNC 98, 392, 784 139 DEFINE_WRAPPER_FUNC 99, 396, 792 140 141 END 142