├── .github ├── FUNDING.yml └── workflows │ └── dotnet.yml ├── Libraries ├── x86 │ ├── 7z.dll │ ├── Everything32.dll │ └── Everything32.exe └── x64 │ ├── 7z64.dll │ ├── Everything64.dll │ └── Everything64.exe ├── AdvancedRobloxArchival ├── SingletonBase.cs ├── packages.config ├── App.config ├── TaskbarFlash.cs ├── ConfigManager.cs ├── Properties │ ├── AssemblyInfo.cs │ └── Resources.Designer.cs ├── PropertyMatching.cs ├── ConsoleGlobal.cs ├── FtpManager.cs ├── BinaryArchive.cs ├── WebManager.cs ├── ArgumentInfo.cs ├── AdvancedRobloxArchival.csproj ├── AuthenticodeTools.cs ├── Program.cs ├── EverythingApi.cs └── PeHeaderReader.cs ├── .devcontainer └── devcontainer.json ├── LICENSE ├── AdvancedRobloxArchival.sln ├── .gitattributes ├── README.md └── .gitignore /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: Yakov5776 -------------------------------------------------------------------------------- /Libraries/x86/7z.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yakov5776/AdvancedRobloxArchival/HEAD/Libraries/x86/7z.dll -------------------------------------------------------------------------------- /Libraries/x64/7z64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yakov5776/AdvancedRobloxArchival/HEAD/Libraries/x64/7z64.dll -------------------------------------------------------------------------------- /Libraries/x64/Everything64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yakov5776/AdvancedRobloxArchival/HEAD/Libraries/x64/Everything64.dll -------------------------------------------------------------------------------- /Libraries/x64/Everything64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yakov5776/AdvancedRobloxArchival/HEAD/Libraries/x64/Everything64.exe -------------------------------------------------------------------------------- /Libraries/x86/Everything32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yakov5776/AdvancedRobloxArchival/HEAD/Libraries/x86/Everything32.dll -------------------------------------------------------------------------------- /Libraries/x86/Everything32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yakov5776/AdvancedRobloxArchival/HEAD/Libraries/x86/Everything32.exe -------------------------------------------------------------------------------- /AdvancedRobloxArchival/SingletonBase.cs: -------------------------------------------------------------------------------- 1 | namespace AdvancedRobloxArchival 2 | { 3 | public class SingletonBase 4 | where TSingleton : class, new() 5 | { 6 | public static readonly TSingleton Singleton = new TSingleton(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Mono Development Environment", 3 | "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu-20.04", 4 | 5 | "postCreateCommand": "sudo apt install ca-certificates gnupg && sudo gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && echo 'deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list && sudo apt update && sudo apt install -y mono-devel nuget && nuget restore" 6 | } 7 | -------------------------------------------------------------------------------- /.github/workflows/dotnet.yml: -------------------------------------------------------------------------------- 1 | name: .NET 2 | 3 | on: [push, pull_request, workflow_dispatch] 4 | 5 | jobs: 6 | build: 7 | strategy: 8 | matrix: 9 | configuration: [Debug, Release] 10 | platform: [x64, x86] 11 | runs-on: windows-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v4 15 | - name: Setup .NET 16 | uses: microsoft/setup-msbuild@v2 17 | - name: Setup Nuget 18 | uses: nuget/setup-nuget@v2 19 | - name: Restore dependencies 20 | run: nuget restore AdvancedRobloxArchival.sln 21 | - name: Build 22 | run: | 23 | msbuild.exe AdvancedRobloxArchival.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} 24 | - name: Upload Artifacts 25 | uses: actions/upload-artifact@v4 26 | with: 27 | name: AdvancedRobloxArchival (${{ matrix.configuration }}, ${{ matrix.platform }}) 28 | path: AdvancedRobloxArchival/bin/${{ matrix.platform }}/${{ matrix.configuration }} 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Yakov5776 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/TaskbarFlash.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace AdvancedRobloxArchival 6 | { 7 | public class TaskbarFlash 8 | { 9 | [DllImport("user32.dll")] 10 | [return: MarshalAs(UnmanagedType.Bool)] 11 | static extern bool FlashWindowEx(ref FLASHWINFO pwfi); 12 | 13 | private const UInt32 FLASHW_ALL = 3; 14 | private const UInt32 FLASHW_TIMERNOFG = 12; 15 | 16 | [StructLayout(LayoutKind.Sequential)] 17 | private struct FLASHWINFO 18 | { 19 | public UInt32 cbSize; 20 | public IntPtr hwnd; 21 | public UInt32 dwFlags; 22 | public UInt32 uCount; 23 | public UInt32 dwTimeout; 24 | } 25 | public static void FlashWindowEx() 26 | { 27 | FLASHWINFO fInfo = new FLASHWINFO(); 28 | 29 | fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo)); 30 | fInfo.hwnd = Process.GetCurrentProcess().MainWindowHandle; 31 | fInfo.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; 32 | fInfo.uCount = UInt32.MaxValue; 33 | fInfo.dwTimeout = 0; 34 | 35 | FlashWindowEx(ref fInfo); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/ConfigManager.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace AdvancedRobloxArchival 10 | { 11 | internal class ConfigManager 12 | { 13 | public const string ConfigFilename = "config.json"; 14 | private static bool ConfigInitialized = false; 15 | private static JObject _settings; 16 | public static JObject Settings { 17 | get { 18 | if (!ConfigInitialized) 19 | { 20 | if (!ConfigExist()) CreateDefaultConfig(); 21 | else InitializeConfig(); 22 | } 23 | return _settings; 24 | } 25 | } 26 | 27 | public static bool CheckKey(string key) => Settings.ContainsKey(key); 28 | 29 | private static void CreateDefaultConfig() 30 | { 31 | _settings = new JObject(new JProperty("ConfigVersion", Program.version.ToString())); 32 | ConfigInitialized = true; 33 | } 34 | 35 | public static bool ConfigExist() => File.Exists(ConfigFilename); 36 | 37 | private static void InitializeConfig() 38 | { 39 | _settings = JObject.Parse(File.ReadAllText(ConfigFilename)); 40 | ConfigInitialized = true; 41 | } 42 | 43 | public static void FlushConfig() => File.WriteAllText(ConfigFilename, _settings.ToString()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32929.385 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvancedRobloxArchival", "AdvancedRobloxArchival\AdvancedRobloxArchival.csproj", "{8E250B3E-1771-4F1D-A9D5-B0681DDB1AA0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {8E250B3E-1771-4F1D-A9D5-B0681DDB1AA0}.Debug|x64.ActiveCfg = Debug|x64 17 | {8E250B3E-1771-4F1D-A9D5-B0681DDB1AA0}.Debug|x64.Build.0 = Debug|x64 18 | {8E250B3E-1771-4F1D-A9D5-B0681DDB1AA0}.Debug|x86.ActiveCfg = Debug|x86 19 | {8E250B3E-1771-4F1D-A9D5-B0681DDB1AA0}.Debug|x86.Build.0 = Debug|x86 20 | {8E250B3E-1771-4F1D-A9D5-B0681DDB1AA0}.Release|x64.ActiveCfg = Release|x64 21 | {8E250B3E-1771-4F1D-A9D5-B0681DDB1AA0}.Release|x64.Build.0 = Release|x64 22 | {8E250B3E-1771-4F1D-A9D5-B0681DDB1AA0}.Release|x86.ActiveCfg = Release|x86 23 | {8E250B3E-1771-4F1D-A9D5-B0681DDB1AA0}.Release|x86.Build.0 = Release|x86 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {8AD79276-0D35-4FB1-AE5F-59F4A3CC3FB4} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("AdvancedRobloxArchival")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("AdvancedRobloxArchival")] 13 | [assembly: AssemblyCopyright("Copyright © 2023")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8e250b3e-1771-4f1d-a9d5-b0681ddb1aa0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("5.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/PropertyMatching.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace AdvancedRobloxArchival 5 | { 6 | internal class PropertyMatching 7 | { 8 | private static Dictionary signatureMap => new Dictionary() 9 | { 10 | { "Client", BinaryArchive.BinaryTypes.RobloxClient }, 11 | { "Game", BinaryArchive.BinaryTypes.RobloxClient }, 12 | { "Studio", BinaryArchive.BinaryTypes.RobloxStudio }, 13 | { "Compute Cloud Service", BinaryArchive.BinaryTypes.RCCService } 14 | }; 15 | 16 | 17 | public static BinaryArchive.BinaryTypes GetBinaryTypeFromSignature(string prop) 18 | { 19 | string property = prop.Trim(); 20 | 21 | foreach (var signature in signatureMap) 22 | { 23 | if (property.EndsWith(signature.Key, StringComparison.OrdinalIgnoreCase)) 24 | { 25 | return signature.Value; 26 | } 27 | } 28 | 29 | return BinaryArchive.BinaryTypes.Miscellaneous; 30 | } 31 | 32 | public static bool IsROBLOX(string property) => property?.ToUpper().StartsWith("ROBLOX") ?? false; 33 | 34 | public static bool ConsiderBinaryCandidate(string filename) 35 | { 36 | return IsBinary(filename) && (filename.StartsWith("Roblox") || filename.StartsWith("version-") || filename.StartsWith("RCCService") || filename.StartsWith("0.")); 37 | } 38 | 39 | public static bool IsBinary(string filename) => filename.EndsWith(".exe"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AdvancedRobloxArchival 2 | 3 | This tool allows you to easily search your entire PC for Roblox binaries (exe, zip, 7z, and rar) using the [Voidtools SDK](https://www.voidtools.com/). It verifies the digital signature of each binary to ensure that it hasn't been patched or tampered with. The tool also checks for duplicates and avoids scanning a file or a zip more than once, even if the tool needs to be relaunched. 4 | 5 | In addition, this tool has built-in error handling and logs any issues encountered during the scanning process. 6 | 7 | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Yakov5776/AdvancedRobloxArchival/dotnet.yml?branch=master&label=Build&cacheSeconds=3600)](https://github.com/Yakov5776/AdvancedRobloxArchival/actions/workflows/dotnet.yml) 8 | [![Downloads](https://img.shields.io/github/downloads/Yakov5776/AdvancedRobloxArchival/total?label=Downloads&cacheSeconds=3600)](https://github.com/Yakov5776/AdvancedRobloxArchival/releases/latest) 9 | 10 | # Features 11 | 12 | - Search your entire PC for Roblox binaries (exe, zip, 7z, and rar) using the Voidtools SDK. 13 | - Verify the digital signature of each binary to ensure that it hasn't been tampered with. 14 | - Avoid scanning duplicate files and zips to save time and resources. 15 | - Organize files by version and categorize them into the appropriate binary categories (Client, Studio, RCC). 16 | - Optionally, contribute newly found binaries to the robloxopolis archive via ftp. 17 | 18 | # How to Use 19 | 20 | - Download the latest release of the tool from the [releases](https://github.com/Yakov5776/AdvancedRobloxArchival/releases/latest) page. 21 | - Extract the contents of the archive to a directory on your PC. 22 | - Double-click the `AdvancedRobloxArchival.exe` file to launch the tool. 23 | - The tool will prompt you to start scanning your PC for Roblox binaries. 24 | - Once the scan is complete, the tool will organize the binaries by version and categorize them into the appropriate binary categories (Client, Studio, RCC). 25 | 26 | # Screenshot 27 | ![AdvancedRobloxArchival_CEiPz0ru9J](https://user-images.githubusercontent.com/28637006/229326347-feb372df-fee0-4111-816d-b3f0142a05e4.png) 28 | 29 | ## Support 30 | 31 | If you like the project, leave a :star: (top right) and become a [stargazer](https://github.com/Yakov5776/AdvancedRobloxArchival/stargazers)! 32 | 33 | [![Stargazers repo roster for @Yakov5776/AdvancedRobloxArchival](https://reporoster.com/stars/dark/Yakov5776/AdvancedRobloxArchival)](https://github.com/Yakov5776/AdvancedRobloxArchival/stargazers) 34 | 35 | # Contributing 36 | 37 | Contributions are welcome! If you would like to contribute to this project, please fork the repository and submit a pull request. 38 | 39 | # License 40 | 41 | This project is licensed under the [MIT License](/LICENSE). 42 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/ConsoleGlobal.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace AdvancedRobloxArchival 8 | { 9 | class ConsoleGlobal : SingletonBase 10 | { 11 | public void WriteContent(string content, ConsoleColor color) 12 | { 13 | Console.ForegroundColor = color; 14 | Console.WriteLine(content); 15 | Console.ForegroundColor = ConsoleColor.White; 16 | } 17 | 18 | public void WriteContentNoLine(string content, ConsoleColor color) 19 | { 20 | Console.ForegroundColor = color; 21 | Console.Write(content); 22 | Console.ForegroundColor = ConsoleColor.White; 23 | } 24 | 25 | public void WriteColoredOutput(string output, params ConsoleColor[] colors) 26 | { 27 | int colorIndex = 0; 28 | foreach (string part in output.Split('|')) 29 | { 30 | WriteContentNoLine(part, colors[colorIndex++]); 31 | } 32 | } 33 | 34 | public void WriteRedSeparator() 35 | { 36 | Console.ForegroundColor = ConsoleColor.Red; 37 | Console.Write(" | "); 38 | } 39 | 40 | public void WriteContentThread(int Thread, string content, ConsoleColor color) 41 | { 42 | WriteContent($"[Thread {Thread.ToString()}] {content}", color); 43 | } 44 | 45 | public bool WriteContentYesOrNo(string content, ConsoleColor color, ConsoleColor color2) 46 | { 47 | while (true) 48 | { 49 | WriteContentNoLine(content, color); 50 | WriteContentNoLine(" (y/n) ", color2); 51 | 52 | char response = char.ToUpper(Console.ReadLine().FirstOrDefault()); 53 | if (response == 'Y') return true; 54 | if (response == 'N') return false; 55 | else 56 | { 57 | Console.SetCursorPosition(0, Console.CursorTop - 1); 58 | ClearCurrentConsoleLine(); 59 | } 60 | } 61 | } 62 | 63 | public int WriteChoiceMenu(string[] Options, ConsoleColor color, ConsoleColor color2) 64 | { 65 | int index = 1; 66 | string menu = string.Empty; 67 | foreach (string Option in Options) 68 | { 69 | menu += $" {index}. {Option}\n"; 70 | index++; 71 | } 72 | 73 | WriteContent(menu, color); 74 | 75 | int choice; 76 | bool isValidChoice = false; 77 | 78 | do 79 | { 80 | WriteContentNoLine(" Select an Option: ", color2); 81 | Console.ForegroundColor = ConsoleColor.Yellow; 82 | 83 | var isNumeric = int.TryParse(Console.ReadLine(), out choice); 84 | 85 | if (isNumeric && choice > 0 && choice <= Options.Length) 86 | { 87 | isValidChoice = true; 88 | } 89 | else 90 | { 91 | Console.SetCursorPosition(0, Console.CursorTop - 1); 92 | ClearCurrentConsoleLine(); 93 | } 94 | } while (!isValidChoice); 95 | 96 | return choice; 97 | } 98 | 99 | public void ClearCurrentConsoleLine() 100 | { 101 | int currentLineCursor = Console.CursorTop; 102 | Console.SetCursorPosition(0, Console.CursorTop); 103 | Console.Write(new string(' ', Console.WindowWidth)); 104 | Console.SetCursorPosition(0, currentLineCursor); 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/FtpManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | using static AdvancedRobloxArchival.BinaryArchive; 10 | 11 | namespace AdvancedRobloxArchival 12 | { 13 | internal class FtpServerInformation 14 | { 15 | // Notice: The hardcoded FTP information included is not intended to be private or confidential, as it simply just has a limited scope of permissions. 16 | 17 | public const string HostName = "ftp.robloxopolis.com"; 18 | public const string Username = "archiver"; 19 | public const string Password = "@@81950d194d70ed74A95c8@0Afe67feA7ec95659541692A2fdc651ce8A42f@@fddc46AA9cd@@6630@9f10119d231"; 20 | public static NetworkCredential Credentials = new NetworkCredential(Username, Password); 21 | } 22 | 23 | internal class FtpManager 24 | { 25 | private static readonly SemaphoreSlim _ftpSemaphore = new SemaphoreSlim(1); 26 | private static List<(string FileName, BinaryTypes BinaryType)> ExistingUploads = new List<(string, BinaryTypes)>(); 27 | private static FtpWebRequest FtpRequest { get; set; } 28 | private static FtpWebRequest CreateNewFtpWebRequest(string requestUriString) 29 | { 30 | FtpWebRequest ftpWebRequest = (FtpWebRequest)WebRequest.Create(requestUriString); 31 | ftpWebRequest.UsePassive = true; 32 | ftpWebRequest.UseBinary = true; 33 | ftpWebRequest.KeepAlive = true; 34 | ftpWebRequest.Credentials = FtpServerInformation.Credentials; 35 | 36 | return ftpWebRequest; 37 | } 38 | public static bool IsHostnameResolvable() 39 | { 40 | try 41 | { 42 | IPAddress[] addresses = Dns.GetHostAddresses(FtpServerInformation.HostName); 43 | 44 | return (addresses.Length > 0); 45 | } 46 | catch 47 | { 48 | return false; 49 | } 50 | } 51 | 52 | public static bool UploadFile(BinaryArchive binary) 53 | { 54 | _ftpSemaphore.Wait(); 55 | FtpRequest = CreateNewFtpWebRequest($"ftp://{FtpServerInformation.HostName}/{binary.BinaryType}/{binary.Version}.exe"); 56 | FtpRequest.Method = WebRequestMethods.Ftp.UploadFile; 57 | 58 | try 59 | { 60 | using (Stream destinationStream = FtpRequest.GetRequestStream()) 61 | using (FileStream sourceStream = new FileStream(BinaryArchive.GetDestinationPath(binary), FileMode.Open)) 62 | { 63 | sourceStream.CopyTo(destinationStream); 64 | } 65 | 66 | FtpWebResponse response = (FtpWebResponse)FtpRequest.GetResponse(); 67 | 68 | return true; 69 | } 70 | catch 71 | { 72 | return false; 73 | } 74 | finally 75 | { 76 | _ftpSemaphore.Release(); 77 | } 78 | } 79 | 80 | public static bool FileExists(BinaryArchive binary) 81 | { 82 | return (ExistingUploads.Any(x => x.FileName == $"{binary.Version}.exe" && x.BinaryType == binary.BinaryType)); 83 | } 84 | 85 | public static bool InitializeFtpConnection() 86 | { 87 | if (FtpRequest != null) return true; 88 | 89 | foreach (string i in Enum.GetNames(typeof(BinaryArchive.BinaryTypes))) 90 | { 91 | FtpRequest = CreateNewFtpWebRequest($"ftp://{FtpServerInformation.HostName}/{i}/"); 92 | FtpRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails; 93 | try 94 | { 95 | using (FtpWebResponse response = (FtpWebResponse)FtpRequest.GetResponse()) 96 | using (Stream responseStream = response.GetResponseStream()) 97 | using (StreamReader reader = new StreamReader(responseStream)) 98 | { 99 | string line; 100 | while ((line = reader.ReadLine()) != null) 101 | { 102 | string[] lineParts = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); 103 | string fileName = lineParts[lineParts.Length - 1]; 104 | ExistingUploads.Add((fileName, (BinaryTypes)Enum.Parse(typeof(BinaryTypes), i))); 105 | } 106 | } 107 | } 108 | catch 109 | { 110 | Program.UseArchiveServer = false; // Can't connect! don't enable this feature. 111 | return false; 112 | } 113 | } 114 | 115 | return true; 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/BinaryArchive.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Threading; 5 | 6 | namespace AdvancedRobloxArchival 7 | { 8 | public struct BinaryArchive 9 | { 10 | public enum BinaryTypes 11 | { 12 | Miscellaneous, 13 | RobloxClient, 14 | RobloxStudio, 15 | RCCService 16 | } 17 | public BinaryArchive(bool signed) 18 | { 19 | DigitallySigned = signed; 20 | Version = ""; 21 | BinaryType = BinaryTypes.Miscellaneous; 22 | Path = ""; 23 | FromCache = false; 24 | } 25 | 26 | public void Populate(string version, BinaryTypes binarytype, string path, bool fromcache) 27 | { 28 | Version = version; 29 | BinaryType = binarytype; 30 | Path = path; 31 | FromCache = fromcache; 32 | } 33 | 34 | public bool DigitallySigned { get; } 35 | public string Path { get; set; } 36 | public string Version { get; set; } 37 | public BinaryTypes BinaryType { get; set; } 38 | public bool FromCache { get; set; } 39 | 40 | public static BinaryArchive CheckFileAuthenticity(string path, bool FromCache = false) 41 | { 42 | if (File.Exists(path)) 43 | { 44 | FileVersionInfo info = FileVersionInfo.GetVersionInfo(path) ?? null; 45 | if (PropertyMatching.IsROBLOX(info?.FileDescription)) 46 | { 47 | bool isTrusted = AuthenticodeTools.IsTrusted(path); 48 | if (isTrusted) 49 | { 50 | BinaryTypes binType = PropertyMatching.GetBinaryTypeFromSignature(info.FileDescription); 51 | 52 | BinaryArchive binary = new BinaryArchive(true); 53 | binary.Populate(info.FileVersion.Replace(", ", "."), binType, path, FromCache); 54 | return binary; 55 | } 56 | } 57 | if (FromCache) File.Delete(path); 58 | } 59 | return new BinaryArchive(false); 60 | } 61 | 62 | public static void ArchiveFile(BinaryArchive binary) 63 | { 64 | string destination = GetDestinationPath(binary); 65 | 66 | if (File.Exists(destination)) 67 | { 68 | if (binary.FromCache) 69 | File.Delete(binary.Path); 70 | } 71 | else 72 | { 73 | Program.ArchivedCount++; 74 | if (binary.FromCache) 75 | File.Move(binary.Path, destination); 76 | else 77 | File.Copy(binary.Path, destination); 78 | 79 | DateTime fileTimeStamp = new PeHeaderReader(destination).TimeStamp; 80 | if (fileTimeStamp < DateTime.UtcNow && fileTimeStamp > new DateTime(2005, 1, 1)) // Ensure they're not a super old date or a future date 81 | File.SetLastWriteTimeUtc(destination, fileTimeStamp); 82 | 83 | if (Program.UseArchiveServer) 84 | { 85 | if (!FtpManager.InitializeFtpConnection()) return; 86 | 87 | Program.UploadQueue++; 88 | Thread uploadThread = new Thread(() => 89 | { 90 | bool exists = FtpManager.FileExists(binary); 91 | if (!exists) 92 | { 93 | bool success = FtpManager.UploadFile(binary); 94 | if (success) Program.UploadArchivedCount++; 95 | else // Upload failed; attempt and retry 5 times. 96 | { 97 | for (int i = 1; i <= 5; i++) 98 | { 99 | bool successRetry = FtpManager.UploadFile(binary); 100 | if (successRetry) 101 | { 102 | Program.UploadArchivedCount++; 103 | break; 104 | } 105 | else if (i == 5 && Program.UploadArchivedCount <= 0) Program.UseArchiveServer = false; // Disable this feature; doesn't seem to work. 106 | } 107 | } 108 | } 109 | Program.UploadQueue--; 110 | }); 111 | uploadThread.IsBackground = true; 112 | uploadThread.Start(); 113 | } 114 | } 115 | } 116 | 117 | public static string GetDestinationPath(BinaryArchive binary) => System.IO.Path.Combine(Program.ArchivePath, binary.BinaryType.ToString(), binary.Version + ".exe"); 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/WebManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Web; 9 | 10 | namespace AdvancedRobloxArchival 11 | { 12 | internal class WebManager 13 | { 14 | private static HttpListener listener; 15 | private const int Port = 5776; 16 | public static string HostName => $"http://127.0.0.1:{Port}"; 17 | 18 | private static Dictionary> pageRegisters = new Dictionary> 19 | { 20 | {"/", Page_Home }, 21 | {"/css/bootstrap.css", (req, res) => ReturnData(req, res, Encoding.UTF8.GetBytes(Properties.Resources.BootstrapCSS), ContentType.CSS) }, 22 | {"/js/bootstrap.js", (req, res) => ReturnData(req, res, Encoding.UTF8.GetBytes(Properties.Resources.BootstrapJS), ContentType.JavaScript) }, 23 | {"/js/jquery.js", (req, res) => ReturnData(req, res, Encoding.UTF8.GetBytes(Properties.Resources.JQueryJS), ContentType.JavaScript) } 24 | }; 25 | 26 | private static Dictionary siteVariables = new Dictionary 27 | { 28 | ["revision"] = Program.versionString 29 | }; 30 | 31 | private static string HomeHTML 32 | { 33 | get { 34 | string homeHtml = Properties.Resources.HomeHTML; 35 | 36 | foreach (var variable in siteVariables) 37 | { 38 | homeHtml = homeHtml.Replace($"{{{variable.Key}}}", variable.Value); 39 | } 40 | 41 | return homeHtml; 42 | } 43 | } 44 | 45 | public static void Start() 46 | { 47 | listener = new HttpListener(); 48 | listener.Prefixes.Add(HostName + "/"); 49 | listener.Start(); 50 | 51 | Task processingTask = ProcessRequestsAsync(); 52 | } 53 | 54 | public static void Stop() => listener.Stop(); 55 | 56 | private static async Task ProcessRequestsAsync() 57 | { 58 | while (listener.IsListening) 59 | { 60 | var context = await listener.GetContextAsync(); 61 | await HandleRequestAsync(context); 62 | } 63 | } 64 | 65 | private enum ContentType 66 | { 67 | [StringValue("application/javascript")] 68 | JavaScript, 69 | 70 | [StringValue("text/css")] 71 | CSS 72 | } 73 | 74 | private class StringValueAttribute : Attribute 75 | { 76 | public string Value { get; } 77 | 78 | public StringValueAttribute(string value) 79 | { 80 | Value = value; 81 | } 82 | } 83 | 84 | private static string GetContentType(ContentType contentType) 85 | { 86 | var attribute = contentType 87 | .GetType() 88 | .GetMember(contentType.ToString()) 89 | .FirstOrDefault()? 90 | .GetCustomAttributes(typeof(StringValueAttribute), false) 91 | .OfType() 92 | .FirstOrDefault(); 93 | 94 | return attribute?.Value; 95 | } 96 | 97 | private static async Task HandleError(HttpListenerRequest req, HttpListenerResponse res, string errString, int errCode = 500) 98 | { 99 | res.StatusCode = errCode; 100 | var buffer = Encoding.UTF8.GetBytes($"{errString}

{errString}


Archiver r{Program.versionString}
"); 101 | await res.OutputStream.WriteAsync(buffer, 0, buffer.Length); 102 | 103 | } 104 | 105 | private static async Task ReturnFile(HttpListenerRequest req, HttpListenerResponse res, string path) => await ReturnData(req, res, File.ReadAllBytes(path), MimeMapping.GetMimeMapping(path)); 106 | private static async Task ReturnData(HttpListenerRequest req, HttpListenerResponse res, byte[] data, ContentType ContentType) => await ReturnData(req, res, data, GetContentType(ContentType)); 107 | private static async Task ReturnData(HttpListenerRequest req, HttpListenerResponse res, byte[] data, string ContentType = "application/octet-stream") 108 | { 109 | res.ContentType = ContentType; 110 | await res.OutputStream.WriteAsync(data, 0, data.Length); 111 | } 112 | 113 | private static async Task HandleRequestAsync(HttpListenerContext context) 114 | { 115 | var request = context.Request; 116 | var response = context.Response; 117 | 118 | response.ContentType = "text/html; charset=utf-8"; 119 | 120 | string requestedPath = request.Url.AbsolutePath; 121 | if (pageRegisters.ContainsKey(requestedPath)) 122 | { 123 | Func action = pageRegisters[requestedPath]; 124 | await action.Invoke(request, response); 125 | } 126 | else await HandleError(request, response, "404 - Not Found", 404); 127 | 128 | response.Close(); 129 | } 130 | 131 | private static async Task Page_Home(HttpListenerRequest req, HttpListenerResponse res) 132 | { 133 | var buffer = Encoding.UTF8.GetBytes(HomeHTML); 134 | await res.OutputStream.WriteAsync(buffer, 0, buffer.Length); 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/ArgumentInfo.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace AdvancedRobloxArchival 7 | { 8 | internal class ArgumentInfo 9 | { 10 | public Action Action { get; set; } 11 | public bool RequiresValue { get; set; } 12 | public string Description { get; set; } 13 | 14 | public ArgumentInfo(Action action, bool requiresValue, string description) 15 | { 16 | Action = action; 17 | RequiresValue = requiresValue; 18 | Description = description; 19 | } 20 | 21 | internal static Dictionary argumentActions = new Dictionary 22 | { 23 | { "mode", new ArgumentInfo(value => SetMode(value), true, "Sets the mode for scanning (e.g. ScanAllDrives, ScanSpecificDirectories)") }, 24 | { "identify-file", new ArgumentInfo(value => IdentifyFile(value), true, "Automatically analyzes and returns a JSON-friendly response for a binary") }, 25 | { "help", new ArgumentInfo(_ => ShowHelp(), false, "Returns this help menu") }, 26 | { "?", new ArgumentInfo(_ => ShowHelp(), false, null) }, 27 | }; 28 | 29 | internal static void ParseArguments(string[] args) 30 | { 31 | string currentArgument = null; 32 | foreach (var arg in args) 33 | { 34 | bool isValue = !arg.StartsWith("-"); 35 | if (isValue) 36 | { 37 | if (currentArgument == null || !argumentActions.ContainsKey(currentArgument)) 38 | { 39 | Console.WriteLine($"Error: Unrecognized argument '{arg}'."); 40 | Environment.Exit(1); 41 | } 42 | else 43 | { 44 | if (argumentActions[currentArgument].RequiresValue) 45 | { 46 | argumentActions[currentArgument].Action(arg.Trim('"')); 47 | currentArgument = null; 48 | } 49 | else 50 | { 51 | Console.WriteLine($"Error: Argument '-{currentArgument}' does not require a value."); 52 | Environment.Exit(1); 53 | } 54 | } 55 | } 56 | else 57 | { 58 | if (currentArgument != null) 59 | { 60 | if (argumentActions[currentArgument].RequiresValue) 61 | { 62 | Console.WriteLine($"Error: Missing value for argument '-{currentArgument}'."); 63 | Environment.Exit(1); 64 | } 65 | else 66 | { 67 | argumentActions[currentArgument].Action(null); 68 | } 69 | } 70 | currentArgument = arg.Substring(1).ToLower(); 71 | if (!argumentActions.ContainsKey(currentArgument)) 72 | { 73 | Console.WriteLine($"Error: Unrecognized argument '{arg}'."); 74 | Environment.Exit(1); 75 | } 76 | if (!argumentActions[currentArgument].RequiresValue) 77 | { 78 | argumentActions[currentArgument].Action(null); 79 | currentArgument = null; 80 | } 81 | } 82 | } 83 | 84 | if (currentArgument != null) 85 | { 86 | if (argumentActions[currentArgument].RequiresValue) 87 | { 88 | Console.WriteLine($"Error: Missing value for argument '-{currentArgument}'."); 89 | Environment.Exit(1); 90 | } 91 | else 92 | { 93 | argumentActions[currentArgument].Action(null); 94 | } 95 | } 96 | } 97 | 98 | static void SetMode(string value) 99 | { 100 | Program.Modes mode; 101 | if (Enum.TryParse(value, out mode)) 102 | { 103 | Program.CurrentMode = mode; 104 | } 105 | else 106 | { 107 | Console.WriteLine($"Error: Unrecognized mode value '{value}'."); 108 | Environment.Exit(1); 109 | } 110 | } 111 | 112 | static void IdentifyFile(string path) 113 | { 114 | BinaryArchive binary = BinaryArchive.CheckFileAuthenticity(path); 115 | JObject FileResponse = null; 116 | if (binary.DigitallySigned) 117 | FileResponse = new JObject( 118 | new JProperty("version", binary.Version), 119 | new JProperty("type", binary.BinaryType.ToString()), 120 | new JProperty("pe_date", new PeHeaderReader(binary.Path).FileHeader.TimeDateStamp), 121 | new JProperty("digital_signature", "verified")); 122 | else 123 | FileResponse = new JObject(new JProperty("digital_signature", "not_verified")); 124 | 125 | Console.Write(FileResponse.ToString(Formatting.None)); 126 | Environment.Exit(0); 127 | } 128 | 129 | static void ShowHelp() 130 | { 131 | Console.WriteLine("Here's a list of available argument:"); 132 | foreach (var arg in argumentActions) 133 | { 134 | if (arg.Value.Description != null) 135 | Console.WriteLine($"\"{arg.Key}\": {arg.Value.Description} | Requires Value: {arg.Value.RequiresValue}"); 136 | } 137 | Environment.Exit(0); 138 | } 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/AdvancedRobloxArchival.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | x64 7 | {8E250B3E-1771-4F1D-A9D5-B0681DDB1AA0} 8 | Exe 9 | AdvancedRobloxArchival 10 | AdvancedRobloxArchival 11 | v4.7.2 12 | 512 13 | true 14 | true 15 | 16 | 17 | 18 | 19 | true 20 | bin\x64\Debug\ 21 | TRACE;DEBUG;x64 22 | full 23 | x64 24 | 7.3 25 | prompt 26 | true 27 | 28 | 29 | bin\x64\Release\ 30 | TRACE;x64 31 | true 32 | pdbonly 33 | x64 34 | 7.3 35 | prompt 36 | true 37 | 38 | 39 | true 40 | bin\x86\Debug\ 41 | TRACE;DEBUG;x86 42 | full 43 | x86 44 | 7.3 45 | prompt 46 | true 47 | 48 | 49 | bin\x86\Release\ 50 | TRACE;x86 51 | true 52 | pdbonly 53 | x86 54 | 7.3 55 | prompt 56 | true 57 | 58 | 59 | 60 | ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll 61 | 62 | 63 | ..\packages\Squid-Box.SevenZipSharp.1.6.1.23\lib\net472\SevenZipSharp.dll 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | True 91 | True 92 | Resources.resx 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | ResXFileCodeGenerator 106 | Resources.Designer.cs 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AdvancedRobloxArchival.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AdvancedRobloxArchival.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to .clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not( [rest of string was truncated]";. 65 | /// 66 | internal static string BootstrapCSS { 67 | get { 68 | return ResourceManager.GetString("BootstrapCSS", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to !function(a){a(function(){a.support.transition=function(){var a=function(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},c;for(c in b)if(a.style[c]!==undefined)return b[c]}();return a&&{end:a}}()})}(window.jQuery),!function(a){var b=function(b,c){this.options=c,this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this)),this.optio [rest of string was truncated]";. 74 | /// 75 | internal static string BootstrapJS { 76 | get { 77 | return ResourceManager.GetString("BootstrapJS", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to <!DOCTYPE html> 83 | ///<html lang="en"> 84 | ///<head> 85 | /// <meta charset="UTF-8"> 86 | /// <meta http-equiv="X-UA-Compatible" content="IE=edge"> 87 | /// <meta name="viewport" content="width=device-width, initial-scale=1.0"> 88 | /// <title>Web Server</title> 89 | /// <link rel="stylesheet" href="/css/bootstrap.css"> 90 | ///</head> 91 | ///<body> 92 | /// <div class="navbar"> 93 | /// <div class="navbar-inner"> 94 | /// <a class="brand" href="/">Advanced Roblox Archival <small>r{revision}</small></a> 95 | /// <ul class="nav"> 96 | /// <li><a href="/">Home</a></ [rest of string was truncated]";. 97 | /// 98 | internal static string HomeHTML { 99 | get { 100 | return ResourceManager.GetString("HomeHTML", resourceCulture); 101 | } 102 | } 103 | 104 | /// 105 | /// Looks up a localized string similar to (function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\ [rest of string was truncated]";. 106 | /// 107 | internal static string JQueryJS { 108 | get { 109 | return ResourceManager.GetString("JQueryJS", resourceCulture); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized string similar to _ _ _ ___ ___ ___ _ _____ __ _ _ _ 115 | /// /_\ __| |_ ____ _ _ _ __ ___ __| | | _ \/ _ \| _ ) | / _ \ \/ / __ _ _ _ __| |_ (_)_ ____ _| | 116 | /// / _ \/ _` \ V / _` | ' \/ _/ -_) _` | | / (_) | _ \ |_| (_) > < / _` | '_/ _| ' \| \ V / _` | | 117 | /// /_/ \_\__,_|\_/\__,_|_||_\__\___\__,_| |_|_\\___/|___/____\___/_/\_\ \__,_|_| \__|_||_|_|\_/\__,_|_| 118 | /// by yakov :D. 119 | /// 120 | internal static string LogoASCII { 121 | get { 122 | return ResourceManager.GetString("LogoASCII", resourceCulture); 123 | } 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | [Ww][Ii][Nn]32/ 25 | [Aa][Rr][Mm]/ 26 | [Aa][Rr][Mm]64/ 27 | bld/ 28 | [Bb]in/ 29 | [Oo]bj/ 30 | [Oo]ut/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # ASP.NET Scaffolding 65 | ScaffoldingReadMe.txt 66 | 67 | # StyleCop 68 | StyleCopReport.xml 69 | 70 | # Files built by Visual Studio 71 | *_i.c 72 | *_p.c 73 | *_h.h 74 | *.ilk 75 | *.meta 76 | *.obj 77 | *.iobj 78 | *.pch 79 | *.pdb 80 | *.ipdb 81 | *.pgc 82 | *.pgd 83 | *.rsp 84 | *.sbr 85 | *.tlb 86 | *.tli 87 | *.tlh 88 | *.tmp 89 | *.tmp_proj 90 | *_wpftmp.csproj 91 | *.log 92 | *.vspscc 93 | *.vssscc 94 | .builds 95 | *.pidb 96 | *.svclog 97 | *.scc 98 | 99 | # Chutzpah Test files 100 | _Chutzpah* 101 | 102 | # Visual C++ cache files 103 | ipch/ 104 | *.aps 105 | *.ncb 106 | *.opendb 107 | *.opensdf 108 | *.sdf 109 | *.cachefile 110 | *.VC.db 111 | *.VC.VC.opendb 112 | 113 | # Visual Studio profiler 114 | *.psess 115 | *.vsp 116 | *.vspx 117 | *.sap 118 | 119 | # Visual Studio Trace Files 120 | *.e2e 121 | 122 | # TFS 2012 Local Workspace 123 | $tf/ 124 | 125 | # Guidance Automation Toolkit 126 | *.gpState 127 | 128 | # ReSharper is a .NET coding add-in 129 | _ReSharper*/ 130 | *.[Rr]e[Ss]harper 131 | *.DotSettings.user 132 | 133 | # TeamCity is a build add-in 134 | _TeamCity* 135 | 136 | # DotCover is a Code Coverage Tool 137 | *.dotCover 138 | 139 | # AxoCover is a Code Coverage Tool 140 | .axoCover/* 141 | !.axoCover/settings.json 142 | 143 | # Coverlet is a free, cross platform Code Coverage Tool 144 | coverage*.json 145 | coverage*.xml 146 | coverage*.info 147 | 148 | # Visual Studio code coverage results 149 | *.coverage 150 | *.coveragexml 151 | 152 | # NCrunch 153 | _NCrunch_* 154 | .*crunch*.local.xml 155 | nCrunchTemp_* 156 | 157 | # MightyMoose 158 | *.mm.* 159 | AutoTest.Net/ 160 | 161 | # Web workbench (sass) 162 | .sass-cache/ 163 | 164 | # Installshield output folder 165 | [Ee]xpress/ 166 | 167 | # DocProject is a documentation generator add-in 168 | DocProject/buildhelp/ 169 | DocProject/Help/*.HxT 170 | DocProject/Help/*.HxC 171 | DocProject/Help/*.hhc 172 | DocProject/Help/*.hhk 173 | DocProject/Help/*.hhp 174 | DocProject/Help/Html2 175 | DocProject/Help/html 176 | 177 | # Click-Once directory 178 | publish/ 179 | 180 | # Publish Web Output 181 | *.[Pp]ublish.xml 182 | *.azurePubxml 183 | # Note: Comment the next line if you want to checkin your web deploy settings, 184 | # but database connection strings (with potential passwords) will be unencrypted 185 | *.pubxml 186 | *.publishproj 187 | 188 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 189 | # checkin your Azure Web App publish settings, but sensitive information contained 190 | # in these scripts will be unencrypted 191 | PublishScripts/ 192 | 193 | # NuGet Packages 194 | *.nupkg 195 | # NuGet Symbol Packages 196 | *.snupkg 197 | # The packages folder can be ignored because of Package Restore 198 | **/[Pp]ackages/* 199 | # except build/, which is used as an MSBuild target. 200 | !**/[Pp]ackages/build/ 201 | # Uncomment if necessary however generally it will be regenerated when needed 202 | #!**/[Pp]ackages/repositories.config 203 | # NuGet v3's project.json files produces more ignorable files 204 | *.nuget.props 205 | *.nuget.targets 206 | 207 | # Microsoft Azure Build Output 208 | csx/ 209 | *.build.csdef 210 | 211 | # Microsoft Azure Emulator 212 | ecf/ 213 | rcf/ 214 | 215 | # Windows Store app package directories and files 216 | AppPackages/ 217 | BundleArtifacts/ 218 | Package.StoreAssociation.xml 219 | _pkginfo.txt 220 | *.appx 221 | *.appxbundle 222 | *.appxupload 223 | 224 | # Visual Studio cache files 225 | # files ending in .cache can be ignored 226 | *.[Cc]ache 227 | # but keep track of directories ending in .cache 228 | !?*.[Cc]ache/ 229 | 230 | # Others 231 | ClientBin/ 232 | ~$* 233 | *~ 234 | *.dbmdl 235 | *.dbproj.schemaview 236 | *.jfm 237 | *.pfx 238 | *.publishsettings 239 | orleans.codegen.cs 240 | 241 | # Including strong name files can present a security risk 242 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 243 | #*.snk 244 | 245 | # Since there are multiple workflows, uncomment next line to ignore bower_components 246 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 247 | #bower_components/ 248 | 249 | # RIA/Silverlight projects 250 | Generated_Code/ 251 | 252 | # Backup & report files from converting an old project file 253 | # to a newer Visual Studio version. Backup files are not needed, 254 | # because we have git ;-) 255 | _UpgradeReport_Files/ 256 | Backup*/ 257 | UpgradeLog*.XML 258 | UpgradeLog*.htm 259 | ServiceFabricBackup/ 260 | *.rptproj.bak 261 | 262 | # SQL Server files 263 | *.mdf 264 | *.ldf 265 | *.ndf 266 | 267 | # Business Intelligence projects 268 | *.rdl.data 269 | *.bim.layout 270 | *.bim_*.settings 271 | *.rptproj.rsuser 272 | *- [Bb]ackup.rdl 273 | *- [Bb]ackup ([0-9]).rdl 274 | *- [Bb]ackup ([0-9][0-9]).rdl 275 | 276 | # Microsoft Fakes 277 | FakesAssemblies/ 278 | 279 | # GhostDoc plugin setting file 280 | *.GhostDoc.xml 281 | 282 | # Node.js Tools for Visual Studio 283 | .ntvs_analysis.dat 284 | node_modules/ 285 | 286 | # Visual Studio 6 build log 287 | *.plg 288 | 289 | # Visual Studio 6 workspace options file 290 | *.opt 291 | 292 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 293 | *.vbw 294 | 295 | # Visual Studio LightSwitch build output 296 | **/*.HTMLClient/GeneratedArtifacts 297 | **/*.DesktopClient/GeneratedArtifacts 298 | **/*.DesktopClient/ModelManifest.xml 299 | **/*.Server/GeneratedArtifacts 300 | **/*.Server/ModelManifest.xml 301 | _Pvt_Extensions 302 | 303 | # Paket dependency manager 304 | .paket/paket.exe 305 | paket-files/ 306 | 307 | # FAKE - F# Make 308 | .fake/ 309 | 310 | # CodeRush personal settings 311 | .cr/personal 312 | 313 | # Python Tools for Visual Studio (PTVS) 314 | __pycache__/ 315 | *.pyc 316 | 317 | # Cake - Uncomment if you are using it 318 | # tools/** 319 | # !tools/packages.config 320 | 321 | # Tabs Studio 322 | *.tss 323 | 324 | # Telerik's JustMock configuration file 325 | *.jmconfig 326 | 327 | # BizTalk build output 328 | *.btp.cs 329 | *.btm.cs 330 | *.odx.cs 331 | *.xsd.cs 332 | 333 | # OpenCover UI analysis results 334 | OpenCover/ 335 | 336 | # Azure Stream Analytics local run output 337 | ASALocalRun/ 338 | 339 | # MSBuild Binary and Structured Log 340 | *.binlog 341 | 342 | # NVidia Nsight GPU debugger configuration file 343 | *.nvuser 344 | 345 | # MFractors (Xamarin productivity tool) working folder 346 | .mfractor/ 347 | 348 | # Local History for Visual Studio 349 | .localhistory/ 350 | 351 | # BeatPulse healthcheck temp database 352 | healthchecksdb 353 | 354 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 355 | MigrationBackup/ 356 | 357 | # Ionide (cross platform F# VS Code tools) working folder 358 | .ionide/ 359 | 360 | # Fody - auto-generated XML schema 361 | FodyWeavers.xsd -------------------------------------------------------------------------------- /AdvancedRobloxArchival/AuthenticodeTools.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace AdvancedRobloxArchival 5 | { 6 | /*Source: https://stackoverflow.com/a/6597017/8200011 */ 7 | internal static class AuthenticodeTools 8 | { 9 | [DllImport("Wintrust.dll", PreserveSig = true, SetLastError = false)] 10 | private static extern uint WinVerifyTrust(IntPtr hWnd, IntPtr pgActionID, IntPtr pWinTrustData); 11 | private static uint WinVerifyTrust(string fileName) 12 | { 13 | 14 | Guid wintrust_action_generic_verify_v2 = new Guid("{00AAC56B-CD44-11d0-8CC2-00C04FC295EE}"); 15 | uint result = 0; 16 | using (WINTRUST_FILE_INFO fileInfo = new WINTRUST_FILE_INFO(fileName, 17 | Guid.Empty)) 18 | using (UnmanagedPointer guidPtr = new UnmanagedPointer(Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Guid))), 19 | AllocMethod.HGlobal)) 20 | using (UnmanagedPointer wvtDataPtr = new UnmanagedPointer(Marshal.AllocHGlobal(Marshal.SizeOf(typeof(WINTRUST_DATA))), 21 | AllocMethod.HGlobal)) 22 | { 23 | WINTRUST_DATA data = new WINTRUST_DATA(fileInfo); 24 | IntPtr pGuid = guidPtr; 25 | IntPtr pData = wvtDataPtr; 26 | Marshal.StructureToPtr(wintrust_action_generic_verify_v2, 27 | pGuid, 28 | true); 29 | Marshal.StructureToPtr(data, 30 | pData, 31 | true); 32 | result = WinVerifyTrust(IntPtr.Zero, 33 | pGuid, 34 | pData); 35 | 36 | } 37 | return result; 38 | 39 | } 40 | public static bool IsTrusted(string fileName) 41 | { 42 | uint result = WinVerifyTrust(fileName); 43 | return result == 0 || result == 0x800B010C /* Revoked certficate */; 44 | } 45 | 46 | 47 | } 48 | 49 | internal struct WINTRUST_FILE_INFO : IDisposable 50 | { 51 | 52 | public WINTRUST_FILE_INFO(string fileName, Guid subject) 53 | { 54 | 55 | cbStruct = (uint)Marshal.SizeOf(typeof(WINTRUST_FILE_INFO)); 56 | 57 | pcwszFilePath = fileName; 58 | 59 | 60 | 61 | if (subject != Guid.Empty) 62 | { 63 | 64 | pgKnownSubject = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Guid))); 65 | 66 | Marshal.StructureToPtr(subject, pgKnownSubject, true); 67 | 68 | } 69 | 70 | else 71 | { 72 | 73 | pgKnownSubject = IntPtr.Zero; 74 | 75 | } 76 | 77 | hFile = IntPtr.Zero; 78 | 79 | } 80 | 81 | public uint cbStruct; 82 | 83 | [MarshalAs(UnmanagedType.LPTStr)] 84 | 85 | public string pcwszFilePath; 86 | 87 | public IntPtr hFile; 88 | 89 | public IntPtr pgKnownSubject; 90 | 91 | 92 | 93 | #region IDisposable Members 94 | 95 | 96 | 97 | public void Dispose() 98 | { 99 | 100 | Dispose(true); 101 | 102 | } 103 | 104 | 105 | 106 | private void Dispose(bool disposing) 107 | { 108 | 109 | if (pgKnownSubject != IntPtr.Zero) 110 | { 111 | 112 | Marshal.DestroyStructure(this.pgKnownSubject, typeof(Guid)); 113 | 114 | Marshal.FreeHGlobal(this.pgKnownSubject); 115 | 116 | } 117 | 118 | } 119 | 120 | 121 | 122 | #endregion 123 | 124 | } 125 | 126 | enum AllocMethod 127 | { 128 | HGlobal, 129 | CoTaskMem 130 | }; 131 | enum UnionChoice 132 | { 133 | File = 1, 134 | Catalog, 135 | Blob, 136 | Signer, 137 | Cert 138 | }; 139 | enum UiChoice 140 | { 141 | All = 1, 142 | NoUI, 143 | NoBad, 144 | NoGood 145 | }; 146 | enum RevocationCheckFlags 147 | { 148 | None = 0, 149 | WholeChain 150 | }; 151 | enum StateAction 152 | { 153 | Ignore = 0, 154 | Verify, 155 | Close, 156 | AutoCache, 157 | AutoCacheFlush 158 | }; 159 | enum TrustProviderFlags 160 | { 161 | UseIE4Trust = 1, 162 | NoIE4Chain = 2, 163 | NoPolicyUsage = 4, 164 | RevocationCheckNone = 16, 165 | RevocationCheckEndCert = 32, 166 | RevocationCheckChain = 64, 167 | RecovationCheckChainExcludeRoot = 128, 168 | Safer = 256, 169 | HashOnly = 512, 170 | UseDefaultOSVerCheck = 1024, 171 | LifetimeSigning = 2048 172 | }; 173 | enum UIContext 174 | { 175 | Execute = 0, 176 | Install 177 | }; 178 | 179 | [StructLayout(LayoutKind.Sequential)] 180 | 181 | internal struct WINTRUST_DATA : IDisposable 182 | { 183 | 184 | public WINTRUST_DATA(WINTRUST_FILE_INFO fileInfo) 185 | { 186 | 187 | this.cbStruct = (uint)Marshal.SizeOf(typeof(WINTRUST_DATA)); 188 | 189 | pInfoStruct = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(WINTRUST_FILE_INFO))); 190 | 191 | Marshal.StructureToPtr(fileInfo, pInfoStruct, false); 192 | 193 | this.dwUnionChoice = UnionChoice.File; 194 | 195 | 196 | 197 | pPolicyCallbackData = IntPtr.Zero; 198 | 199 | pSIPCallbackData = IntPtr.Zero; 200 | 201 | 202 | 203 | dwUIChoice = UiChoice.NoUI; 204 | 205 | fdwRevocationChecks = RevocationCheckFlags.None; 206 | 207 | dwStateAction = StateAction.Ignore; 208 | 209 | hWVTStateData = IntPtr.Zero; 210 | 211 | pwszURLReference = IntPtr.Zero; 212 | 213 | dwProvFlags = TrustProviderFlags.Safer; 214 | 215 | 216 | 217 | dwUIContext = UIContext.Execute; 218 | 219 | } 220 | 221 | 222 | 223 | public uint cbStruct; 224 | 225 | public IntPtr pPolicyCallbackData; 226 | 227 | public IntPtr pSIPCallbackData; 228 | 229 | public UiChoice dwUIChoice; 230 | 231 | public RevocationCheckFlags fdwRevocationChecks; 232 | 233 | public UnionChoice dwUnionChoice; 234 | 235 | public IntPtr pInfoStruct; 236 | 237 | public StateAction dwStateAction; 238 | 239 | public IntPtr hWVTStateData; 240 | 241 | private IntPtr pwszURLReference; 242 | 243 | public TrustProviderFlags dwProvFlags; 244 | 245 | public UIContext dwUIContext; 246 | 247 | 248 | 249 | #region IDisposable Members 250 | 251 | 252 | 253 | public void Dispose() 254 | { 255 | 256 | Dispose(true); 257 | 258 | } 259 | 260 | 261 | 262 | private void Dispose(bool disposing) 263 | { 264 | 265 | if (dwUnionChoice == UnionChoice.File) 266 | { 267 | 268 | WINTRUST_FILE_INFO info = new WINTRUST_FILE_INFO(); 269 | 270 | Marshal.PtrToStructure(pInfoStruct, info); 271 | 272 | info.Dispose(); 273 | 274 | Marshal.DestroyStructure(pInfoStruct, typeof(WINTRUST_FILE_INFO)); 275 | 276 | } 277 | 278 | 279 | 280 | Marshal.FreeHGlobal(pInfoStruct); 281 | 282 | } 283 | 284 | 285 | 286 | #endregion 287 | 288 | } 289 | 290 | internal sealed class UnmanagedPointer : IDisposable 291 | { 292 | 293 | private IntPtr m_ptr; 294 | 295 | private AllocMethod m_meth; 296 | 297 | internal UnmanagedPointer(IntPtr ptr, AllocMethod method) 298 | { 299 | 300 | m_meth = method; 301 | 302 | m_ptr = ptr; 303 | 304 | } 305 | 306 | 307 | 308 | ~UnmanagedPointer() 309 | { 310 | 311 | Dispose(false); 312 | 313 | } 314 | 315 | 316 | 317 | #region IDisposable Members 318 | 319 | private void Dispose(bool disposing) 320 | { 321 | 322 | if (m_ptr != IntPtr.Zero) 323 | { 324 | 325 | if (m_meth == AllocMethod.HGlobal) 326 | { 327 | 328 | Marshal.FreeHGlobal(m_ptr); 329 | 330 | } 331 | 332 | else if (m_meth == AllocMethod.CoTaskMem) 333 | { 334 | 335 | Marshal.FreeCoTaskMem(m_ptr); 336 | 337 | } 338 | 339 | m_ptr = IntPtr.Zero; 340 | 341 | } 342 | 343 | 344 | 345 | if (disposing) 346 | { 347 | 348 | GC.SuppressFinalize(this); 349 | 350 | } 351 | 352 | } 353 | 354 | 355 | 356 | public void Dispose() 357 | { 358 | 359 | Dispose(true); 360 | 361 | } 362 | 363 | 364 | 365 | #endregion 366 | 367 | 368 | 369 | public static implicit operator IntPtr(UnmanagedPointer ptr) 370 | { 371 | 372 | return ptr.m_ptr; 373 | 374 | } 375 | 376 | } 377 | } 378 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/Program.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using SevenZip; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel; 6 | using System.Diagnostics; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Runtime.ExceptionServices; 10 | using System.Threading; 11 | using System.Timers; 12 | 13 | namespace AdvancedRobloxArchival 14 | { 15 | internal class Program 16 | { 17 | public static readonly Version version = typeof(Program).Assembly.GetName().Version; 18 | public static readonly string CachePath = Path.Combine(Path.GetTempPath(), "ArchiveCache"); 19 | public static string ArchivePath; 20 | private static List CheckedFiles = new List(); 21 | private static BackgroundWorker worker = new BackgroundWorker(); 22 | public static Modes CurrentMode = Modes.Unspecified; 23 | public static int ArchivedCount = 0; 24 | public static int UploadArchivedCount = 0; 25 | public static int UploadQueue = 0; 26 | public static bool UseArchiveServer; 27 | 28 | 29 | public static string versionString 30 | { 31 | get 32 | { 33 | // Construct the string with the major and minor version (if applicable) 34 | string versionString = version.Major.ToString(); 35 | if (version.Minor > 0) 36 | { 37 | versionString += $".{version.Minor}"; 38 | } 39 | 40 | return versionString; 41 | } 42 | } 43 | 44 | public enum Modes : int 45 | { 46 | Unspecified, 47 | ScanAllDrives, 48 | ScanSpecificDirectories 49 | } 50 | 51 | static void Main(string[] args) 52 | { 53 | Console.Title = "Advanced Roblox Archival | Made by Yakov :D"; 54 | ArgumentInfo.ParseArguments(args); 55 | Start(); 56 | } 57 | 58 | static void Start() 59 | { 60 | ConsoleGlobal.Singleton.WriteContent($"Revision {versionString}", ConsoleColor.DarkGray); 61 | ConsoleGlobal.Singleton.WriteContent(Properties.Resources.LogoASCII, ConsoleColor.Cyan); 62 | if (Directory.Exists(CachePath)) new DirectoryInfo(CachePath).Delete(true); 63 | Directory.CreateDirectory(CachePath); 64 | if (CurrentMode == Modes.Unspecified) 65 | { 66 | ConsoleGlobal.Singleton.WriteContent(@" features: 67 | - it searches whole pc using voidtools sdk (it sorts through exe, zip, 7z, and rar) 68 | - it verifies the digital signature so it doesn't include patched/tampered binaries 69 | - it checks for duplicates and doesn't scan a file or a zip more than once (if need to be relaunched) 70 | - has error handling and dumps logs when if it breaks (hopefully it doesn't) 71 | - it organizes files by the version and categorizes it to the appropriate binary categories (Client, Studio, RCC) 72 | ", ConsoleColor.DarkGray); 73 | 74 | if (!ConfigManager.ConfigExist()) 75 | { 76 | ConsoleGlobal.Singleton.WriteContent(" [*] Hey! it seems like it's your first time.", ConsoleColor.Yellow); 77 | } 78 | 79 | if (!ConfigManager.CheckKey("UseArchiveServer")) 80 | { 81 | bool res = ConsoleGlobal.Singleton.WriteContentYesOrNo(" Would you like to contribute any newly found clients to the public robloxopolis archival FTP server?", ConsoleColor.Yellow, ConsoleColor.Cyan); 82 | if (!res) 83 | { 84 | ConsoleGlobal.Singleton.WriteContent($"\n Alright D: Just remember you could change your mind at any time by clearing {ConfigManager.ConfigFilename}", ConsoleColor.Red); 85 | ConsoleGlobal.Singleton.WriteContentNoLine(" Press any key to continue...", ConsoleColor.White); 86 | Console.ReadLine(); 87 | } 88 | ConfigManager.Settings["UseArchiveServer"] = res; 89 | ConfigManager.FlushConfig(); 90 | Console.Clear(); 91 | Start(); 92 | return; 93 | } 94 | 95 | ConsoleGlobal.Singleton.WriteContent(" [*] What would you like to do?\n", ConsoleColor.Cyan); 96 | 97 | string[] Options = { "Scan all drives (recommended)", "Scan a specific directory" }; 98 | 99 | int Choice = ConsoleGlobal.Singleton.WriteChoiceMenu(Options, ConsoleColor.Yellow, ConsoleColor.White); 100 | Console.Clear(); 101 | CurrentMode = (Modes)Choice; 102 | Start(); 103 | return; 104 | } 105 | 106 | string targetDir = string.Empty; 107 | if (CurrentMode == Modes.ScanSpecificDirectories) 108 | { 109 | ConsoleGlobal.Singleton.WriteContentNoLine("[*] Enter the path of which you would like to search in: ", ConsoleColor.Yellow); 110 | targetDir = Console.ReadLine().Trim('"'); 111 | } 112 | 113 | ConsoleGlobal.Singleton.WriteContentNoLine("[*] Enter the full directory path where archives will be kept: ", ConsoleColor.Yellow); 114 | ArchivePath = Console.ReadLine().Trim('"'); 115 | if (!Directory.Exists(ArchivePath)) Directory.CreateDirectory(ArchivePath); 116 | foreach (string i in Enum.GetNames(typeof(BinaryArchive.BinaryTypes))) 117 | { 118 | string CategoryPath = Path.Combine(ArchivePath, i); 119 | if (!Directory.Exists(CategoryPath)) Directory.CreateDirectory(CategoryPath); 120 | } 121 | 122 | if (ConfigManager.CheckKey("EnableExperimentalWebInterface") && ConfigManager.Settings["EnableExperimentalWebInterface"].ToObject()) 123 | { 124 | ConsoleGlobal.Singleton.WriteContent("[*] Starting Web Server at: " + WebManager.HostName, ConsoleColor.Yellow); 125 | WebManager.Start(); 126 | } 127 | 128 | ConsoleGlobal.Singleton.WriteContent("[*] Starting VoidTools helper", ConsoleColor.Yellow); 129 | EverythingApi.StartService(); 130 | ConsoleGlobal.Singleton.WriteContent("[*] Waiting for index to finish", ConsoleColor.Yellow); 131 | while (!EverythingApi.IsReady()) Thread.Sleep(1000); 132 | double attempt = 0; 133 | var everything = new EverythingApi(EverythingApi.ResultKind.FilesOnly); 134 | var query = everything.Search(EverythingFilters.BuildGenericFilter($"!\"{ArchivePath}\"")); 135 | if (CurrentMode == Modes.ScanSpecificDirectories) 136 | { 137 | query = everything.Search(EverythingFilters.BuildGenericFilter($"\"{targetDir}\"")); 138 | } 139 | int totalattempts = query.Count(); 140 | if (File.Exists("CheckedFiles.json")) CheckedFiles = JsonConvert.DeserializeObject>(File.ReadAllText("CheckedFiles.json")); 141 | worker.DoWork += SaveConfigOccasionally; 142 | System.Timers.Timer timer = new System.Timers.Timer(60000); 143 | timer.Elapsed += timer_Elapsed; 144 | timer.Start(); 145 | DateTime startTime = DateTime.Now; 146 | UseArchiveServer = ConfigManager.Settings["UseArchiveServer"].ToObject() && FtpManager.IsHostnameResolvable(); 147 | foreach (var item in query) 148 | { 149 | ConsoleGlobal.Singleton.ClearCurrentConsoleLine(); 150 | string out1 = $"[*] Sorting through archives |(|{attempt}|/|{totalattempts}| attempts|)"; 151 | string out2 = $"Archived: |(|{ArchivedCount}|)"; 152 | string out3 = $"{attempt / totalattempts * 100:0}%| Complete!"; 153 | 154 | ConsoleGlobal.Singleton.WriteColoredOutput(out1, ConsoleColor.Yellow, ConsoleColor.White, ConsoleColor.Cyan, ConsoleColor.DarkGray, ConsoleColor.Cyan, ConsoleColor.Yellow, ConsoleColor.White); 155 | ConsoleGlobal.Singleton.WriteRedSeparator(); 156 | ConsoleGlobal.Singleton.WriteColoredOutput(out2, ConsoleColor.Yellow, ConsoleColor.White, ConsoleColor.Cyan, ConsoleColor.White); 157 | ConsoleGlobal.Singleton.WriteRedSeparator(); 158 | ConsoleGlobal.Singleton.WriteColoredOutput(out3, ConsoleColor.Cyan, ConsoleColor.Yellow); 159 | 160 | if (UseArchiveServer) 161 | { 162 | ConsoleGlobal.Singleton.WriteRedSeparator(); 163 | string out4 = $"Upload Queue: |(|{UploadQueue}|)"; 164 | ConsoleGlobal.Singleton.WriteColoredOutput(out4, ConsoleColor.Yellow, ConsoleColor.White, UploadQueue > 0 ? ConsoleColor.Red : ConsoleColor.Cyan, ConsoleColor.White); 165 | } 166 | 167 | attempt++; 168 | if (CheckedFiles.Contains(item)) continue; // intentionally skipped already checked zips. 169 | else CheckedFiles.Add(item); 170 | if (PropertyMatching.IsBinary(item)) 171 | { 172 | BinaryArchive binaryArchive = BinaryArchive.CheckFileAuthenticity(item, false); 173 | if (binaryArchive.DigitallySigned) BinaryArchive.ArchiveFile(binaryArchive); 174 | } 175 | else 176 | try 177 | { 178 | using (SevenZipExtractor archive = new SevenZipExtractor(item)) 179 | { 180 | if (!archive.Check()) continue; 181 | List filenames = new List(); 182 | int traverseAttempts = 0; 183 | bool unlocked = false; 184 | foreach (var entry in archive.ArchiveFileData) 185 | { 186 | if (!unlocked && traverseAttempts >= 20) break; 187 | if (entry.IsDirectory) 188 | { 189 | traverseAttempts++; 190 | continue; 191 | } 192 | string filename = Path.GetFileName(entry.FileName); 193 | if (PropertyMatching.ConsiderBinaryCandidate(filename)) 194 | { 195 | filenames.Add(entry.FileName); 196 | unlocked = true; 197 | } 198 | } 199 | if (filenames.Any()) archive.ExtractFiles(CachePath, filenames.ToArray()); 200 | var archives = Directory.EnumerateFiles(CachePath, "*.*", SearchOption.AllDirectories); 201 | foreach (string filename in archives) 202 | { 203 | BinaryArchive binaryArchive = BinaryArchive.CheckFileAuthenticity(filename, true); 204 | if (binaryArchive.DigitallySigned) BinaryArchive.ArchiveFile(binaryArchive); 205 | } 206 | } 207 | } 208 | catch (UnauthorizedAccessException) { continue; } 209 | catch (IOException) { continue; } 210 | catch (ArgumentException) { continue; } 211 | catch (Exception ex) 212 | { 213 | worker.RunWorkerAsync(); 214 | if (Debugger.IsAttached) 215 | { 216 | ExceptionDispatchInfo.Capture(ex).Throw(); 217 | throw; 218 | } 219 | else Console.WriteLine("An unknown error has occurred: " + ex.ToString() + "\nAlready scanned archives will not be scanned again."); 220 | 221 | Console.ReadLine(); 222 | return; 223 | } 224 | } 225 | 226 | 227 | timer.Stop(); 228 | TimeSpan totalTimeTaken = DateTime.Now.Subtract(startTime); 229 | worker.RunWorkerAsync(); 230 | ConsoleGlobal.Singleton.ClearCurrentConsoleLine(); 231 | 232 | string succ1 = "[*] |Archive Completed!!!"; 233 | string succ2 = $"Archived |{ArchivedCount}| files in |{(int)totalTimeTaken.TotalMinutes}| minutes!!\n"; 234 | 235 | ConsoleGlobal.Singleton.WriteColoredOutput(succ1, ConsoleColor.Yellow, ConsoleColor.Green); 236 | ConsoleGlobal.Singleton.WriteRedSeparator(); 237 | ConsoleGlobal.Singleton.WriteColoredOutput(succ2, ConsoleColor.Yellow, ConsoleColor.Cyan, ConsoleColor.Yellow, ConsoleColor.Cyan, ConsoleColor.Yellow); 238 | 239 | if (UseArchiveServer && UploadQueue > 0) 240 | { 241 | while (UploadQueue > 0) 242 | { 243 | string succ3 = "[*] |Client uploading has not yet finished!!"; 244 | string succ4 = $"(|{UploadQueue}|)| Clients remaining!"; 245 | ConsoleGlobal.Singleton.ClearCurrentConsoleLine(); 246 | ConsoleGlobal.Singleton.WriteColoredOutput(succ3, ConsoleColor.Yellow, ConsoleColor.Red); 247 | ConsoleGlobal.Singleton.WriteContentNoLine(" | ", ConsoleColor.White); 248 | ConsoleGlobal.Singleton.WriteColoredOutput(succ4, ConsoleColor.White, ConsoleColor.Cyan, ConsoleColor.White, ConsoleColor.Yellow); 249 | Thread.Sleep(1000); 250 | } 251 | 252 | ConsoleGlobal.Singleton.ClearCurrentConsoleLine(); 253 | } 254 | 255 | TaskbarFlash.FlashWindowEx(); 256 | System.Media.SystemSounds.Beep.Play(); 257 | 258 | Console.ReadLine(); 259 | } 260 | 261 | static void timer_Elapsed(object sender, ElapsedEventArgs e) 262 | { 263 | if (!worker.IsBusy) 264 | worker.RunWorkerAsync(); 265 | } 266 | 267 | static void SaveConfigOccasionally(object sender, DoWorkEventArgs e) 268 | { 269 | File.WriteAllText("CheckedFiles.json", JsonConvert.SerializeObject(CheckedFiles.ToArray())); 270 | } 271 | } 272 | } 273 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/EverythingApi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | using System.Text; 9 | using System.Threading; 10 | using System.Threading.Tasks; 11 | 12 | namespace AdvancedRobloxArchival 13 | { 14 | class EverythingFilters 15 | { 16 | private static readonly Unit DefualtMinimumSize = new Unit(3, SizeUnitEnum.Mb); 17 | private static readonly Unit DefualtMaximumSize = new Unit(2, SizeUnitEnum.Gb); 18 | private static readonly string[] MatchExtensions = { "zip", "7z", "rar", "exe" }; 19 | private static readonly string[] DefualtPathFilters = { "!:\\$recycle.bin", "!:\\Windows" }; 20 | 21 | public static string BuildGenericFilter(params string[] query) 22 | { 23 | string result = string.Join("|", MatchExtensions.Select(ext => $"*.{ext}")); 24 | result += $" size:{DefualtMinimumSize}..{DefualtMaximumSize}"; 25 | foreach (string path in DefualtPathFilters) result += $" {path}"; 26 | foreach (string path in query) result += $" {path}"; 27 | 28 | return result; 29 | } 30 | 31 | public enum SizeUnitEnum 32 | { 33 | Kb, 34 | Mb, 35 | Gb, 36 | } 37 | 38 | public struct Unit 39 | { 40 | public Unit(int size, SizeUnitEnum sizeunit) 41 | { 42 | Size = size; 43 | SizeUnit = sizeunit; 44 | } 45 | 46 | public int Size { get; } 47 | public SizeUnitEnum SizeUnit { get; } 48 | 49 | public override string ToString() 50 | { 51 | return string.Concat(Size, SizeUnit.ToString().ToLower()); 52 | } 53 | } 54 | } 55 | 56 | internal class EverythingApi 57 | { 58 | public ResultKind resultKind { get; set; } 59 | public enum ResultKind 60 | { 61 | Both, 62 | FilesOnly, 63 | FoldersOnly 64 | } 65 | private const int ReadyTimeout = 60 * 1000; // 1min 66 | private const int maxPathLength = 260; 67 | public enum ErrorCode 68 | { 69 | Ok = 0, 70 | Memory, 71 | Ipc, 72 | RegisterClassEX, 73 | CreateWindow, 74 | CreateThread, 75 | InvalidIndex, 76 | Invalidcall 77 | } 78 | 79 | public EverythingApi(ResultKind resultKind = ResultKind.Both) 80 | { 81 | this.resultKind = resultKind; 82 | } 83 | 84 | public static bool IsStarted() 85 | { 86 | Version version = GetVersion(); 87 | 88 | return version.Major > 0; 89 | } 90 | 91 | public static bool StartService() 92 | { 93 | if (!IsStarted()) 94 | { 95 | StartProcess("-admin -startup"); 96 | 97 | int idleTime = 100; 98 | int remainingTime = ReadyTimeout; 99 | while (remainingTime > 0 && !IsStarted()) 100 | { 101 | Thread.Sleep(idleTime); 102 | remainingTime -= idleTime; 103 | } 104 | 105 | return IsStarted(); 106 | } 107 | 108 | return true; 109 | } 110 | 111 | public static bool IsReady() 112 | { 113 | return EverythingWrapper.Everything_IsDBLoaded(); 114 | } 115 | 116 | public static Version GetVersion() 117 | { 118 | UInt32 major = EverythingWrapper.Everything_GetMajorVersion(); 119 | UInt32 minor = EverythingWrapper.Everything_GetMinorVersion(); 120 | UInt32 build = EverythingWrapper.Everything_GetBuildNumber(); 121 | UInt32 revision = EverythingWrapper.Everything_GetRevision(); 122 | 123 | return new Version(Convert.ToInt32(major), Convert.ToInt32(minor), Convert.ToInt32(build), Convert.ToInt32(revision)); 124 | } 125 | 126 | public static ErrorCode GetLastError() 127 | { 128 | return (ErrorCode)EverythingWrapper.Everything_GetLastError(); 129 | } 130 | 131 | internal static void StartProcess(string options) 132 | { 133 | string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 134 | string exePath = Path.GetFullPath(Path.Combine(path, Environment.Is64BitProcess ? "Everything64.exe" : "Everything32.exe")); 135 | 136 | System.Diagnostics.Process.Start(exePath, options); 137 | } 138 | 139 | public List Search(string query) 140 | { 141 | EverythingWrapper.Everything_SetMatchWholeWord(false); 142 | EverythingWrapper.Everything_SetMatchPath(false); 143 | EverythingWrapper.Everything_SetMatchCase(false); 144 | var searchPattern = ApplySearchResultKind(query); 145 | EverythingWrapper.Everything_SetSearch(searchPattern); 146 | EverythingWrapper.Everything_Query(true); 147 | ErrorCode LastErrorCode = GetLastError(); 148 | 149 | return GetResults(); 150 | } 151 | 152 | private string ApplySearchResultKind(string searchPatten) 153 | { 154 | switch (resultKind) 155 | { 156 | case ResultKind.FilesOnly: 157 | return $"files: {searchPatten}"; 158 | case ResultKind.FoldersOnly: 159 | return $"folders: {searchPatten}"; 160 | default: 161 | return searchPatten; 162 | } 163 | } 164 | 165 | private List GetResults() 166 | { 167 | List results = new List(); 168 | var numResults = EverythingWrapper.Everything_GetNumResults(); 169 | for (UInt32 i = 0; i < numResults; i++) 170 | { 171 | StringBuilder builder = new StringBuilder(maxPathLength); 172 | EverythingWrapper.Everything_GetResultFullPathName(i, builder, maxPathLength); 173 | results.Add(builder.ToString()); 174 | } 175 | return results; 176 | } 177 | } 178 | 179 | internal class EverythingWrapper 180 | { 181 | private static readonly ReaderWriterLockSlim locker = new ReaderWriterLockSlim(); 182 | 183 | private class Locker : IDisposable 184 | { 185 | private readonly ReaderWriterLockSlim locker; 186 | 187 | public Locker(ReaderWriterLockSlim locker) 188 | { 189 | this.locker = locker; 190 | this.locker.EnterWriteLock(); 191 | } 192 | 193 | public void Dispose() 194 | { 195 | this.locker.ExitWriteLock(); 196 | } 197 | } 198 | 199 | #if x86 200 | private const string EverythingDLL = "Everything32.dll"; 201 | #elif x64 202 | private const string EverythingDLL = "Everything64.dll"; 203 | #endif 204 | 205 | private const int EVERYTHING_OK = 0; 206 | private const int EVERYTHING_ERROR_MEMORY = 1; 207 | private const int EVERYTHING_ERROR_IPC = 2; 208 | private const int EVERYTHING_ERROR_REGISTERCLASSEX = 3; 209 | private const int EVERYTHING_ERROR_CREATEWINDOW = 4; 210 | private const int EVERYTHING_ERROR_CREATETHREAD = 5; 211 | private const int EVERYTHING_ERROR_INVALIDINDEX = 6; 212 | private const int EVERYTHING_ERROR_INVALIDCALL = 7; 213 | 214 | public enum FileInfoIndex 215 | { 216 | FileSize = 1, 217 | FolderSize, 218 | DateCreated, 219 | DateModified, 220 | DateAccessed, 221 | Attributes 222 | } 223 | 224 | 225 | internal static IDisposable Lock() 226 | { 227 | return new Locker(locker); 228 | } 229 | 230 | [DllImport(EverythingDLL)] 231 | public static extern bool Everything_IsDBLoaded(); 232 | 233 | [DllImport(EverythingDLL)] 234 | public static extern UInt32 Everything_GetMajorVersion(); 235 | 236 | [DllImport(EverythingDLL)] 237 | public static extern UInt32 Everything_GetMinorVersion(); 238 | 239 | [DllImport(EverythingDLL)] 240 | public static extern UInt32 Everything_GetRevision(); 241 | 242 | [DllImport(EverythingDLL)] 243 | public static extern UInt32 Everything_GetBuildNumber(); 244 | 245 | [DllImport(EverythingDLL)] 246 | public static extern int Everything_SetSearch(string lpSearchString); 247 | 248 | [DllImport(EverythingDLL)] 249 | public static extern void Everything_SetMatchPath(bool bEnable); 250 | 251 | [DllImport(EverythingDLL)] 252 | public static extern void Everything_SetMatchCase(bool bEnable); 253 | 254 | [DllImport(EverythingDLL)] 255 | public static extern void Everything_SetMatchWholeWord(bool bEnable); 256 | 257 | [DllImport(EverythingDLL)] 258 | public static extern void Everything_SetRegex(bool bEnable); 259 | 260 | [DllImport(EverythingDLL)] 261 | public static extern void Everything_SetMax(UInt32 dwMax); 262 | 263 | [DllImport(EverythingDLL)] 264 | public static extern void Everything_SetOffset(UInt32 dwOffset); 265 | 266 | [DllImport(EverythingDLL)] 267 | public static extern void Everything_SetReplyWindow(IntPtr handler); 268 | 269 | [DllImport(EverythingDLL)] 270 | public static extern void Everything_SetReplyID(UInt32 nId); 271 | 272 | [DllImport(EverythingDLL)] 273 | public static extern void Everything_Reset(); 274 | 275 | [DllImport(EverythingDLL)] 276 | public static extern bool Everything_GetMatchPath(); 277 | 278 | [DllImport(EverythingDLL)] 279 | public static extern bool Everything_GetMatchCase(); 280 | 281 | [DllImport(EverythingDLL)] 282 | public static extern bool Everything_GetMatchWholeWord(); 283 | 284 | [DllImport(EverythingDLL)] 285 | public static extern bool Everything_GetRegex(); 286 | 287 | [DllImport(EverythingDLL)] 288 | public static extern UInt32 Everything_GetMax(); 289 | 290 | [DllImport(EverythingDLL)] 291 | public static extern UInt32 Everything_GetOffset(); 292 | 293 | [DllImport(EverythingDLL)] 294 | public static extern IntPtr Everything_GetSearch(); 295 | 296 | [DllImport(EverythingDLL)] 297 | public static extern int Everything_GetLastError(); 298 | 299 | [DllImport(EverythingDLL)] 300 | public static extern bool Everything_Query(bool bWait); 301 | 302 | [DllImport(EverythingDLL)] 303 | public static extern void Everything_SortResultsByPath(); 304 | 305 | [DllImport(EverythingDLL)] 306 | public static extern UInt32 Everything_GetNumFileResults(); 307 | 308 | [DllImport(EverythingDLL)] 309 | public static extern UInt32 Everything_GetNumFolderResults(); 310 | 311 | [DllImport(EverythingDLL)] 312 | public static extern UInt32 Everything_GetNumResults(); 313 | 314 | [DllImport(EverythingDLL)] 315 | public static extern UInt32 Everything_GetTotFileResults(); 316 | 317 | [DllImport(EverythingDLL)] 318 | public static extern UInt32 Everything_GetTotFolderResults(); 319 | 320 | [DllImport(EverythingDLL)] 321 | public static extern UInt32 Everything_GetTotResults(); 322 | 323 | [DllImport(EverythingDLL)] 324 | public static extern bool Everything_IsVolumeResult(UInt32 nIndex); 325 | 326 | [DllImport(EverythingDLL)] 327 | public static extern bool Everything_IsFolderResult(UInt32 nIndex); 328 | 329 | [DllImport(EverythingDLL)] 330 | public static extern bool Everything_IsFileResult(UInt32 nIndex); 331 | 332 | [DllImport(EverythingDLL, CharSet = CharSet.Unicode)] 333 | public static extern void Everything_GetResultFullPathName(UInt32 nIndex, StringBuilder lpString, UInt32 nMaxCount); 334 | 335 | // Everything 1.4 336 | [DllImport(EverythingDLL)] 337 | public static extern void Everything_SetSort(UInt32 dwSortType); 338 | 339 | 340 | [DllImport(EverythingDLL)] 341 | public static extern UInt32 Everything_GetSort(); 342 | 343 | [DllImport(EverythingDLL)] 344 | public static extern UInt32 Everything_GetResultListSort(); 345 | 346 | [DllImport(EverythingDLL)] 347 | public static extern void Everything_SetRequestFlags(UInt32 dwRequestFlags); 348 | 349 | [DllImport(EverythingDLL)] 350 | public static extern UInt32 Everything_GetRequestFlags(); 351 | 352 | [DllImport(EverythingDLL)] 353 | public static extern UInt32 Everything_GetResultListRequestFlags(); 354 | 355 | [DllImport(EverythingDLL, CharSet = CharSet.Unicode)] 356 | public static extern string Everything_GetResultExtension(UInt32 nIndex); 357 | 358 | [DllImport(EverythingDLL)] 359 | public static extern bool Everything_GetResultSize(UInt32 nIndex, out long lpFileSize); 360 | 361 | [DllImport(EverythingDLL)] 362 | public static extern bool Everything_GetResultDateCreated(UInt32 nIndex, out long lpFileTime); 363 | 364 | [DllImport(EverythingDLL)] 365 | public static extern bool Everything_GetResultDateModified(UInt32 nIndex, out long lpFileTime); 366 | 367 | [DllImport(EverythingDLL)] 368 | public static extern bool Everything_GetResultDateAccessed(UInt32 nIndex, out long lpFileTime); 369 | 370 | [DllImport(EverythingDLL)] 371 | public static extern UInt32 Everything_GetResultAttributes(UInt32 nIndex); 372 | 373 | [DllImport(EverythingDLL, CharSet = CharSet.Unicode)] 374 | public static extern string Everything_GetResultFileListFileName(UInt32 nIndex); 375 | 376 | [DllImport(EverythingDLL, CharSet = CharSet.Unicode)] 377 | public static extern string Everything_GetResultPath(UInt32 nIndex); 378 | 379 | [DllImport(EverythingDLL, CharSet = CharSet.Unicode)] 380 | public static extern string Everything_GetResultFileName(UInt32 nIndex); 381 | 382 | [DllImport(EverythingDLL)] 383 | public static extern UInt32 Everything_GetResultRunCount(UInt32 nIndex); 384 | 385 | [DllImport(EverythingDLL)] 386 | public static extern bool Everything_GetResultDateRun(UInt32 nIndex, out long lpFileTime); 387 | 388 | [DllImport(EverythingDLL)] 389 | public static extern bool Everything_GetResultDateRecentlyChanged(UInt32 nIndex, out long lpFileTime); 390 | 391 | [DllImport(EverythingDLL, CharSet = CharSet.Unicode)] 392 | public static extern string Everything_GetResultHighlightedFileName(UInt32 nIndex); 393 | 394 | [DllImport(EverythingDLL, CharSet = CharSet.Unicode)] 395 | public static extern string Everything_GetResultHighlightedPath(UInt32 nIndex); 396 | 397 | [DllImport(EverythingDLL, CharSet = CharSet.Unicode)] 398 | public static extern string Everything_GetResultHighlightedFullPathAndFileName(UInt32 nIndex); 399 | 400 | [DllImport(EverythingDLL)] 401 | public static extern UInt32 Everything_GetRunCountFromFileName(string lpFileName); 402 | 403 | [DllImport(EverythingDLL)] 404 | public static extern bool Everything_SetRunCountFromFileName(string lpFileName, UInt32 dwRunCount); 405 | 406 | [DllImport(EverythingDLL)] 407 | public static extern UInt32 Everything_IncRunCountFromFileName(string lpFileName); 408 | 409 | [DllImport(EverythingDLL)] 410 | public static extern bool Everything_IsFileInfoIndexed(FileInfoIndex fileInfoType); 411 | } 412 | } 413 | -------------------------------------------------------------------------------- /AdvancedRobloxArchival/PeHeaderReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace AdvancedRobloxArchival 6 | { 7 | /*Source: https://gist.github.com/augustoproiete/b51f29f74f5f5b2c59c39e47a8afc3a3 */ 8 | public class PeHeaderReader 9 | { 10 | #region File Header Structures 11 | 12 | public struct IMAGE_DOS_HEADER 13 | { // DOS .EXE header 14 | public UInt16 e_magic; // Magic number 15 | public UInt16 e_cblp; // Bytes on last page of file 16 | public UInt16 e_cp; // Pages in file 17 | public UInt16 e_crlc; // Relocations 18 | public UInt16 e_cparhdr; // Size of header in paragraphs 19 | public UInt16 e_minalloc; // Minimum extra paragraphs needed 20 | public UInt16 e_maxalloc; // Maximum extra paragraphs needed 21 | public UInt16 e_ss; // Initial (relative) SS value 22 | public UInt16 e_sp; // Initial SP value 23 | public UInt16 e_csum; // Checksum 24 | public UInt16 e_ip; // Initial IP value 25 | public UInt16 e_cs; // Initial (relative) CS value 26 | public UInt16 e_lfarlc; // File address of relocation table 27 | public UInt16 e_ovno; // Overlay number 28 | public UInt16 e_res_0; // Reserved words 29 | public UInt16 e_res_1; // Reserved words 30 | public UInt16 e_res_2; // Reserved words 31 | public UInt16 e_res_3; // Reserved words 32 | public UInt16 e_oemid; // OEM identifier (for e_oeminfo) 33 | public UInt16 e_oeminfo; // OEM information; e_oemid specific 34 | public UInt16 e_res2_0; // Reserved words 35 | public UInt16 e_res2_1; // Reserved words 36 | public UInt16 e_res2_2; // Reserved words 37 | public UInt16 e_res2_3; // Reserved words 38 | public UInt16 e_res2_4; // Reserved words 39 | public UInt16 e_res2_5; // Reserved words 40 | public UInt16 e_res2_6; // Reserved words 41 | public UInt16 e_res2_7; // Reserved words 42 | public UInt16 e_res2_8; // Reserved words 43 | public UInt16 e_res2_9; // Reserved words 44 | public UInt32 e_lfanew; // File address of new exe header 45 | } 46 | 47 | [StructLayout(LayoutKind.Sequential)] 48 | public struct IMAGE_DATA_DIRECTORY 49 | { 50 | public UInt32 VirtualAddress; 51 | public UInt32 Size; 52 | } 53 | 54 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 55 | public struct IMAGE_OPTIONAL_HEADER32 56 | { 57 | public UInt16 Magic; 58 | public Byte MajorLinkerVersion; 59 | public Byte MinorLinkerVersion; 60 | public UInt32 SizeOfCode; 61 | public UInt32 SizeOfInitializedData; 62 | public UInt32 SizeOfUninitializedData; 63 | public UInt32 AddressOfEntryPoint; 64 | public UInt32 BaseOfCode; 65 | public UInt32 BaseOfData; 66 | public UInt32 ImageBase; 67 | public UInt32 SectionAlignment; 68 | public UInt32 FileAlignment; 69 | public UInt16 MajorOperatingSystemVersion; 70 | public UInt16 MinorOperatingSystemVersion; 71 | public UInt16 MajorImageVersion; 72 | public UInt16 MinorImageVersion; 73 | public UInt16 MajorSubsystemVersion; 74 | public UInt16 MinorSubsystemVersion; 75 | public UInt32 Win32VersionValue; 76 | public UInt32 SizeOfImage; 77 | public UInt32 SizeOfHeaders; 78 | public UInt32 CheckSum; 79 | public UInt16 Subsystem; 80 | public UInt16 DllCharacteristics; 81 | public UInt32 SizeOfStackReserve; 82 | public UInt32 SizeOfStackCommit; 83 | public UInt32 SizeOfHeapReserve; 84 | public UInt32 SizeOfHeapCommit; 85 | public UInt32 LoaderFlags; 86 | public UInt32 NumberOfRvaAndSizes; 87 | 88 | public IMAGE_DATA_DIRECTORY ExportTable; 89 | public IMAGE_DATA_DIRECTORY ImportTable; 90 | public IMAGE_DATA_DIRECTORY ResourceTable; 91 | public IMAGE_DATA_DIRECTORY ExceptionTable; 92 | public IMAGE_DATA_DIRECTORY CertificateTable; 93 | public IMAGE_DATA_DIRECTORY BaseRelocationTable; 94 | public IMAGE_DATA_DIRECTORY Debug; 95 | public IMAGE_DATA_DIRECTORY Architecture; 96 | public IMAGE_DATA_DIRECTORY GlobalPtr; 97 | public IMAGE_DATA_DIRECTORY TLSTable; 98 | public IMAGE_DATA_DIRECTORY LoadConfigTable; 99 | public IMAGE_DATA_DIRECTORY BoundImport; 100 | public IMAGE_DATA_DIRECTORY IAT; 101 | public IMAGE_DATA_DIRECTORY DelayImportDescriptor; 102 | public IMAGE_DATA_DIRECTORY CLRRuntimeHeader; 103 | public IMAGE_DATA_DIRECTORY Reserved; 104 | } 105 | 106 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 107 | public struct IMAGE_OPTIONAL_HEADER64 108 | { 109 | public UInt16 Magic; 110 | public Byte MajorLinkerVersion; 111 | public Byte MinorLinkerVersion; 112 | public UInt32 SizeOfCode; 113 | public UInt32 SizeOfInitializedData; 114 | public UInt32 SizeOfUninitializedData; 115 | public UInt32 AddressOfEntryPoint; 116 | public UInt32 BaseOfCode; 117 | public UInt64 ImageBase; 118 | public UInt32 SectionAlignment; 119 | public UInt32 FileAlignment; 120 | public UInt16 MajorOperatingSystemVersion; 121 | public UInt16 MinorOperatingSystemVersion; 122 | public UInt16 MajorImageVersion; 123 | public UInt16 MinorImageVersion; 124 | public UInt16 MajorSubsystemVersion; 125 | public UInt16 MinorSubsystemVersion; 126 | public UInt32 Win32VersionValue; 127 | public UInt32 SizeOfImage; 128 | public UInt32 SizeOfHeaders; 129 | public UInt32 CheckSum; 130 | public UInt16 Subsystem; 131 | public UInt16 DllCharacteristics; 132 | public UInt64 SizeOfStackReserve; 133 | public UInt64 SizeOfStackCommit; 134 | public UInt64 SizeOfHeapReserve; 135 | public UInt64 SizeOfHeapCommit; 136 | public UInt32 LoaderFlags; 137 | public UInt32 NumberOfRvaAndSizes; 138 | 139 | public IMAGE_DATA_DIRECTORY ExportTable; 140 | public IMAGE_DATA_DIRECTORY ImportTable; 141 | public IMAGE_DATA_DIRECTORY ResourceTable; 142 | public IMAGE_DATA_DIRECTORY ExceptionTable; 143 | public IMAGE_DATA_DIRECTORY CertificateTable; 144 | public IMAGE_DATA_DIRECTORY BaseRelocationTable; 145 | public IMAGE_DATA_DIRECTORY Debug; 146 | public IMAGE_DATA_DIRECTORY Architecture; 147 | public IMAGE_DATA_DIRECTORY GlobalPtr; 148 | public IMAGE_DATA_DIRECTORY TLSTable; 149 | public IMAGE_DATA_DIRECTORY LoadConfigTable; 150 | public IMAGE_DATA_DIRECTORY BoundImport; 151 | public IMAGE_DATA_DIRECTORY IAT; 152 | public IMAGE_DATA_DIRECTORY DelayImportDescriptor; 153 | public IMAGE_DATA_DIRECTORY CLRRuntimeHeader; 154 | public IMAGE_DATA_DIRECTORY Reserved; 155 | } 156 | 157 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 158 | public struct IMAGE_FILE_HEADER 159 | { 160 | public UInt16 Machine; 161 | public UInt16 NumberOfSections; 162 | public UInt32 TimeDateStamp; 163 | public UInt32 PointerToSymbolTable; 164 | public UInt32 NumberOfSymbols; 165 | public UInt16 SizeOfOptionalHeader; 166 | public UInt16 Characteristics; 167 | } 168 | 169 | // Grabbed the following 2 definitions from http://www.pinvoke.net/default.aspx/Structures/IMAGE_SECTION_HEADER.html 170 | 171 | [StructLayout(LayoutKind.Explicit)] 172 | public struct IMAGE_SECTION_HEADER 173 | { 174 | [FieldOffset(0)] 175 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] 176 | public char[] Name; 177 | [FieldOffset(8)] 178 | public UInt32 VirtualSize; 179 | [FieldOffset(12)] 180 | public UInt32 VirtualAddress; 181 | [FieldOffset(16)] 182 | public UInt32 SizeOfRawData; 183 | [FieldOffset(20)] 184 | public UInt32 PointerToRawData; 185 | [FieldOffset(24)] 186 | public UInt32 PointerToRelocations; 187 | [FieldOffset(28)] 188 | public UInt32 PointerToLinenumbers; 189 | [FieldOffset(32)] 190 | public UInt16 NumberOfRelocations; 191 | [FieldOffset(34)] 192 | public UInt16 NumberOfLinenumbers; 193 | [FieldOffset(36)] 194 | public DataSectionFlags Characteristics; 195 | 196 | public string Section 197 | { 198 | get { return new string(Name); } 199 | } 200 | } 201 | 202 | [Flags] 203 | public enum DataSectionFlags : uint 204 | { 205 | /// 206 | /// Reserved for future use. 207 | /// 208 | TypeReg = 0x00000000, 209 | /// 210 | /// Reserved for future use. 211 | /// 212 | TypeDsect = 0x00000001, 213 | /// 214 | /// Reserved for future use. 215 | /// 216 | TypeNoLoad = 0x00000002, 217 | /// 218 | /// Reserved for future use. 219 | /// 220 | TypeGroup = 0x00000004, 221 | /// 222 | /// The section should not be padded to the next boundary. This flag is obsolete and is replaced by IMAGE_SCN_ALIGN_1BYTES. This is valid only for object files. 223 | /// 224 | TypeNoPadded = 0x00000008, 225 | /// 226 | /// Reserved for future use. 227 | /// 228 | TypeCopy = 0x00000010, 229 | /// 230 | /// The section contains executable code. 231 | /// 232 | ContentCode = 0x00000020, 233 | /// 234 | /// The section contains initialized data. 235 | /// 236 | ContentInitializedData = 0x00000040, 237 | /// 238 | /// The section contains uninitialized data. 239 | /// 240 | ContentUninitializedData = 0x00000080, 241 | /// 242 | /// Reserved for future use. 243 | /// 244 | LinkOther = 0x00000100, 245 | /// 246 | /// The section contains comments or other information. The .drectve section has this type. This is valid for object files only. 247 | /// 248 | LinkInfo = 0x00000200, 249 | /// 250 | /// Reserved for future use. 251 | /// 252 | TypeOver = 0x00000400, 253 | /// 254 | /// The section will not become part of the image. This is valid only for object files. 255 | /// 256 | LinkRemove = 0x00000800, 257 | /// 258 | /// The section contains COMDAT data. For more information, see section 5.5.6, COMDAT Sections (Object Only). This is valid only for object files. 259 | /// 260 | LinkComDat = 0x00001000, 261 | /// 262 | /// Reset speculative exceptions handling bits in the TLB entries for this section. 263 | /// 264 | NoDeferSpecExceptions = 0x00004000, 265 | /// 266 | /// The section contains data referenced through the global pointer (GP). 267 | /// 268 | RelativeGP = 0x00008000, 269 | /// 270 | /// Reserved for future use. 271 | /// 272 | MemPurgeable = 0x00020000, 273 | /// 274 | /// Reserved for future use. 275 | /// 276 | Memory16Bit = 0x00020000, 277 | /// 278 | /// Reserved for future use. 279 | /// 280 | MemoryLocked = 0x00040000, 281 | /// 282 | /// Reserved for future use. 283 | /// 284 | MemoryPreload = 0x00080000, 285 | /// 286 | /// Align data on a 1-byte boundary. Valid only for object files. 287 | /// 288 | Align1Bytes = 0x00100000, 289 | /// 290 | /// Align data on a 2-byte boundary. Valid only for object files. 291 | /// 292 | Align2Bytes = 0x00200000, 293 | /// 294 | /// Align data on a 4-byte boundary. Valid only for object files. 295 | /// 296 | Align4Bytes = 0x00300000, 297 | /// 298 | /// Align data on an 8-byte boundary. Valid only for object files. 299 | /// 300 | Align8Bytes = 0x00400000, 301 | /// 302 | /// Align data on a 16-byte boundary. Valid only for object files. 303 | /// 304 | Align16Bytes = 0x00500000, 305 | /// 306 | /// Align data on a 32-byte boundary. Valid only for object files. 307 | /// 308 | Align32Bytes = 0x00600000, 309 | /// 310 | /// Align data on a 64-byte boundary. Valid only for object files. 311 | /// 312 | Align64Bytes = 0x00700000, 313 | /// 314 | /// Align data on a 128-byte boundary. Valid only for object files. 315 | /// 316 | Align128Bytes = 0x00800000, 317 | /// 318 | /// Align data on a 256-byte boundary. Valid only for object files. 319 | /// 320 | Align256Bytes = 0x00900000, 321 | /// 322 | /// Align data on a 512-byte boundary. Valid only for object files. 323 | /// 324 | Align512Bytes = 0x00A00000, 325 | /// 326 | /// Align data on a 1024-byte boundary. Valid only for object files. 327 | /// 328 | Align1024Bytes = 0x00B00000, 329 | /// 330 | /// Align data on a 2048-byte boundary. Valid only for object files. 331 | /// 332 | Align2048Bytes = 0x00C00000, 333 | /// 334 | /// Align data on a 4096-byte boundary. Valid only for object files. 335 | /// 336 | Align4096Bytes = 0x00D00000, 337 | /// 338 | /// Align data on an 8192-byte boundary. Valid only for object files. 339 | /// 340 | Align8192Bytes = 0x00E00000, 341 | /// 342 | /// The section contains extended relocations. 343 | /// 344 | LinkExtendedRelocationOverflow = 0x01000000, 345 | /// 346 | /// The section can be discarded as needed. 347 | /// 348 | MemoryDiscardable = 0x02000000, 349 | /// 350 | /// The section cannot be cached. 351 | /// 352 | MemoryNotCached = 0x04000000, 353 | /// 354 | /// The section is not pageable. 355 | /// 356 | MemoryNotPaged = 0x08000000, 357 | /// 358 | /// The section can be shared in memory. 359 | /// 360 | MemoryShared = 0x10000000, 361 | /// 362 | /// The section can be executed as code. 363 | /// 364 | MemoryExecute = 0x20000000, 365 | /// 366 | /// The section can be read. 367 | /// 368 | MemoryRead = 0x40000000, 369 | /// 370 | /// The section can be written to. 371 | /// 372 | MemoryWrite = 0x80000000 373 | } 374 | 375 | #endregion File Header Structures 376 | 377 | #region Private Fields 378 | 379 | /// 380 | /// The DOS header 381 | /// 382 | private IMAGE_DOS_HEADER dosHeader; 383 | /// 384 | /// The file header 385 | /// 386 | private IMAGE_FILE_HEADER fileHeader; 387 | /// 388 | /// Optional 32 bit file header 389 | /// 390 | private IMAGE_OPTIONAL_HEADER32 optionalHeader32; 391 | /// 392 | /// Optional 64 bit file header 393 | /// 394 | private IMAGE_OPTIONAL_HEADER64 optionalHeader64; 395 | /// 396 | /// Image Section headers. Number of sections is in the file header. 397 | /// 398 | private IMAGE_SECTION_HEADER[] imageSectionHeaders; 399 | 400 | #endregion Private Fields 401 | 402 | #region Public Methods 403 | 404 | public PeHeaderReader(string filePath) 405 | { 406 | // Read in the DLL or EXE and get the timestamp 407 | using (FileStream stream = new FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read)) 408 | { 409 | BinaryReader reader = new BinaryReader(stream); 410 | dosHeader = FromBinaryReader(reader); 411 | 412 | // Add 4 bytes to the offset 413 | stream.Seek(dosHeader.e_lfanew, SeekOrigin.Begin); 414 | 415 | UInt32 ntHeadersSignature = reader.ReadUInt32(); 416 | fileHeader = FromBinaryReader(reader); 417 | if (this.Is32BitHeader) 418 | { 419 | optionalHeader32 = FromBinaryReader(reader); 420 | } 421 | else 422 | { 423 | optionalHeader64 = FromBinaryReader(reader); 424 | } 425 | 426 | imageSectionHeaders = new IMAGE_SECTION_HEADER[fileHeader.NumberOfSections]; 427 | for (int headerNo = 0; headerNo < imageSectionHeaders.Length; ++headerNo) 428 | { 429 | imageSectionHeaders[headerNo] = FromBinaryReader(reader); 430 | } 431 | 432 | } 433 | } 434 | 435 | /// 436 | /// Reads in a block from a file and converts it to the struct 437 | /// type specified by the template parameter 438 | /// 439 | /// 440 | /// 441 | /// 442 | public static T FromBinaryReader(BinaryReader reader) 443 | { 444 | // Read in a byte array 445 | byte[] bytes = reader.ReadBytes(Marshal.SizeOf(typeof(T))); 446 | 447 | // Pin the managed memory while, copy it out the data, then unpin it 448 | GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned); 449 | T theStructure = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T)); 450 | handle.Free(); 451 | 452 | return theStructure; 453 | } 454 | 455 | #endregion Public Methods 456 | 457 | #region Properties 458 | 459 | /// 460 | /// Gets if the file header is 32 bit or not 461 | /// 462 | public bool Is32BitHeader 463 | { 464 | get 465 | { 466 | UInt16 IMAGE_FILE_32BIT_MACHINE = 0x0100; 467 | return (IMAGE_FILE_32BIT_MACHINE & FileHeader.Characteristics) == IMAGE_FILE_32BIT_MACHINE; 468 | } 469 | } 470 | 471 | /// 472 | /// Gets the file header 473 | /// 474 | public IMAGE_FILE_HEADER FileHeader 475 | { 476 | get 477 | { 478 | return fileHeader; 479 | } 480 | } 481 | 482 | /// 483 | /// Gets the optional header 484 | /// 485 | public IMAGE_OPTIONAL_HEADER32 OptionalHeader32 486 | { 487 | get 488 | { 489 | return optionalHeader32; 490 | } 491 | } 492 | 493 | /// 494 | /// Gets the optional header 495 | /// 496 | public IMAGE_OPTIONAL_HEADER64 OptionalHeader64 497 | { 498 | get 499 | { 500 | return optionalHeader64; 501 | } 502 | } 503 | 504 | public IMAGE_SECTION_HEADER[] ImageSectionHeaders 505 | { 506 | get 507 | { 508 | return imageSectionHeaders; 509 | } 510 | } 511 | 512 | /// 513 | /// Gets the timestamp from the file header 514 | /// 515 | public DateTime TimeStamp 516 | { 517 | get 518 | { 519 | // Timestamp is a date offset from 1970 520 | DateTime returnValue = new DateTime(1970, 1, 1, 0, 0, 0); 521 | 522 | // Add in the number of seconds since 1970/1/1 523 | returnValue = returnValue.AddSeconds(fileHeader.TimeDateStamp); 524 | // Adjust to local timezone 525 | returnValue += TimeZone.CurrentTimeZone.GetUtcOffset(returnValue); 526 | 527 | return returnValue; 528 | } 529 | } 530 | 531 | #endregion Properties 532 | } 533 | } 534 | --------------------------------------------------------------------------------