Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::string RandomString(int len)
- {
- srand(time(0));
- std::string THD = "";
- std::string Zexe = ".exe";
- std::string str = "0a1b2c3d4e5f6g7h8i9jAkBlCmDnEoFpGqHrIsJtKuLvMwNzOyPzQ1R4S7T8U5V2W3X6Y9Z80";
- std::string Omg = (str + Zexe);
- int pos;
- while (str.size() != len) {
- pos = ((rand() % (str.size() - 1)));
- str.erase(pos, 1);
- }
- return THD + str + Zexe;
- }
- int APIENTRY wWinMain( HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPWSTR /*lpCmdLine*/, int /*nCmdShow*/ )
- {
- wchar_t wtext[MAX_PATH];
- mbstowcs(wtext, RandomString(10).c_str(), strlen(RandomString(10).c_str()) + 1);
- LPWSTR mycstr = wtext;
- TCHAR szExeFileName[MAX_PATH];
- GetModuleFileName(NULL, szExeFileName, MAX_PATH);
- char c_szText[MAX_PATH];
- wcstombs(c_szText, szExeFileName, wcslen(szExeFileName) + 1);
- int result;
- result = rename(c_szText, RandomString(10).c_str());
- if (result == 0)
- perror("Error deleting file");
- else
- puts("File successfully deleted");
- // Setup dump generation
- dump::DumpHandler::Instance().CreateWatchdog( blackbone::Utils::GetExeDirectory(), dump::CreateFullDump, &DumpNotifier );
- AssociateExtension();
- std::wstring param;
- auto action = ParseCmdLine( param );
- MainDlg mainDlg( action, param );
- LogOSInfo();
- if (action != MainDlg::RunProfile)
- return (int)mainDlg.RunModeless( NULL, IDR_ACCELERATOR1 );
- else
- return mainDlg.LoadAndInject();
- Sleep(500);
- if (remove(RandomString(10).c_str()) != 0)
- DeleteFile(mycstr);
- Sleep(500);
- return(remove(RandomString(10).c_str()) != 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement