mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 11:03:00 +00:00
[UCRT:VCRUNTIME] Implement __security_init_cookie and __security_check_cookie
This commit is contained in:
parent
055875fbd8
commit
5dcd1d1714
5 changed files with 157 additions and 0 deletions
27
sdk/lib/ucrt/vcruntime/amd64/__security_check_cookie.s
Normal file
27
sdk/lib/ucrt/vcruntime/amd64/__security_check_cookie.s
Normal file
|
@ -0,0 +1,27 @@
|
|||
//
|
||||
// __security_check_cookie.asm
|
||||
//
|
||||
// Copyright (c) 2024 Timo Kreuzer
|
||||
//
|
||||
// Implementation of __security_check_cookie for x64.
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
|
||||
#include <asm.inc>
|
||||
|
||||
EXTERN __security_cookie:QWORD
|
||||
EXTERN __report_gsfailure:PROC
|
||||
|
||||
.code64
|
||||
|
||||
// This function must not clobber any registers!
|
||||
PUBLIC __security_check_cookie
|
||||
__security_check_cookie:
|
||||
cmp rcx, qword ptr __security_cookie[rip]
|
||||
jne __security_check_cookie_fail
|
||||
ret
|
||||
__security_check_cookie_fail:
|
||||
jmp __report_gsfailure
|
||||
|
||||
END
|
Loading…
Add table
Add a link
Reference in a new issue