| 1 |
include ksamd64.inc |
| 2 |
|
| 3 |
text SEGMENT EXECUTE |
| 4 |
|
| 5 |
public __chkstk |
| 6 |
|
| 7 |
__chkstk: |
| 8 |
sub rsp,010h |
| 9 |
mov QWORD PTR [rsp],r10 |
| 10 |
mov QWORD PTR [rsp+08h],r11 |
| 11 |
xor r11,r11 |
| 12 |
lea r10,[rsp+018h] |
| 13 |
sub r10,rax |
| 14 |
cmovb r10,r11 |
| 15 |
mov r11,QWORD PTR gs:[TeStackLimit] |
| 16 |
cmp r10,r11 |
| 17 |
jae chkstk_finish |
| 18 |
and r10w,0f000h |
| 19 |
chkstk_loop: |
| 20 |
lea r11,[r11-PAGE_SIZE] |
| 21 |
mov BYTE PTR [r11],0h |
| 22 |
cmp r10,r11 |
| 23 |
jne chkstk_loop |
| 24 |
chkstk_finish: |
| 25 |
mov r10,QWORD PTR [rsp] |
| 26 |
mov r11,QWORD PTR [rsp+08h] |
| 27 |
add rsp,010h |
| 28 |
ret |
| 29 |
end |