mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
3d50085e22
*Create an IStorage interface and Storage abstract class to use instead of Stream * Improve AES-XTS performance by ~16x * Double AES-CTR performance: 800 MB/s -> 1600 MB/s on a 6700K * Add AES-XTS tests * Add AES benchmark and AES-CTR writing * Add support for a hashed FAT in save files * Add option to export decrypted NCA * Allow opening decrypted package1 and package2 * Make sure romfs disposal can cascade all the way down * Validate NCA, NPDM and package2 signatures
38 lines
1 KiB
C#
38 lines
1 KiB
C#
using System.IO;
|
|
using LibHac;
|
|
using LibHac.IO;
|
|
|
|
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());
|
|
kip.OpenRawFile();
|
|
}
|
|
}
|
|
|
|
public static void ProcessIni1(Context ctx)
|
|
{
|
|
using (var file = new FileStream(ctx.Options.InFile, FileMode.Open, FileAccess.Read))
|
|
{
|
|
var ini1 = new Ini1(file.AsStorage());
|
|
|
|
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"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|