小编Inv*_*tic的帖子

Windows驱动程序中的__security_init_cookie导致错误检查KERNEL_SECURITY_CHECK_FAILURE

当我编译驱动程序时,当我以Windows 8.1为目标时,会发生一些非常奇怪的事情.

一旦加载,它就会与bugcheck崩溃KERNEL_SECURITY_CHECK_FAILURE,第一个参数6,意思是" The stack cookie security cookie was not properly initialized by the loader".

这可能是由于构建驱动程序仅在Windows 8上运行并尝试在早期版本的Windows上加载驱动程序映像引起的.要避免此问题,您必须构建驱动程序以在早期版本的Windows上运行". 当我以Windows 7为目标时,不会发生此错误.

我能够找到这个错误发生的确切位置.它发生在__security_init_cookie被调用的函数中GsDriverEntry.

INIT:000000014000C1B4 __security_init_cookie proc near        ; CODE XREF: GsDriverEntry+10p
INIT:000000014000C1B4                 mov     rax, cs:__security_cookie
INIT:000000014000C1BB                 test    rax, rax
INIT:000000014000C1BE                 jz      short loc_14000C1DA
INIT:000000014000C1C0                 mov     rcx, 2B992DDFA232h
INIT:000000014000C1CA                 cmp     rax, rcx
INIT:000000014000C1CD                 jz      short loc_14000C1DA
INIT:000000014000C1CF                 not     rax
INIT:000000014000C1D2                 mov     cs:__security_cookie_complement, rax
INIT:000000014000C1D9                 retn
INIT:000000014000C1DA ; ---------------------------------------------------------------------------
INIT:000000014000C1DA
INIT:000000014000C1DA loc_14000C1DA:                          ; CODE XREF: __security_init_cookie+Aj
INIT:000000014000C1DA                                         ; …
Run Code Online (Sandbox Code Playgroud)

windows driver wdk

7
推荐指数
1
解决办法
1953
查看次数

标签 统计

driver ×1

wdk ×1

windows ×1