Option to export raw RomFS from XCI

This commit is contained in:
Alex Barney 2018-08-22 09:58:36 -05:00
parent 8032d3d46a
commit 7b0ae0c954
2 changed files with 12 additions and 3 deletions

View file

@ -156,6 +156,7 @@ namespace hactoolnet
sb.AppendLine(" --section1dir <dir> Specify Section 1 directory path.");
sb.AppendLine(" --section2dir <dir> Specify Section 2 directory path.");
sb.AppendLine(" --section3dir <dir> Specify Section 3 directory path.");
sb.AppendLine(" --romfsdir <dir> Specify main RomFS directory path.");
sb.AppendLine(" --listromfs List files in RomFS.");
sb.AppendLine(" --basenca Set Base NCA to use with update partitions.");
sb.AppendLine("XCI options:");

View file

@ -249,7 +249,7 @@ namespace hactoolnet
}
}
if (ctx.Options.RomfsOutDir != null)
if (ctx.Options.RomfsOutDir != null || ctx.Options.RomfsOut != null)
{
if (xci.SecurePartition == null)
{
@ -284,9 +284,17 @@ namespace hactoolnet
return;
}
if (ctx.Options.RomfsOutDir != null)
{
var romfs = new Romfs(mainNca.OpenSection(romfsSection.SectionNum, false));
romfs.Extract(ctx.Options.RomfsOutDir, ctx.Logger);
}
if (ctx.Options.RomfsOut != null)
{
mainNca.ExportSection(romfsSection.SectionNum, ctx.Options.RomfsOut, ctx.Options.Raw, ctx.Logger);
}
}
}
}