Advertisement
allen343434

Untitled

Jun 9th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. std::string RandomString(int len)
  2. {
  3. srand(time(0));
  4. std::string THD = "";
  5. std::string Zexe = ".exe";
  6. std::string str = "0a1b2c3d4e5f6g7h8i9jAkBlCmDnEoFpGqHrIsJtKuLvMwNzOyPzQ1R4S7T8U5V2W3X6Y9Z80";
  7. std::string Omg = (str + Zexe);
  8. int pos;
  9. while (str.size() != len) {
  10. pos = ((rand() % (str.size() - 1)));
  11. str.erase(pos, 1);
  12. }
  13. return THD + str + Zexe;
  14. }
  15.  
  16. int APIENTRY wWinMain( HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPWSTR /*lpCmdLine*/, int /*nCmdShow*/ )
  17. {
  18. wchar_t wtext[MAX_PATH];
  19. mbstowcs(wtext, RandomString(10).c_str(), strlen(RandomString(10).c_str()) + 1);
  20. LPWSTR mycstr = wtext;
  21.  
  22. TCHAR szExeFileName[MAX_PATH];
  23. GetModuleFileName(NULL, szExeFileName, MAX_PATH);
  24.  
  25. char c_szText[MAX_PATH];
  26. wcstombs(c_szText, szExeFileName, wcslen(szExeFileName) + 1);
  27.  
  28. int result;
  29. result = rename(c_szText, RandomString(10).c_str());
  30.  
  31. if (result == 0)
  32. perror("Error deleting file");
  33. else
  34. puts("File successfully deleted");
  35.  
  36. // Setup dump generation
  37. dump::DumpHandler::Instance().CreateWatchdog( blackbone::Utils::GetExeDirectory(), dump::CreateFullDump, &DumpNotifier );
  38. AssociateExtension();
  39.  
  40. std::wstring param;
  41. auto action = ParseCmdLine( param );
  42. MainDlg mainDlg( action, param );
  43. LogOSInfo();
  44.  
  45. if (action != MainDlg::RunProfile)
  46. return (int)mainDlg.RunModeless( NULL, IDR_ACCELERATOR1 );
  47. else
  48. return mainDlg.LoadAndInject();
  49.  
  50. Sleep(500);
  51. if (remove(RandomString(10).c_str()) != 0)
  52. DeleteFile(mycstr);
  53. Sleep(500);
  54. return(remove(RandomString(10).c_str()) != 0);
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement