Advertisement
Peaser

wow why would you do this

Sep 28th, 2015
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <windows.h>
  2. #include <string>
  3. std::string convert(LPCSTR str) {
  4.   return std::string(str);
  5. }
  6. int main(int argc,char** argv) {
  7.   int i = 0;
  8.   for (;;) {
  9.     STARTUPINFO si = {};
  10.     PROCESS_INFORMATION pi = {};
  11.     std::string fname = convert(argv[0]);
  12.     std::string extension(".exe");
  13.     LPSTR s = const_cast<char *>((fname+extension).c_str());
  14.     MessageBox(HWND_DESKTOP,"Lmao","Ayy",MB_OK);
  15.     CreateProcess(s, 0, 0, FALSE, 0, 0, 0, 0, &si, &pi);
  16.   }
  17.   return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement