mirror of
https://github.com/mrpond/BlockTheSpot.git
synced 2025-05-10 18:06:39 +02:00
parent
84bfd1953a
commit
6efc131765
4 changed files with 25 additions and 26 deletions
36
install.ps1
36
install.ps1
|
@ -264,25 +264,25 @@ Write-Host 'Patching Spotify...'
|
|||
$patchFiles = (Join-Path -Path $PWD -ChildPath 'dpapi.dll'), (Join-Path -Path $PWD -ChildPath 'config.ini')
|
||||
|
||||
Copy-Item -LiteralPath $patchFiles -Destination "$spotifyDirectory"
|
||||
Remove-Item -LiteralPath (Join-Path -Path $spotifyDirectory -ChildPath 'blockthespot_settings.json') -Force -ErrorAction SilentlyContinue # temporary
|
||||
Remove-Item -LiteralPath (Join-Path -Path $spotifyDirectory -ChildPath 'blockthespot_settings.json') -Force -ErrorAction SilentlyContinue
|
||||
|
||||
function Install-VcRedist {
|
||||
$architecture = if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" }
|
||||
# https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170
|
||||
$vcRedistUrl = "https://aka.ms/vs/17/release/vc_redist.$($architecture).exe"
|
||||
$registryPath = "HKLM:\Software\Microsoft\VisualStudio\14.0\VC\Runtimes\$architecture"
|
||||
$installedVersion = [version]((Get-ItemProperty $registryPath -ErrorAction SilentlyContinue).Version).Substring(1)
|
||||
$latestVersion = [version]"14.40.33810.0"
|
||||
|
||||
if ($installedVersion -lt $latestVersion) {
|
||||
$vcRedistFile = Join-Path -Path $PWD -ChildPath "vc_redist.$architecture.exe"
|
||||
Write-Host "Downloading and installing vc_redist.$architecture.exe..."
|
||||
Invoke-WebRequest -Uri $vcRedistUrl -OutFile $vcRedistFile
|
||||
Start-Process -FilePath $vcRedistFile -ArgumentList "/install /quiet /norestart" -Wait
|
||||
}
|
||||
}
|
||||
|
||||
Install-VcRedist
|
||||
# function Install-VcRedist {
|
||||
# $architecture = if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" }
|
||||
# # https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170
|
||||
# $vcRedistUrl = "https://aka.ms/vs/17/release/vc_redist.$($architecture).exe"
|
||||
# $registryPath = "HKLM:\Software\Microsoft\VisualStudio\14.0\VC\Runtimes\$architecture"
|
||||
# $installedVersion = [version]((Get-ItemProperty $registryPath -ErrorAction SilentlyContinue).Version).Substring(1)
|
||||
# $latestVersion = [version]"14.40.33810.0"
|
||||
#
|
||||
# if ($installedVersion -lt $latestVersion) {
|
||||
# $vcRedistFile = Join-Path -Path $PWD -ChildPath "vc_redist.$architecture.exe"
|
||||
# Write-Host "Downloading and installing vc_redist.$architecture.exe..."
|
||||
# Get-File -Uri $vcRedistUrl -TargetFile $vcRedistFile
|
||||
# Start-Process -FilePath $vcRedistFile -ArgumentList "/install /quiet /norestart" -Wait
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# Install-VcRedist
|
||||
|
||||
$tempDirectory = $PWD
|
||||
Pop-Location
|
||||
|
|
|
@ -12,7 +12,7 @@ LPVOID __stdcall LoadAPI(const char* api_name)
|
|||
if (!hModule) {
|
||||
hModule = LoadLibraryW(path.c_str());
|
||||
if (!hModule) {
|
||||
PrintError(L"Failed to load library: {}", path);
|
||||
LogError(L"Failed to load library: {}", path);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ LPVOID __stdcall LoadAPI(const char* api_name)
|
|||
if (function_map.find(api_name) == function_map.end()) {
|
||||
FARPROC proc = GetProcAddress(hModule, api_name);
|
||||
if (!proc) {
|
||||
PrintError(L"Failed to get address of function: {}", api_name);
|
||||
LogError(L"Failed to get address of function: {}", Utils::ToString(api_name));
|
||||
return nullptr;
|
||||
}
|
||||
function_map[api_name] = proc;
|
||||
|
|
|
@ -70,6 +70,7 @@
|
|||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
|
|
@ -10,17 +10,15 @@ DWORD WINAPI Debug(LPVOID lpParam)
|
|||
const auto cef_zip_reader_t_read_file = offsetof(cef_zip_reader_t, read_file);
|
||||
|
||||
if (cef_request_t_get_url != SettingsManager::m_cef_request_t_get_url_offset) {
|
||||
PrintError(L"The offset of cef_request_t::get_url has changed: {}", cef_request_t_get_url);
|
||||
LogError(L"The offset of cef_request_t::get_url has changed: {}", cef_request_t_get_url);
|
||||
}
|
||||
if (cef_zip_reader_t_get_file_name != SettingsManager::m_cef_zip_reader_t_get_file_name_offset) {
|
||||
PrintError(L"The offset of cef_zip_reader_t::get_file_name has changed: {}", cef_zip_reader_t_get_file_name);
|
||||
LogError(L"The offset of cef_zip_reader_t::get_file_name has changed: {}", cef_zip_reader_t_get_file_name);
|
||||
}
|
||||
if (cef_zip_reader_t_read_file != SettingsManager::m_cef_zip_reader_t_read_file_offset) {
|
||||
PrintError(L"The offset of cef_zip_reader_t::read_file has changed: {}", cef_zip_reader_t_read_file);
|
||||
LogError(L"The offset of cef_zip_reader_t::read_file has changed: {}", cef_zip_reader_t_read_file);
|
||||
}
|
||||
|
||||
// Utils::PrintSymbols(L"chrome_elf.dll");
|
||||
|
||||
Utils::MeasureExecutionTime([&]() {
|
||||
|
||||
//for (const auto& pattern : MemoryScanner::ParseBytePattern((L"4? ?D 1?"))) {
|
||||
|
@ -41,7 +39,7 @@ DWORD WINAPI Debug(LPVOID lpParam)
|
|||
});
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
PrintError(L"{}", e.what());
|
||||
LogError(Utils::ToString(e.what()));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue