-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathasmhelpers.asm
More file actions
116 lines (74 loc) · 2.09 KB
/
asmhelpers.asm
File metadata and controls
116 lines (74 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
extern EnterStub:proc
extern LeaveStub:proc
extern TailcallStub:proc
_TEXT segment para 'CODE'
;typedef void FunctionEnterNaked(
; rcx = FunctionID funcId,
; rdx = UINT_PTR clientData,
; r8 = COR_PRF_FRAME_INFO func,
; r9 = COR_PRF_FUNCTION_ARGUMENT_INFO *argumentInfo);
align 16
public FunctionEnterNaked
FunctionEnterNaked proc frame
; save registers
push rax
.allocstack 8
push r10
.allocstack 8
push r11
.allocstack 8
sub rsp, 20h
.allocstack 20h
.endprolog
call EnterStub
add rsp, 20h
; restore registers
pop r11
pop r10
pop rax
; return
ret
FunctionEnterNaked endp
;typedef void FunctionLeaveNaked(
; rcx = FunctionID funcId,
; rdx = UINT_PTR clientData,
; r8 = COR_PRF_FRAME_INFO func,
; r9 = COR_PRF_FUNCTION_ARGUMENT_RANGE *retvalRange);
align 16
public FunctionLeaveNaked
FunctionLeaveNaked proc frame
; save integer return register
push rax
.allocstack 8
sub rsp, 20h
.allocstack 20h
.endprolog
call LeaveStub
add rsp, 20h
; restore integer return register
pop rax
; return
ret
FunctionLeaveNaked endp
;typedef void FunctionTailcallNaked(
; rcx = FunctionID funcId,
; rdx = UINT_PTR clientData,
; t8 = COR_PRF_FRAME_INFO,
align 16
public FunctionTailcallNaked
FunctionTailcallNaked proc frame
; save rax
push rax
.allocstack 8
sub rsp, 20h
.allocstack 20h
.endprolog
call TailcallStub
add rsp, 20h
; restore rax
pop rax
; return
ret
FunctionTailcallNaked endp
_TEXT ends
end