美文网首页
Windows的GS机制

Windows的GS机制

作者: doinb1517 | 来源:发表于2023-08-02 16:42 被阅读0次

vs中设置开启GS检查,类似于Linux中的canary


Untitled.png

1、security_cookie来自.data段的前四个字节


Untitled 1.png

2、和EBP异或实现随机性


Untitled 2.png

3、检查前也异或,放在ecx中,比较ecx和security_cookie的值


Untitled 3.png Untitled 4.png

实验程序

#include <stdio.h>
#include <string.h>

int main()
{
 const char src[50] = "windows GS";
 char dest[50];

 memcpy(dest, src, strlen(src) + 1);
 printf("dest = %s\n", dest);

 return(0);
}

相关文章

网友评论

      本文标题:Windows的GS机制

      本文链接:https://www.haomeiwen.com/subject/zpjppdtx.html