LibHac/hactoolnet/ProcessKip.cs

39 lines
1 KiB
C#
Raw Normal View History

2018-09-18 02:18:28 +02:00
using System.IO;
using LibHac;
using LibHac.IO;
2018-09-18 02:18:28 +02:00
namespace hactoolnet
{
internal static class ProcessKip
{
public static void ProcessKip1(Context ctx)
{
using (var file = new FileStream(ctx.Options.InFile, FileMode.Open, FileAccess.Read))
{
var kip = new Kip(file.AsStorage());
2018-10-01 20:07:20 +02:00
kip.OpenRawFile();
2018-09-18 02:18:28 +02:00
}
}
2018-09-18 02:52:22 +02:00
public static void ProcessIni1(Context ctx)
{
using (var file = new FileStream(ctx.Options.InFile, FileMode.Open, FileAccess.Read))
{
var ini1 = new Ini1(file.AsStorage());
2018-09-18 02:52:22 +02:00
string outDir = ctx.Options.OutDir;
if (outDir != null)
{
Directory.CreateDirectory(outDir);
foreach (Kip kip in ini1.Kips)
{
kip.OpenRawFile().WriteAllBytes(Path.Combine(outDir, $"{kip.Header.Name}.kip1"));
}
}
}
}
2018-09-18 02:18:28 +02:00
}
}