-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
72 lines (60 loc) · 2 KB
/
Program.cs
File metadata and controls
72 lines (60 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
public class Program
{
public static void Main()
{
Console.Title = "SuperSigner | Made by https://github.com/ZygoteCode/";
if (!Directory.Exists("inputs"))
{
Directory.CreateDirectory("inputs");
return;
}
string option = "";
while (option == "")
{
Console.Write("Please, choose what certificate to use (from 1 to 22): ");
byte parsed = 0;
if (!byte.TryParse(Console.ReadLine(), out parsed))
{
Console.WriteLine("Invalid number, please try again.");
option = "";
continue;
}
if (!(parsed >= 1 && parsed <= 22))
{
Console.WriteLine("Invalid number, please try again.");
option = "";
continue;
}
option = parsed.ToString();
}
foreach (string file in Directory.GetFiles("inputs"))
{
new Thread(() => SignFile(file, option)).Start();
}
}
public static void SignFile(string file, string option)
{
try
{
Process cmd = new Process();
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.WorkingDirectory = Path.GetFullPath("bin");
cmd.StartInfo.UseShellExecute = false;
cmd.Start();
cmd.StandardInput.WriteLine($"signtool.exe sign /fd SHA512 /v /ac {option}.crt /f {option}.pfx /p {File.ReadAllText("bin\\" + option + ".txt")} /t \"http://timestamp.digicert.com\" \"{Path.GetFullPath(file)}\"");
cmd.StandardInput.Flush();
cmd.StandardInput.Close();
cmd.WaitForExit();
}
catch
{
}
}
}