[nx] NcaHeader signature bytes validation change.

This commit is contained in:
jakcron 2018-04-21 17:27:29 +08:00
parent 02514cf72b
commit c02c5650c0

View file

@ -74,11 +74,12 @@ void NcaHeader::importBinary(const byte_t * bytes, size_t len)
sNcaHeader* hdr = (sNcaHeader*)mBinaryBlob.getBytes();
if (memcmp(hdr->signature, nca::kNca2Sig.c_str(), 4) == 0)
std::string sig = std::string(hdr->signature, 4);
if (sig == nca::kNca2Sig)
{
mFormatVersion = NCA2_FORMAT;
}
else if (memcmp(hdr->signature, nca::kNca3Sig.c_str(), 4) == 0)
else if (sig == nca::kNca3Sig)
{
mFormatVersion = NCA3_FORMAT;
}