Skip to content

Commit cc94262

Browse files
committed
Update Program.cs
1 parent 8ca8f99 commit cc94262

File tree

2 files changed

+63
-11
lines changed

2 files changed

+63
-11
lines changed

ConsoleApp1/Program.cs

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,90 @@
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Linq;
5+
using System.Reflection;
56
using System.Runtime.InteropServices;
67
using System.Text;
8+
using System.Text.RegularExpressions;
79
using System.Threading.Tasks;
810

911
namespace ConsoleApp1
1012
{
11-
internal
12-
class Program
13+
internal class Program
1314
{
1415

15-
1616

17-
static void Main(string[] args)
18-
17+
static void Main(string[] args)
1918
{
19+
2020
Console.Title = "SaveFucker | a tool of decrypting MinecraftWorlds ";
2121

2222
string arg_path = "";
23+
bool pass = true;
2324

2425
while (true)
2526
{
26-
Console.WriteLine("请输入您存档所在路径:");
27+
28+
pass = true;
29+
30+
Console.ForegroundColor = ConsoleColor.White;
31+
Console.WriteLine("请输入您存档所在路径(请确保存档路径中不含有任何中文及其字符)");
32+
Console.ForegroundColor = ConsoleColor.Gray;
2733
arg_path = Console.ReadLine();
28-
if (Directory.Exists(arg_path))
29-
break;
30-
Console.WriteLine("路径不存在,请重新输入");
34+
35+
36+
if (!Directory.Exists(arg_path))
37+
{
38+
Console.ForegroundColor = ConsoleColor.Red;
39+
Console.WriteLine("路径不存在,请重新输入");
40+
Console.ForegroundColor = ConsoleColor.Gray;
41+
}
42+
else
43+
{
44+
for (int i = 0; i < arg_path.Length; i++)
45+
{
46+
if (Regex.IsMatch(arg_path[i].ToString(), @"[\u4e00-\u9fbb]+"))
47+
{
48+
Console.ForegroundColor = ConsoleColor.Red;
49+
Console.WriteLine("存档路径含有中文 请命名成英文 或 将存档保存到其他非中文的路径");
50+
Console.ForegroundColor = ConsoleColor.Gray;
51+
pass = false;
52+
break;
53+
}
54+
55+
}
56+
57+
if (pass)
58+
break;
59+
60+
61+
62+
}
63+
64+
65+
66+
67+
68+
69+
70+
71+
3172
}
32-
73+
74+
75+
3376
Console.WriteLine(MCStudio.Utils.LevelDbEncryptHelper.DecryptRecord(arg_path));
77+
Console.ForegroundColor = ConsoleColor.Green;
3478
Console.WriteLine("解密操作结束\r\n按下回车键退出程序...");
3579
Console.ReadLine();
3680

3781
}
82+
83+
84+
85+
86+
87+
88+
89+
3890
}
3991
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
4. 看到Success成功 说明成功解密了
1515

1616

17-
视频教程:
17+
视频教程:https://www.bilibili.com/video/BV1JP411j7dA

0 commit comments

Comments
 (0)