Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //virus.cpp
- #include <windows.h>
- //#include <string>
- int main(int argc, char *argv[]){
- HKEY hkey;
- char szBuf[] = "C:\\Windows\\notepad.exe";
- RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\Currentversion\\Run", 0, KEY_SET_VALUE, &hkey);
- RegSetValueEx (hkey, "notepad.exe", 0, REG_SZ, (LPBYTE) szBuf, strlen(szBuf) + 1);
- RegCloseKey(hkey);
- MessageBox(NULL,"Notepad added to startup...","Info",MB_OK);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement