Skip to content

Commit

Permalink
[ctrtool] support more prototype CXIs
Browse files Browse the repository at this point in the history
SDK 0.10-era CXIs specify the full exheader size of 0x800 in the NCCH header, so allow that.
  • Loading branch information
Wack0 committed Dec 23, 2024
1 parent 6337c49 commit 7fc7e8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ctrtool/src/NcchProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ void ctrtool::NcchProcess::importHeader()

}


if (mHeader.header.exhdr_size.unwrap() != 0 && mHeader.header.exhdr_size.unwrap() != sizeof(ntd::n3ds::ExtendedHeader))
bool is_proto_exhdr_size = mHeader.header.format_version.unwrap() == ntd::n3ds::NcchCommonHeader::FormatVersion_CXI_PROTOTYPE && mHeader.header.exhdr_size.unwrap() == (sizeof(ntd::n3ds::ExtendedHeader) + sizeof(ntd::n3ds::AccessDescriptor));
if (mHeader.header.exhdr_size.unwrap() != 0 && mHeader.header.exhdr_size.unwrap() != sizeof(ntd::n3ds::ExtendedHeader) && !is_proto_exhdr_size)
{
throw tc::InvalidOperationException(mModuleLabel, fmt::format("NcchHeader has invalid ExHeader size. (0x{:02x})", mHeader.header.exhdr_size.unwrap()));
}
Expand Down

0 comments on commit 7fc7e8d

Please sign in to comment.