forked from Thealexbarney/LibHac
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f6836c
commit 8232ff7
Showing
5 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.IO; | ||
using System.Text.Json; | ||
using LibHac.FsSystem; | ||
using LibHac.Tools.FsSystem; | ||
using LibHac.Tools.Npdm; | ||
|
||
namespace hactoolnet; | ||
|
||
internal static class ProcessNpdm | ||
{ | ||
public static void Process(Context ctx) | ||
{ | ||
using (var file = new LocalStorage(ctx.Options.InFile, FileAccess.Read)) | ||
{ | ||
var npdm = new NpdmBinary(file.AsStream(), ctx.KeySet); | ||
|
||
if(ctx.Options.JsonFile != null) | ||
{ | ||
string json = JsonSerializer.Serialize(npdm, new JsonSerializerOptions | ||
{ | ||
WriteIndented = true | ||
}); | ||
File.WriteAllText(ctx.Options.JsonFile, json); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters