[nx] Add hasRightsId() to NcaHeader

This commit is contained in:
jakcron 2018-05-01 13:17:25 +08:00
parent bf1273e5ba
commit 3cbcba2bde
2 changed files with 14 additions and 0 deletions

View file

@ -83,6 +83,7 @@ namespace nx
void setContentIndex(uint32_t index); void setContentIndex(uint32_t index);
uint32_t getSdkAddonVersion() const; uint32_t getSdkAddonVersion() const;
void setSdkAddonVersion(uint32_t version); void setSdkAddonVersion(uint32_t version);
bool hasRightsId() const;
const byte_t* getRightsId() const; const byte_t* getRightsId() const;
void setRightsId(const byte_t* rights_id); void setRightsId(const byte_t* rights_id);
const fnd::List<sPartition>& getPartitions() const; const fnd::List<sPartition>& getPartitions() const;

View file

@ -219,6 +219,19 @@ void nx::NcaHeader::setSdkAddonVersion(uint32_t version)
mSdkAddonVersion = version; mSdkAddonVersion = version;
} }
bool nx::NcaHeader::hasRightsId() const
{
bool rightsIdIsSet = false;
for (size_t i = 0; i < nca::kRightsIdLen; i++)
{
if (mRightsId[i] != 0)
rightsIdIsSet = true;
}
return rightsIdIsSet;
}
const byte_t* nx::NcaHeader::getRightsId() const const byte_t* nx::NcaHeader::getRightsId() const
{ {
return mRightsId; return mRightsId;