[llvm-dev] I am trying to implement a c runtime in rust for msvc/windows.

83 views
Skip to first unread message

罗勇刚(Yonggang Luo) via llvm-dev

unread,
Oct 10, 2020, 3:21:56 PM10/10/20
to LLVM Dev
But I don't know how to implement
__GSHandlerCheck
__security_check_cookie
__security_cookie

when using msvc to compiling debug code.

Who knows how to implement these three functions or possible alternatives.

--
         此致

罗勇刚
Yours
    sincerely,
Yonggang Luo

Gleb Popov via llvm-dev

unread,
Oct 10, 2020, 3:45:00 PM10/10/20
to luoyo...@gmail.com, LLVM Dev
On Sat, Oct 10, 2020 at 11:21 PM 罗勇刚(Yonggang Luo) via llvm-dev <llvm...@lists.llvm.org> wrote:
But I don't know how to implement
__GSHandlerCheck
__security_check_cookie
__security_cookie

when using msvc to compiling debug code.

Who knows how to implement these three functions or possible alternatives.

How fortunately I've been passing by and stumbled upon this thread. Here is my implementation:

uintptr_t __security_cookie = 0xAABBCCDD;

void __fastcall __security_check_cookie(uintptr_t cookie)
{
    if (cookie != __security_cookie)
        __debugbreak();
}

Reid Kleckner via llvm-dev

unread,
Oct 12, 2020, 1:27:31 PM10/12/20
to Yonggang Luo, LLVM Dev
I think MSVC implements most of these in assembly. I'm not sure they all conform to any standard calling convention.

_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply all
Reply to author
Forward
0 new messages