//*************************************// //******** created by mamo139 *********// //*** http://mamo139.altervista.org ***// //*************************************// /******************************/ /***** Mozilla Patch **********/ /******************************/ HKEY hKey; DWORD disposition, size, type; char *stringData; //Apertura registro RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\Mozilla\\Mozilla Firefox", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disposition); //lunghezza stringa long result = RegQueryValueEx(hKey, "CurrentVersion", 0, &type, NULL, &size); //controllo errore lunghezza // if (result != ERROR_SUCCESS) MessageBox(NULL, "The value named 'CurrentVersion1' was not found in the registry", // "Problem", MB_OK); // else if (type == REG_SZ) { //Lettura stringa stringData = new char[size]; RegQueryValueEx(hKey, "CurrentVersion",0, &type, (BYTE*)stringData, &size); //MessageBox(NULL, stringData,"What the registry says", MB_OK); //} // else MessageBox(NULL, "The value named 'Message' does not contain string data", "Problem", MB_OK); RegCloseKey(hKey); char mozilla_url[1000] = "Software\\Mozilla\\Mozilla Firefox\\"; strcat(mozilla_url,stringData); strcat(mozilla_url,"\\Main"); //MessageBox(NULL, mozilla_url,"What the registry says", MB_OK); HKEY hKey2; DWORD disposition2, size2, type2; RegCreateKeyEx(HKEY_CURRENT_USER, mozilla_url, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey2, &disposition2); long result2 = RegQueryValueEx(hKey2, "PathToExe", 0, &type2, NULL, &size2); char *mozexe_url; mozexe_url = new char[size2]; RegQueryValueEx(hKey2, "PathToExe",0, &type2, (BYTE*)mozexe_url, &size2); MessageBox(NULL, mozexe_url,"What the registry says", MB_OK); RegCloseKey(hKey2); //mozilla patch è mozexe_url /******************************/