Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Threading.Tasks;
- using System.Collections.Generic;
- namespace DiscordCacheConverter
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine(@"WARNING: This executable must be placed in your \AppData\Roaming\discord\Cache directory");
- Console.WriteLine("This program will overwrite all files in current directory, so make sure it's in the right one. Close now if you are unsure.");
- Console.WriteLine("Press any key to continue");
- Console.ReadKey();
- Console.WriteLine("Starting Conversion of image cache to readable state...");
- Converter converter = new Converter();
- }
- }
- public class Converter
- {
- readonly string BasePath = AppDomain.CurrentDomain.BaseDirectory;
- string[] Files;
- public Converter()
- {
- Files = Directory.GetFiles(BasePath);
- Run();
- }
- private void Run()
- {
- foreach (string file in Files)
- {
- if (file.Contains("f_"))
- {
- Console.WriteLine($"Found file {file}");
- Console.WriteLine("Converting...");
- File.Move(file, $"{file}.png");
- Console.WriteLine("Completed Conversion");
- Console.WriteLine($"File saved as {file}.png");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement