From 8545596781705db211a0969dc2c757395d34304a Mon Sep 17 00:00:00 2001 From: _ <🐱> Date: Sun, 29 Nov 2020 00:47:11 -0700 Subject: [PATCH] Removal of old code and add size check to a condition; minor README edit --- README.md | 2 +- SpotifyKeyDumper/Utils.cpp | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 06f18b0..c0071ba 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Crossed out items support key dumping but not automatic downloading ## Using 1. Make sure `SpotifyKeyDumperInjector.exe` and `SpotifyKeyDumper.dll` are located in the same folder as Spotify (`Spotify.exe`). -2. Start SpotifyKeyDumperInjector either before or after launching Spotify. +2. Start SpotifyKeyDumperInjector before launching Spotify. ## Building This project uses C++14 on Visual Studio 2019 diff --git a/SpotifyKeyDumper/Utils.cpp b/SpotifyKeyDumper/Utils.cpp index f78927c..9a4879e 100644 --- a/SpotifyKeyDumper/Utils.cpp +++ b/SpotifyKeyDumper/Utils.cpp @@ -87,14 +87,6 @@ std::string Utils::HexString(BYTE* data, int len) return ss.str(); } -bool IsEqualIgnoreCase(const std::string& stringOne, const std::string& stringTwo) -{ - return std::equal(stringOne.begin(), stringOne.end(), stringTwo.begin(), [](char a, char b) - { - return tolower(a) == tolower(b); - }); -} - std::wstring Utils::FixPathStr(std::wstring str) { // No forbidden characters @@ -160,7 +152,7 @@ void Utils::DownloadSong(std::string fileId, std::string trackUri, std::string k // Download encrypted song data from Spotify std::string songStr = DownloadSpotifyUrl(songHost, songPath, ""); - if (songStr.substr(0, 6).compare("") == 0) + if (songStr.length() > 6 && songStr.substr(0, 6).compare("") == 0) { std::cout << "Error: " + songStr << std::endl; return;