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);
}
网友评论