Added extra security for detecting fumen files
Making sure the file ends with .bin to avoid false positives
This commit is contained in:
parent
2cf94175c5
commit
87b6044e53
@ -149,6 +149,12 @@ EncryptFile (const std::string &input_file, const std::string &hex_key) {
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
IsFumenEncrypted (const std::string &filename) {
|
IsFumenEncrypted (const std::string &filename) {
|
||||||
|
// Check if the filename ends with ".bin"
|
||||||
|
if (filename.size() < 4 || filename.substr(filename.size() - 4) != ".bin") {
|
||||||
|
std::cout << "Not a Fumen file: " << filename << std::endl;
|
||||||
|
return true; // If it doesn't we return early, as the file we're seeing isn't a fumen !
|
||||||
|
}
|
||||||
|
|
||||||
std::ifstream file(filename, std::ios::binary);
|
std::ifstream file(filename, std::ios::binary);
|
||||||
file.seekg (0x214, std::ios::beg);
|
file.seekg (0x214, std::ios::beg);
|
||||||
std::vector<unsigned char> buffer (24);
|
std::vector<unsigned char> buffer (24);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user