[SNIPPET] Obtener ruta del navegador por defecto

Iniciado por Karcrack, Junio 16, 2013, 06:31:47 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Código: cpp
PWCHAR GetDefaultBrowserPathW(){
    #define ASSOCSTR_EXECUTABLE 2
    typedef HRESULT (*AQSW)(DWORD, DWORD, LPCWSTR, LPCWSTR, LPWSTR, DWORD*);
    DWORD cchPath = MAX_PATH*2;
    PWCHAR szPath = (PWCHAR)LocalAlloc(LPTR, cchPath);

    ((AQSW)GetProcAddress(LoadLibraryW(L"shlwapi"), "AssocQueryStringW"))(0, ASSOCSTR_EXECUTABLE, L"http", L"open", szPath, &cchPath);

    return szPath;
}

void main(){
    PWCHAR  sPath   = GetDefaultBrowserPathW();
    MessageBoxW(0, sPath, NULL, 0);
    LocalFree(sPath);
    ExitProcess(0);
}


Saludos :)
I code for $$$.

(PGP ID 0xCC050E77)
ASM, C, C++, VB6... skilled [malware] developer