vs中设置开启GS检查,类似于Linux中的canary
1、security_cookie来自.data段的前四个字节
2、和EBP异或实现随机性
3、检查前也异或,放在ecx中,比较ecx和security_cookie的值
实验程序
#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);
}