2020-02-11 05:04:56 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Alphaleonis.Win32.Filesystem;
|
2020-01-31 22:38:56 +00:00
|
|
|
|
using CommandLine;
|
|
|
|
|
using Wabbajack.Common;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack.CLI.Verbs
|
|
|
|
|
{
|
|
|
|
|
[Verb("decrypt", HelpText = @"Decrypt data from AppData\Local\Wabbajack and store it locally", Hidden = true)]
|
2020-02-11 05:04:56 +00:00
|
|
|
|
public class Decrypt : AVerb
|
2020-01-31 22:38:56 +00:00
|
|
|
|
{
|
|
|
|
|
[Option('n', "name", Required = true, HelpText = @"Credential to encrypt and store in AppData\Local\Wabbajack")]
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Option('o', "output", Required = true, HelpText = @"Output file for the decrypted data")]
|
|
|
|
|
public string Output { get; set; }
|
|
|
|
|
|
2020-02-11 05:04:56 +00:00
|
|
|
|
protected override async Task<int> Run()
|
2020-01-31 22:38:56 +00:00
|
|
|
|
{
|
2020-02-11 05:04:56 +00:00
|
|
|
|
File.WriteAllBytes(Output, Utils.FromEncryptedData(Name));
|
2020-01-31 22:38:56 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|