From 5717c385771c108c1d14613d1ebbeaee7eb88e56 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 10 Mar 2013 18:03:23 +0200 Subject: [PATCH] Tweaks --- SkinInstaller/DialogInstall.cpp | 52 --------------------------------- SkinInstaller/DialogInstall.h | 2 -- 2 files changed, 54 deletions(-) diff --git a/SkinInstaller/DialogInstall.cpp b/SkinInstaller/DialogInstall.cpp index 392bec4d..2403c835 100644 --- a/SkinInstaller/DialogInstall.cpp +++ b/SkinInstaller/DialogInstall.cpp @@ -660,12 +660,6 @@ bool CDialogInstall::ReadOptions(const WCHAR* file) bool CDialogInstall::InstallPackage() { - if (IsPackageBlacklisted()) - { - m_ErrorMessage = L"This package has been identified as malware by the Rainmeter Team and will not be installed."; - return false; - } - if ((!m_MergeSkins && m_BackupSkins) || m_BackupPackage) { // Move skins into backup folder @@ -957,52 +951,6 @@ UINT __stdcall CDialogInstall::InstallThread(void* pParam) return 0; } -bool CDialogInstall::IsPackageBlacklisted() -{ - std::string fileName = ConvertToAscii(PathFindFileName(m_PackageFileName.c_str())); - const char* fileNameSz = fileName.c_str(); - - const char* regex = "(?siU)^.*_by_([0-9A-Za-z\\-]+)-d[0-9a-z]{6}\\.rmskin$"; - const char* error; - int errorOffset; - pcre* re = pcre_compile(regex, PCRE_UTF8, &error, &errorOffset, NULL); - - int offsets[6]; - bool match = pcre_exec(re, NULL, fileNameSz, fileName.length(), 0, 0, offsets, _countof(offsets)) == 2; - pcre_free(re); - if (!match) - { - return false; - } - - bool isBlacklisted = false; - - // Author is the 2nd substring - std::string author(fileNameSz + offsets[2], offsets[3] - offsets[2]); - std::wstring url = L"http://blacklist.rainmeter.googlecode.com/git/user/" + ConvertToWide(author.c_str()); - - HINTERNET internet = InternetOpen(L"Mozilla/5.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); - if (internet) - { - DWORD openFlags = INTERNET_FLAG_NO_COOKIES | INTERNET_FLAG_NO_UI; - HINTERNET internetUrl = InternetOpenUrl(internet, url.c_str(), NULL, 0, openFlags, 0); - if (internetUrl) - { - DWORD queryFlags = HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER; - DWORD statusCode; - DWORD size = sizeof(DWORD); - BOOL query = HttpQueryInfo(internetUrl, queryFlags, &statusCode, &size, NULL); - InternetCloseHandle(internetUrl); - - isBlacklisted = query && statusCode == HTTP_STATUS_OK; - } - - InternetCloseHandle(internet); - } - - return isBlacklisted; -} - void CDialogInstall::KeepVariables() { WCHAR keyname[32767]; // Max size returned by GetPrivateProfileSection diff --git a/SkinInstaller/DialogInstall.h b/SkinInstaller/DialogInstall.h index 869a5273..c03286fa 100644 --- a/SkinInstaller/DialogInstall.h +++ b/SkinInstaller/DialogInstall.h @@ -85,8 +85,6 @@ private: static UINT __stdcall InstallThread(void* pParam); bool ExtractCurrentFile(const std::wstring& fileName); - bool IsPackageBlacklisted(); - void LaunchRainmeter(); void KeepVariables();