Files
NDecrypt/3DSDecrypt/Program.cs
Matt Nadareski 4d9001f74c Mostly working implementation
It's very strange but there are some files that don't decrypt/re-encrypt properly at this point. It could be a key issue, but it's unknown for now.
2019-04-06 21:58:08 -07:00

50 lines
1.5 KiB
C#

using System;
using System.IO;
namespace ThreeDS
{
class Program
{
public static void Main(string[] args)
{
if (args.Length < 2 || (args[0] != "encrypt" && args[0] != "decrypt"))
{
Console.WriteLine("Usage: 3dsdecrypt.exe (decrypt|encrypt) [-dev] <file|dir> ...");
return;
}
bool development = false;
int start = 1;
if (args[1] == "-dev")
{
development = true;
start = 2;
}
for (int i = start; i < args.Length; i++)
{
if (File.Exists(args[i]))
{
ThreeDSTool tool = new ThreeDSTool(args[i], development);
if (args[0] == "decrypt")
tool.Decrypt();
else if (args[0] == "encrypt")
tool.Encrypt();
}
else if (Directory.Exists(args[i]))
{
foreach (string file in Directory.EnumerateFiles(args[i], "*", SearchOption.AllDirectories))
{
ThreeDSTool tool = new ThreeDSTool(file, development);
if (args[0] == "decrypt")
tool.Decrypt();
else if (args[0] == "encrypt")
tool.Encrypt();
}
}
}
}
}
}