Adds check for pkg signature in QT part

This commit is contained in:
RipleyTom 2017-07-30 11:22:45 +02:00 committed by Ivan
parent 474bd7beaf
commit a38182b967
1 changed files with 10 additions and 0 deletions

View File

@ -346,6 +346,16 @@ void main_window::InstallPkg(const QString& dropPath)
return;
}
//Check header
u32 pkg_signature;
pkg_f.seek(0);
pkg_f.read(pkg_signature);
if (pkg_signature != "\x7FPKG"_u32)
{
LOG_ERROR(LOADER, "PKG: %s is not a pkg file", fileName);
return;
}
// Get title ID
std::vector<char> title_id(9);
pkg_f.seek(55);