查看文章
 
出现“unresolved external symbol @__security_check_cookie@4”的解决方法
2009年12月05日 星期六 8:40

有以下两种解决办法:

1、包含 “ bufferoverflowK.lib ”

2、现在最新的ddk都不提供GsDriverEntry这个函数么?
没有就自己实现一个DsDriverEntry吧

ULONG ___security_cookie = 0xbb40;
ULONG ___security_cookie_complement = 0xFFFF44BF;

NTSTATUS GsDriverEntry(IN PDRIVER_OBJECT DriverObject,PUNICODE_STRING RegPath)
{
LARGE_INTEGER tickCount;
KeQueryTickCount(&tickCount);
if(!___security_cookie || ___security_cookie == 0xbb40)
{
ULONG temp = (ULONG)&___security_cookie;
temp = ((temp >> 8) ^ tickCount.u.LowPart) & 0xffff;
if(temp)
___security_cookie = temp;
else
___security_cookie = tickCount.u.LowPart & 0xffff;
}

___security_cookie_complement = ~___security_cookie;
return DriverEntry(DriverObject,RegPath);
}

void __fastcall __security_check_cookie(ULONG cookie)
{
if(cookie != ___security_cookie || cookie & 0xffff0000)
KeBugCheckEx(0x7f,cookie,___security_cookie,___security_cookie_complement,0);
}

这是微软实现的代码...有了这个就可以放心打开gs编译选项了
当然你需要把入口点改成GsDriverEntry


类别:驱动开发||添加到搜藏 |分享到i贴吧|浏览(1603)|评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
     

   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu