-
Notifications
You must be signed in to change notification settings - Fork 3
/
decrypt.cs
44 lines (38 loc) · 1.08 KB
/
decrypt.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace shaders
{
class Program
{
static void Main(string[] args)
{
var files = Directory.GetFiles("shaders");
foreach (var file in files)
DecryptShader(file, file.Replace(".caesar3", ""));
}
static void DecryptShader(string input, string output)
{
try
{
var inputShader = new FileStream(input, FileMode.Open);
var outputShader = new FileStream(output, FileMode.Create);
for (int i = 0; i < inputShader.Length; i++)
{
byte x = (byte)inputShader.ReadByte();
x = (byte)(x - 3);
outputShader.WriteByte(x);
}
inputShader.Close();
outputShader.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
}
}