From 6aa15c069149a5da6e345127e80a669091c18964 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Mon, 6 May 2019 21:42:53 -0500 Subject: [PATCH] Match FS behavior when checking if an NCA section exists --- src/LibHac/IO/NcaUtils/NcaHeader.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LibHac/IO/NcaUtils/NcaHeader.cs b/src/LibHac/IO/NcaUtils/NcaHeader.cs index 469b670b..96a9841f 100644 --- a/src/LibHac/IO/NcaUtils/NcaHeader.cs +++ b/src/LibHac/IO/NcaUtils/NcaHeader.cs @@ -128,7 +128,11 @@ namespace LibHac.IO.NcaUtils public bool IsSectionEnabled(int index) { - return GetSectionEntry(index).IsEnabled; + ref NcaSectionEntryStruct info = ref GetSectionEntry(index); + + int sectStart = info.StartBlock; + int sectSize = info.EndBlock - sectStart; + return sectStart != 0 || sectSize != 0; } public Span GetFsHeaderHash(int index)