mirror of
https://github.com/SabreTools/NDecrypt.git
synced 2026-07-09 02:16:52 +00:00
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.
50 lines
1.5 KiB
C#
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();
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|