[XContent] Aggregate license mask from all licenses while installing package

This should fix issues with some DLCs
This commit is contained in:
Gliniak 2025-01-05 17:59:15 +01:00
parent ad323dd9d8
commit d660a82997
2 changed files with 10 additions and 2 deletions

View File

@ -468,10 +468,12 @@ struct XContentMetadata {
};
static_assert_size(XContentMetadata, 0x93D6);
static constexpr uint8_t license_count = 0x10;
struct XContentHeader {
be<XContentPackageType> magic;
uint8_t signature[0x228];
XContentLicense licenses[0x10];
XContentLicense licenses[license_count];
uint8_t content_id[0x14];
be<uint32_t> header_size;

View File

@ -65,7 +65,13 @@ class XContentContainerDevice : public Device {
kernel::xam::XCONTENT_AGGREGATE_DATA content_header() const;
uint32_t license_mask() const {
return header_->content_header.licenses[0].license_bits;
uint32_t final_license = 0;
for (uint8_t i = 0; i < license_count; i++) {
if (header_->content_header.licenses[i].license_flags) {
final_license |= header_->content_header.licenses[i].license_bits;
}
}
return final_license;
}
protected: