Skip to content

Commit

Permalink
More printing
Browse files Browse the repository at this point in the history
  • Loading branch information
ToaHartor committed May 19, 2022
1 parent ffac00d commit 0159c41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/FileTypes/USM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public USM(string filename, byte[] key1, byte[] key2)
_filename = Path.GetFileName(filename);
_key1 = key1;
_key2 = key2;
Console.WriteLine($"key1={Convert.ToHexString(_key1)} key2={Convert.ToHexString(_key2)}");
InitMask(key1, key2);
}
private void InitMask(byte[] key1, byte[] key2)
Expand Down
13 changes: 5 additions & 8 deletions src/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.CommandLine;
using System.CommandLine;
using CRIDemuxer.FileTypes;

namespace CRIDemuxer
Expand Down Expand Up @@ -38,7 +33,7 @@ private static async Task<int> Main(string[] args)
name: "-b",
description: "4 higher bytes of the key");

var rootCommand = new RootCommand("Sample app for System.CommandLine");
var rootCommand = new RootCommand("An .usm extraction tool for GI.");
rootCommand.AddGlobalOption(outputFolderOption);


Expand Down Expand Up @@ -91,6 +86,8 @@ private static async Task DemuxUsmCommand(FileInfo file, string key1, string key
{
if (file == null) throw new ArgumentNullException("No file provided.");
if (!file.Exists) throw new ArgumentException("File {0} does not exist.", file.Name);
if (!file.Name.EndsWith(".usm"))
throw new ArgumentException($"File {file.Name} provided isn't a .usm file.");
if (key1!=null && key2!= null && (key1.Length != 8 || key2.Length != 8)) throw new ArgumentException("Keys are invalid.");
string outputArg = (output == null)
? file.Directory.FullName
Expand Down Expand Up @@ -125,7 +122,7 @@ private static async Task ConvertHcaCommand(FileSystemInfo input, DirectoryInfo?
{
case FileInfo f:
// TODO add keys :shrug:
if (f.Name.EndsWith(".hca")) throw new ArgumentException("File provided is not a .hca file.");
if (!f.Name.EndsWith(".hca")) throw new ArgumentException("File provided is not a .hca file.");
HCA file = new(f.FullName);
file.ConvertToWAV(outputArg);
break;
Expand Down

0 comments on commit 0159c41

Please sign in to comment.