├── .gitignore
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── Galaxy Swapper v2.csproj
├── Galaxy Swapper v2.csproj.user
├── Galaxy Swapper v2.sln
├── LICENSE
├── README.md
└── Workspace
├── Assets
├── Arrow.png
├── Backpacks.png
├── Backpacks_Clicked.png
├── Banner.png
├── Character.png
├── Characters.png
├── Characters_Clicked.png
├── Close.png
├── Dances.png
├── Dances_Clicked.png
├── Dashboard.png
├── Dashboard_Clicked.png
├── Discord.png
├── Embed.png
├── Failed.png
├── FallBackCosmeticImage.png
├── FallBackImage.png
├── FallBackPluginImage.png
├── Gliders.png
├── Gliders_Clicked.png
├── Hide.png
├── LoginPage.png
├── Logo.ico
├── Logo.png
├── Minimize.png
├── Misc.png
├── Misc_Clicked.png
├── Pickaxes.png
├── Pickaxes_Clicked.png
├── Plugins.png
├── Plugins_Clicked.png
├── ReImport.png
├── Remove.png
├── Searchbar.png
├── Searching.png
├── Settings.png
├── Settings_Clicked.png
├── Show.png
├── ThumbsUp.png
├── Wave.png
├── Weapons.png
├── Weapons_Clicked.png
├── oo2core_5_win64.dll
└── oo2core_9_win64.dll
├── CProvider
├── CProviderManager.cs
├── DefaultFileProvider.cs
├── Encryption
│ ├── FAesKey.cs
│ └── UnrealAes.cs
├── FIoStoreTocHeader.cs
├── FIoStoreTocResource.cs
├── IoStoreReader.cs
├── Objects
│ ├── CompressionMethod.cs
│ ├── EObjectFlags.cs
│ ├── EPackageFlags.cs
│ ├── FBulkDataMapEntry.cs
│ ├── FExportMapEntry.cs
│ ├── FGuid.cs
│ ├── FIoChunkId.cs
│ ├── FIoContainerId.cs
│ ├── FIoDirectoryIndexEntry.cs
│ ├── FIoFileIndexEntry.cs
│ ├── FIoOffsetAndLength.cs
│ ├── FIoStoreTocCompressedBlockEntry.cs
│ ├── FMappedName.cs
│ ├── FNameEntrySerialized.cs
│ ├── FPackageImportReference.cs
│ ├── FPackageObjectIndex.cs
│ ├── FZenPackageSummary.cs
│ └── GameFile.cs
└── README.md
├── ClientSettings
├── ClientSettingsData.cs
└── Objects
│ └── FCustomVersion.cs
├── Components
├── CCloseControl.xaml
├── CCloseControl.xaml.cs
├── CLobbyControl.xaml
├── CLobbyControl.xaml.cs
├── CMessageboxControl.xaml
├── CMessageboxControl.xaml.cs
├── CMinimizeControl.xaml
├── CMinimizeControl.xaml.cs
├── CNewsControl.xaml
├── CNewsControl.xaml.cs
├── CPluginControl.xaml
├── CPluginControl.xaml.cs
├── CSearchbarControl.xaml
├── CSearchbarControl.xaml.cs
├── CSettingsControl.xaml
├── CSettingsControl.xaml.cs
├── CSocialControl.xaml
├── CSocialControl.xaml.cs
├── CSwappedControl.xaml
├── CSwappedControl.xaml.cs
├── CTabControl.xaml
└── CTabControl.xaml.cs
├── Compression
├── aes.cs
├── gzip.cs
└── zlib.cs
├── Generation
├── Formats
│ ├── Asset.cs
│ ├── Cosmetic.cs
│ ├── Downloadable.cs
│ ├── Frontend.cs
│ ├── Option.cs
│ └── StreamData.cs
├── Generate.cs
└── Types
│ ├── Dances.cs
│ ├── Gliders.cs
│ ├── Neutral.cs
│ └── Weapons.cs
├── Global.cs
├── Hashes
├── CityHash.cs
├── Fnv1a.cs
├── MD5.cs
└── SHA1Hash.cs
├── Plugins
├── Compression.cs
├── Plugin.cs
└── Validate.cs
├── Properties
├── Account.cs
├── Binaries.cs
├── Colors.cs
├── Config.cs
├── ImageCache.cs
├── Output.cs
├── Settings.cs
├── SwapLogs.cs
└── UEFN.cs
├── Structs
├── BinaryData.cs
├── LobbyData.cs
├── MaterialData.cs
├── MaterialOverrideFlagsData.cs
├── OverrideMaterial.cs
├── PluginData.cs
├── Social.cs
├── TextureData.cs
└── TextureParameter.cs
├── Swapping
├── Compression
│ └── Types
│ │ └── Oodle.cs
├── LobbyBGSwap.cs
├── Other
│ ├── CustomEpicGamesLauncher.cs
│ ├── Pakchunks.cs
│ ├── Reader.cs
│ └── Writer.cs
├── Providers
│ ├── AesProvider.cs
│ └── StreamDataProvider.cs
├── Sterilization
│ ├── Deserializer.cs
│ └── Serializer.cs
└── Swap.cs
├── Usercontrols
├── CosmeticsView.xaml
├── CosmeticsView.xaml.cs
├── DashboardView.xaml
├── DashboardView.xaml.cs
├── LoginView.xaml
├── LoginView.xaml.cs
├── MiscView.xaml
├── MiscView.xaml.cs
├── Overlays
│ ├── AuthenticateView.xaml
│ ├── AuthenticateView.xaml.cs
│ ├── DiscordView.xaml
│ ├── DiscordView.xaml.cs
│ ├── EpicGamesLauncherDirEmpty.xaml
│ ├── EpicGamesLauncherDirEmpty.xaml.cs
│ ├── FortniteDirEmpty.xaml
│ ├── FortniteDirEmpty.xaml.cs
│ ├── FovView.xaml
│ ├── FovView.xaml.cs
│ ├── LanguageSelectionView.xaml
│ ├── LanguageSelectionView.xaml.cs
│ ├── LobbyView.xaml
│ ├── LobbyView.xaml.cs
│ ├── NoOptionsView.xaml
│ ├── NoOptionsView.xaml.cs
│ ├── NotesView.xaml
│ ├── NotesView.xaml.cs
│ ├── OptionsView.xaml
│ ├── OptionsView.xaml.cs
│ ├── SwapView.xaml
│ ├── SwapView.xaml.cs
│ ├── SwappedView.xaml
│ ├── SwappedView.xaml.cs
│ ├── VerifyView.xaml
│ └── VerifyView.xaml.cs
├── PluginsView.xaml
├── PluginsView.xaml.cs
├── SettingsView.xaml
├── SettingsView.xaml.cs
├── SplashView.xaml
└── SplashView.xaml.cs
├── Utilities
├── AlignUtils.cs
├── CosmeticTracker.cs
├── Encryption.cs
├── Endpoint.cs
├── EpicGamesLauncher.cs
├── HexUtils.cs
├── Interface.cs
├── Languages.cs
├── Memory.cs
├── Message.cs
├── Misc.cs
├── Presence.cs
├── StringUtils.cs
└── Win32.cs
├── Verify
├── EpicGames
│ ├── LiveManifest.cs
│ └── OAuth.cs
└── EpicManifestParser
│ ├── Enums
│ ├── EChunkDataListVersion.cs
│ ├── EFeatureLevel.cs
│ ├── EFileManifestListVersion.cs
│ ├── EManifestMetaVersion.cs
│ └── EManifestStorageFlags.cs
│ ├── Objects
│ ├── ContentBuildManifestInfo.cs
│ ├── DownloadableManifestInfo.cs
│ ├── FStringMemory.cs
│ ├── FileChunk.cs
│ ├── FileChunkPart.cs
│ ├── FileManifest.cs
│ ├── FileManifestStream.cs
│ ├── Manifest.cs
│ ├── ManifestInfo.cs
│ └── ManifestOptions.cs
│ └── Utilities.cs
└── Views
├── MainView.xaml
└── MainView.xaml.cs
/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Galaxy_Swapper_v2.Workspace;
2 | using Galaxy_Swapper_v2.Workspace.ClientSettings;
3 | using Galaxy_Swapper_v2.Workspace.Properties;
4 | using Galaxy_Swapper_v2.Workspace.Utilities;
5 | using Serilog;
6 | using System;
7 | using System.Diagnostics;
8 | using System.IO;
9 | using System.Runtime.InteropServices;
10 | using System.Windows;
11 | using System.Windows.Threading;
12 |
13 | namespace Galaxy_Swapper_v2
14 | {
15 | public partial class App : Application
16 | {
17 | public static readonly string Config = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\Galaxy-Swapper-v2-Config";
18 | public static readonly string[] SubDirectories = { $"{Config}\\DLLS", $"{Config}\\Plugins", $"{Config}\\LOGS", $"{Config}\\Binaries" };
19 | protected override void OnStartup(StartupEventArgs e)
20 | {
21 | Process[] currentprocess = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
22 | if (currentprocess.Length > 1)
23 | {
24 | Win32.SetProcessHigher(currentprocess);
25 | Message.DisplaySTA("Info", "It has been detected that Galaxy Swapper is already running. The process will be brought to the front.\nIf there is an issue, please end the 'Galaxy Swapper v2' process in Task Manager and restart the application.");
26 | Environment.Exit(0);
27 | }
28 |
29 | if (File.Exists($"{Config}\\Key.config")) //Remove old config folder
30 | {
31 | Directory.Delete(Config, true);
32 | }
33 |
34 | if (!Directory.Exists(Config)) //Create config folder
35 | {
36 | Directory.CreateDirectory(Config);
37 | }
38 |
39 | foreach (string sub in SubDirectories)
40 | {
41 | Directory.CreateDirectory(sub);
42 | }
43 |
44 | Output.Initialize(); //Serilog logger
45 |
46 | Log.Information("Version {0}", Global.Version);
47 | Log.Information("API-Version {0}", Global.ApiVersion);
48 | Log.Information("Runtime {0}", RuntimeInformation.FrameworkDescription);
49 | Log.Information("Config-Path: {0}", Config);
50 |
51 | Settings.Initialize();
52 | SwapLogs.Initialize();
53 | UEFN.Initialize();
54 | Binaries.Initialize();
55 |
56 | base.OnStartup(e);
57 | }
58 |
59 | private void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
60 | {
61 | Log.Fatal("Application caught a unexpected error and can not recover");
62 | Log.Fatal(e.Exception.ToString());
63 |
64 | Message.DisplaySTA("Error", $"Application caught a unexpected error and can not recover.\n{e.Exception}", discord: true);
65 | }
66 |
67 | private void App_Exit(object sender, ExitEventArgs e)
68 | {
69 | Log.Information("Shutting down application..");
70 | Log.CloseAndFlush();
71 | }
72 | }
73 | }
--------------------------------------------------------------------------------
/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/Galaxy Swapper v2.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.5.33516.290
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Galaxy Swapper v2", "Galaxy Swapper v2.csproj", "{81FB98CD-6746-4BCD-8C35-276ED97435E5}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {81FB98CD-6746-4BCD-8C35-276ED97435E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {81FB98CD-6746-4BCD-8C35-276ED97435E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {81FB98CD-6746-4BCD-8C35-276ED97435E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {81FB98CD-6746-4BCD-8C35-276ED97435E5}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {ED408D3F-BB15-41DD-9AF9-D8666349CAFA}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Galaxy Swapper v2
2 |
3 | Revamp your Fortnite experience with our skin swapper designed for the latest version of Fortnite. This repository contains the source code for Galaxy Swapper v2.
4 |
5 | Note: It is recommended to download Galaxy Swapper v2 from [here](https://galaxyswapperv2.com/Downloads/InGame.php) instead of rebuilding it yourself.
6 |
7 | ## What is Galaxy Swapper v2?
8 |
9 | Galaxy Swapper v2 is a free Fortnite skin changer built in WPF that allows you to modify your game files to replace a cosmetic you own with a cosmetic you desire, all with ease. We have also developed a simple and user-friendly user-interface for your convenience.
10 |
11 | ## Social media links
12 | * [Discord](https://galaxyswapperv2.com/Discord)
13 | * [Website](https://galaxyswapperv2.com)
14 |
15 | ## Packages used in our application
16 |
17 | * [CUE4Parse](https://github.com/FabianFG/CUE4Parse)
18 | * [DotNetZip](https://github.com/haf/DotNetZip.Semverd)
19 | * [K4os.Compression.LZ4](https://github.com/MiloszKrajewski/K4os.Compression.LZ4)
20 | * [Newtonsoft.Json](https://www.newtonsoft.com/json)
21 | * [Serilog](https://serilog.net)
22 |
23 | ## Endpoints used in our application
24 |
25 | * [Fortnite-Api](https://dash.fortnite-api.com)
26 |
27 | ## Authors
28 |
29 | * [@Wslt](https://github.com/CodeWslt)
30 |
31 | ## License
32 |
33 | Galaxy Swapper v2 is licensed under [GNU General Public License v3.0](https://github.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/blob/main/LICENSE)
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Workspace/Assets/Arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Arrow.png
--------------------------------------------------------------------------------
/Workspace/Assets/Backpacks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Backpacks.png
--------------------------------------------------------------------------------
/Workspace/Assets/Backpacks_Clicked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Backpacks_Clicked.png
--------------------------------------------------------------------------------
/Workspace/Assets/Banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Banner.png
--------------------------------------------------------------------------------
/Workspace/Assets/Character.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Character.png
--------------------------------------------------------------------------------
/Workspace/Assets/Characters.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Characters.png
--------------------------------------------------------------------------------
/Workspace/Assets/Characters_Clicked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Characters_Clicked.png
--------------------------------------------------------------------------------
/Workspace/Assets/Close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Close.png
--------------------------------------------------------------------------------
/Workspace/Assets/Dances.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Dances.png
--------------------------------------------------------------------------------
/Workspace/Assets/Dances_Clicked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Dances_Clicked.png
--------------------------------------------------------------------------------
/Workspace/Assets/Dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Dashboard.png
--------------------------------------------------------------------------------
/Workspace/Assets/Dashboard_Clicked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Dashboard_Clicked.png
--------------------------------------------------------------------------------
/Workspace/Assets/Discord.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Discord.png
--------------------------------------------------------------------------------
/Workspace/Assets/Embed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Embed.png
--------------------------------------------------------------------------------
/Workspace/Assets/Failed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Failed.png
--------------------------------------------------------------------------------
/Workspace/Assets/FallBackCosmeticImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/FallBackCosmeticImage.png
--------------------------------------------------------------------------------
/Workspace/Assets/FallBackImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/FallBackImage.png
--------------------------------------------------------------------------------
/Workspace/Assets/FallBackPluginImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/FallBackPluginImage.png
--------------------------------------------------------------------------------
/Workspace/Assets/Gliders.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Gliders.png
--------------------------------------------------------------------------------
/Workspace/Assets/Gliders_Clicked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Gliders_Clicked.png
--------------------------------------------------------------------------------
/Workspace/Assets/Hide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Hide.png
--------------------------------------------------------------------------------
/Workspace/Assets/LoginPage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/LoginPage.png
--------------------------------------------------------------------------------
/Workspace/Assets/Logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Logo.ico
--------------------------------------------------------------------------------
/Workspace/Assets/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Logo.png
--------------------------------------------------------------------------------
/Workspace/Assets/Minimize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Minimize.png
--------------------------------------------------------------------------------
/Workspace/Assets/Misc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Misc.png
--------------------------------------------------------------------------------
/Workspace/Assets/Misc_Clicked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Misc_Clicked.png
--------------------------------------------------------------------------------
/Workspace/Assets/Pickaxes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Pickaxes.png
--------------------------------------------------------------------------------
/Workspace/Assets/Pickaxes_Clicked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Pickaxes_Clicked.png
--------------------------------------------------------------------------------
/Workspace/Assets/Plugins.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Plugins.png
--------------------------------------------------------------------------------
/Workspace/Assets/Plugins_Clicked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Plugins_Clicked.png
--------------------------------------------------------------------------------
/Workspace/Assets/ReImport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/ReImport.png
--------------------------------------------------------------------------------
/Workspace/Assets/Remove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Remove.png
--------------------------------------------------------------------------------
/Workspace/Assets/Searchbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Searchbar.png
--------------------------------------------------------------------------------
/Workspace/Assets/Searching.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Searching.png
--------------------------------------------------------------------------------
/Workspace/Assets/Settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Settings.png
--------------------------------------------------------------------------------
/Workspace/Assets/Settings_Clicked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Settings_Clicked.png
--------------------------------------------------------------------------------
/Workspace/Assets/Show.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Show.png
--------------------------------------------------------------------------------
/Workspace/Assets/ThumbsUp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/ThumbsUp.png
--------------------------------------------------------------------------------
/Workspace/Assets/Wave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Wave.png
--------------------------------------------------------------------------------
/Workspace/Assets/Weapons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Weapons.png
--------------------------------------------------------------------------------
/Workspace/Assets/Weapons_Clicked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/Weapons_Clicked.png
--------------------------------------------------------------------------------
/Workspace/Assets/oo2core_5_win64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/oo2core_5_win64.dll
--------------------------------------------------------------------------------
/Workspace/Assets/oo2core_9_win64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/1c8ff7291c9d4a96ded805144d438cfd506f7b21/Workspace/Assets/oo2core_9_win64.dll
--------------------------------------------------------------------------------
/Workspace/CProvider/Encryption/FAesKey.cs:
--------------------------------------------------------------------------------
1 | using Galaxy_Swapper_v2.Workspace.Utilities;
2 | using System;
3 |
4 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Encryption
5 | {
6 | public class FAesKey
7 | {
8 | public readonly byte[] Key;
9 | public readonly string KeyString;
10 |
11 | public FAesKey(byte[] key)
12 | {
13 | if (key.Length != 32)
14 | throw new ArgumentException("Aes Key must be 32 bytes long");
15 | Key = key;
16 | KeyString = "0x" + BitConverter.ToString(key);
17 | }
18 |
19 | public FAesKey(string keyString)
20 | {
21 | if (!keyString.StartsWith("0x"))
22 | keyString = "0x" + keyString;
23 | if (keyString.Length != 66)
24 | throw new ArgumentException("Aes Key must be 32 bytes long");
25 | KeyString = keyString;
26 | Key = keyString.Substring(2).ParseHexBinary();
27 | }
28 |
29 | public override string ToString() => KeyString;
30 | }
31 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Encryption/UnrealAes.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Runtime.CompilerServices;
3 | using System.Security.Cryptography;
4 | using AesProvider = System.Security.Cryptography.Aes;
5 |
6 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Encryption
7 | {
8 | public static class UnrealAes
9 | {
10 | public const int ALIGN = 16;
11 | public const int BLOCK_SIZE = 16 * 8;
12 | private static AesProvider Provider;
13 |
14 | public static byte[] Encrypt(byte[] plaintext, byte[] AESKey)
15 | {
16 | Provider = AesProvider.Create();
17 | Provider.Key = AESKey;
18 | Provider.Mode = CipherMode.ECB;
19 | Provider.Padding = PaddingMode.PKCS7;
20 |
21 | ICryptoTransform encryptor = Provider.CreateEncryptor(Provider.Key, Provider.IV);
22 |
23 | using (MemoryStream msEncrypt = new MemoryStream())
24 | {
25 | using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))
26 | {
27 | csEncrypt.Write(plaintext, 0, plaintext.Length);
28 | }
29 | return msEncrypt.ToArray();
30 | }
31 | }
32 |
33 | [MethodImpl(MethodImplOptions.AggressiveInlining)]
34 | public static byte[] Decrypt(this byte[] encrypted, FAesKey key)
35 | {
36 | Provider = AesProvider.Create();
37 | Provider.Mode = CipherMode.ECB;
38 | Provider.Padding = PaddingMode.None;
39 | Provider.BlockSize = BLOCK_SIZE;
40 |
41 | return Provider.CreateDecryptor(key.Key, null).TransformFinalBlock(encrypted, 0, encrypted.Length);
42 | }
43 | }
44 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/CompressionMethod.cs:
--------------------------------------------------------------------------------
1 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
2 | {
3 | public enum CompressionMethod
4 | {
5 | None = 0,
6 | Zlib = 1,
7 | Gzip = 2, //???
8 | Custom = 3,
9 | Oodle = 4,
10 | LZ4,
11 | Zstd,
12 | Unknown
13 | }
14 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/EPackageFlags.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
4 | {
5 | [Flags]
6 | public enum EPackageFlags : uint
7 | {
8 | PKG_None = 0x00000000, ///< No flags
9 | PKG_NewlyCreated = 0x00000001, ///< Newly created package, not saved yet. In editor only.
10 | PKG_ClientOptional = 0x00000002, ///< Purely optional for clients.
11 | PKG_ServerSideOnly = 0x00000004, ///< Only needed on the server side.
12 | PKG_CompiledIn = 0x00000010, ///< This package is from "compiled in" classes.
13 | PKG_ForDiffing = 0x00000020, ///< This package was loaded just for the purposes of diffing
14 | PKG_EditorOnly = 0x00000040, ///< This is editor-only package (for example: editor module script package)
15 | PKG_Developer = 0x00000080, ///< Developer module
16 | PKG_UncookedOnly = 0x00000100, ///< Loaded only in uncooked builds (i.e. runtime in editor)
17 | PKG_Cooked = 0x00000200, ///< Package is cooked
18 | PKG_ContainsNoAsset = 0x00000400, ///< Package doesn't contain any asset object (although asset tags can be present)
19 | // PKG_Unused = 0x00000800,
20 | // PKG_Unused = 0x00001000,
21 | PKG_UnversionedProperties = 0x00002000, ///< Uses unversioned property serialization instead of versioned tagged property serialization
22 | PKG_ContainsMapData = 0x00004000, ///< Contains map data (UObjects only referenced by a single ULevel) but is stored in a different package
23 | // PKG_Unused = 0x00008000,
24 | PKG_Compiling = 0x00010000, ///< package is currently being compiled
25 | PKG_ContainsMap = 0x00020000, ///< Set if the package contains a ULevel/ UWorld object
26 | PKG_RequiresLocalizationGather = 0x00040000, ///< Set if the package contains any data to be gathered by localization
27 | // PKG_Unused = 0x00080000,
28 | PKG_PlayInEditor = 0x00100000, ///< Set if the package was created for the purpose of PIE
29 | PKG_ContainsScript = 0x00200000, ///< Package is allowed to contain UClass objects
30 | PKG_DisallowExport = 0x00400000, ///< Editor should not export asset in this package
31 | // PKG_Unused = 0x00800000,
32 | // PKG_Unused = 0x01000000,
33 | // PKG_Unused = 0x02000000,
34 | // PKG_Unused = 0x04000000,
35 | // PKG_Unused = 0x08000000,
36 | PKG_DynamicImports = 0x10000000, ///< This package should resolve dynamic imports from its export at runtime.
37 | PKG_RuntimeGenerated = 0x20000000, ///< This package contains elements that are runtime generated, and may not follow standard loading order rules
38 | PKG_ReloadingForCooker = 0x40000000, ///< This package is reloading in the cooker, try to avoid getting data we will never need. We won't save this package.
39 | PKG_FilterEditorOnly = 0x80000000, ///< Package has editor-only data filtered out
40 | }
41 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FBulkDataMapEntry.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
4 | {
5 | [StructLayout(LayoutKind.Sequential, Pack = 1)]
6 | public struct FBulkDataMapEntry
7 | {
8 | public const uint Size = 32;
9 |
10 | public ulong SerialOffset;
11 | public ulong DuplicateSerialOffset;
12 | public ulong SerialSize;
13 | public uint Flags;
14 | public uint Pad;
15 | }
16 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FExportMapEntry.cs:
--------------------------------------------------------------------------------
1 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
2 | {
3 | public struct FExportMapEntry
4 | {
5 | public const int Size = 72;
6 |
7 | public ulong CookedSerialOffset;
8 | public ulong CookedSerialSize;
9 | public FMappedName ObjectName;
10 | public FPackageObjectIndex OuterIndex;
11 | public FPackageObjectIndex ClassIndex;
12 | public FPackageObjectIndex SuperIndex;
13 | public FPackageObjectIndex TemplateIndex;
14 | public FPackageObjectIndex GlobalImportIndex;
15 | public ulong PublicExportHash;
16 | public EObjectFlags ObjectFlags;
17 | public byte FilterFlags; // EExportFilterFlags: client/server flags
18 | }
19 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FIoChunkId.cs:
--------------------------------------------------------------------------------
1 | using Galaxy_Swapper_v2.Workspace.Swapping.Other;
2 |
3 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
4 | {
5 | public readonly struct FIoChunkId
6 | {
7 | public readonly ulong ChunkId;
8 | public readonly ushort _chunkIndex;
9 | public readonly byte _padding;
10 | public readonly byte ChunkType;
11 | public readonly long Position;
12 | public FIoChunkId(Reader reader)
13 | {
14 | Position = reader.Position;
15 | ChunkId = reader.Read();
16 | _chunkIndex = reader.Read();
17 | _padding = reader.Read();
18 | ChunkType = reader.Read();
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FIoContainerId.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
4 | {
5 | [StructLayout(LayoutKind.Sequential)]
6 | public readonly struct FIoContainerId
7 | {
8 | public readonly ulong Id;
9 | public override string ToString()
10 | {
11 | return Id.ToString();
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FIoDirectoryIndexEntry.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
4 | {
5 | [StructLayout(LayoutKind.Sequential)]
6 | public readonly struct FIoDirectoryIndexEntry
7 | {
8 | public readonly uint Name;
9 | public readonly uint FirstChildEntry;
10 | public readonly uint NextSiblingEntry;
11 | public readonly uint FirstFileEntry;
12 | }
13 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FIoFileIndexEntry.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
4 | {
5 | [StructLayout(LayoutKind.Sequential)]
6 | public readonly struct FIoFileIndexEntry
7 | {
8 | public readonly uint Name;
9 | public readonly uint NextFileEntry;
10 | public readonly uint UserData;
11 | }
12 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FIoOffsetAndLength.cs:
--------------------------------------------------------------------------------
1 | using Galaxy_Swapper_v2.Workspace.Swapping.Other;
2 |
3 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
4 | {
5 | public readonly struct FIoOffsetAndLength
6 | {
7 | public readonly ulong Offset;
8 | public readonly ulong Length;
9 | public readonly long Position;
10 | public readonly byte[] Buffer;
11 | public FIoOffsetAndLength(Reader reader)
12 | {
13 | Position = reader.Position;
14 | Buffer = reader.ReadBytes(12);
15 | reader.Position = Position;
16 |
17 | unsafe
18 | {
19 | var offsetAndLength = stackalloc byte[10];
20 | reader.Serialize(offsetAndLength, 10);
21 | Offset = offsetAndLength[4]
22 | | ((ulong)offsetAndLength[3] << 8)
23 | | ((ulong)offsetAndLength[2] << 16)
24 | | ((ulong)offsetAndLength[1] << 24)
25 | | ((ulong)offsetAndLength[0] << 32);
26 | Length = offsetAndLength[9]
27 | | ((ulong)offsetAndLength[8] << 8)
28 | | ((ulong)offsetAndLength[7] << 16)
29 | | ((ulong)offsetAndLength[6] << 24)
30 | | ((ulong)offsetAndLength[5] << 32);
31 | }
32 | }
33 |
34 | public override string ToString()
35 | {
36 | return $"{nameof(Offset)} {Offset} | {nameof(Length)} {Length}";
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FIoStoreTocCompressedBlockEntry.cs:
--------------------------------------------------------------------------------
1 | using Galaxy_Swapper_v2.Workspace.Swapping.Other;
2 |
3 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
4 | {
5 | public readonly struct FIoStoreTocCompressedBlockEntry
6 | {
7 | private const int OffsetBits = 40;
8 | private const ulong OffsetMask = (1ul << OffsetBits) - 1ul;
9 | private const int SizeBits = 24;
10 | private const uint SizeMask = (1 << SizeBits) - 1;
11 | private const int SizeShift = 8;
12 |
13 | public readonly long Offset;
14 | public readonly uint CompressedSize;
15 | public readonly uint UncompressedSize;
16 | public readonly byte CompressionMethodIndex;
17 | public readonly long Position;
18 | public readonly byte[] Buffer;
19 |
20 | public FIoStoreTocCompressedBlockEntry(Reader reader)
21 | {
22 | Position = reader.Position;
23 | Buffer = reader.ReadBytes(12);
24 | reader.Position = Position;
25 |
26 | unsafe
27 | {
28 | var data = stackalloc byte[5 + 3 + 3 + 1];
29 | reader.Serialize(data, 5 + 3 + 3 + 1);
30 | Offset = (long)(*(ulong*)data & OffsetMask);
31 | CompressedSize = (*((uint*)data + 1) >> SizeShift) & SizeMask;
32 | UncompressedSize = *((uint*)data + 2) & SizeMask;
33 | CompressionMethodIndex = (byte)(*((uint*)data + 2) >> SizeBits);
34 | }
35 | }
36 |
37 | public override string ToString()
38 | {
39 | return $"{nameof(Offset)} {Offset}: From {CompressedSize} To {UncompressedSize}";
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FMappedName.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
4 | {
5 | [StructLayout(LayoutKind.Sequential)]
6 | public readonly struct FMappedName
7 | {
8 | private const int IndexBits = 30;
9 | private const uint IndexMask = (1u << IndexBits) - 1u;
10 | private const uint TypeMask = ~IndexMask;
11 | private const int TypeShift = IndexBits;
12 |
13 | public readonly uint _nameIndex;
14 | public readonly uint ExtraIndex;
15 |
16 | public uint NameIndex => _nameIndex & IndexMask;
17 | public EType Type => (EType)((_nameIndex & TypeMask) >> TypeShift);
18 | public bool IsGlobal => ((_nameIndex & TypeMask) >> TypeShift) != 0;
19 |
20 | public enum EType
21 | {
22 | Package,
23 | Container,
24 | Global
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FNameEntrySerialized.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
5 | {
6 | public struct FNameEntrySerialized
7 | {
8 | public string? Name;
9 | public ulong hashVersion;
10 | #if NAME_HASHES
11 | public readonly ushort NonCasePreservingHash;
12 | public readonly ushort CasePreservingHash;
13 | #endif
14 |
15 | public FNameEntrySerialized(string name, ulong HashVersion = 0)
16 | {
17 | Name = name;
18 | hashVersion = HashVersion;
19 | }
20 | }
21 |
22 | [StructLayout(LayoutKind.Sequential, Pack = 1, Size = Size)]
23 | public readonly struct FSerializedNameHeader : IEquatable
24 | {
25 | public const int Size = 2;
26 |
27 | private readonly byte _data0;
28 | private readonly byte _data1;
29 |
30 | public bool IsUtf16 => (_data0 & 0x80u) != 0;
31 | public uint Length => ((_data0 & 0x7Fu) << 8) + _data1;
32 |
33 | public bool Equals(FSerializedNameHeader other)
34 | {
35 | return _data0 == other._data0 && _data1 == other._data1;
36 | }
37 |
38 | public override bool Equals(object? obj)
39 | {
40 | return obj is FSerializedNameHeader other && Equals(other);
41 | }
42 |
43 | public override int GetHashCode()
44 | {
45 | return HashCode.Combine(_data0, _data1);
46 | }
47 |
48 | public static bool operator ==(FSerializedNameHeader left, FSerializedNameHeader right)
49 | {
50 | return left.Equals(right);
51 | }
52 |
53 | public static bool operator !=(FSerializedNameHeader left, FSerializedNameHeader right)
54 | {
55 | return !left.Equals(right);
56 | }
57 | }
58 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FPackageImportReference.cs:
--------------------------------------------------------------------------------
1 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
2 | {
3 | public struct FPackageImportReference
4 | {
5 | public uint ImportedPackageIndex;
6 | public uint ImportedPublicExportHashIndex;
7 | }
8 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FPackageObjectIndex.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
5 | {
6 | [StructLayout(LayoutKind.Sequential)]
7 | public readonly struct FPackageObjectIndex : IEquatable
8 | {
9 | public const int Size = sizeof(ulong);
10 | public const int IndexBits = 62;
11 | public const ulong IndexMask = (1UL << IndexBits) - 1UL;
12 | public const ulong TypeMask = ~IndexMask;
13 | public const int TypeShift = IndexBits;
14 | public const ulong Invalid = ~0UL;
15 |
16 | public readonly ulong TypeAndId;
17 | public EType Type => (EType)(TypeAndId >> TypeShift);
18 | public ulong Value => TypeAndId & IndexMask;
19 |
20 | public bool IsNull => TypeAndId == Invalid;
21 | public bool IsExport => Type == EType.Export;
22 | public bool IsImport => IsScriptImport || IsPackageImport;
23 | public bool IsScriptImport => Type == EType.ScriptImport;
24 | public bool IsPackageImport => Type == EType.PackageImport;
25 | public uint AsExport => (uint)TypeAndId;
26 |
27 | public FPackageImportReference AsPackageImportRef => new()
28 | {
29 | ImportedPackageIndex = (uint)((TypeAndId & IndexMask) >> 32),
30 | ImportedPublicExportHashIndex = (uint)TypeAndId
31 | };
32 |
33 | public FPackageObjectIndex(ulong typeAndId)
34 | {
35 | TypeAndId = typeAndId;
36 | }
37 |
38 | public bool Equals(FPackageObjectIndex other)
39 | {
40 | return TypeAndId == other.TypeAndId;
41 | }
42 |
43 | public override bool Equals(object? obj)
44 | {
45 | return obj is FPackageObjectIndex other && Equals(other);
46 | }
47 |
48 | public override int GetHashCode()
49 | {
50 | return TypeAndId.GetHashCode();
51 | }
52 |
53 | public static bool operator ==(FPackageObjectIndex left, FPackageObjectIndex right)
54 | {
55 | return left.Equals(right);
56 | }
57 |
58 | public static bool operator !=(FPackageObjectIndex left, FPackageObjectIndex right)
59 | {
60 | return !left.Equals(right);
61 | }
62 | }
63 |
64 | public enum EType
65 | {
66 | Export,
67 | ScriptImport,
68 | PackageImport,
69 | Null,
70 | TypeCount = Null
71 | }
72 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/FZenPackageSummary.cs:
--------------------------------------------------------------------------------
1 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
2 | {
3 | public struct FZenPackageSummary
4 | {
5 | public uint bHasVersioningInfo;
6 | public uint HeaderSize;
7 | public FMappedName Name;
8 | public EPackageFlags PackageFlags;
9 | public uint CookedHeaderSize;
10 | public int ImportedPublicExportHashesOffset;
11 | public int ImportMapOffset;
12 | public int ExportMapOffset;
13 | public int ExportBundleEntriesOffset;
14 | public int GraphDataOffset;
15 | public int DependencyBundleHeadersOffset;
16 | public int DependencyBundleEntriesOffset;
17 | public int ImportedPackageNamesOffset;
18 | }
19 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/Objects/GameFile.cs:
--------------------------------------------------------------------------------
1 | namespace Galaxy_Swapper_v2.Workspace.CProvider.Objects
2 | {
3 | public class GameFile
4 | {
5 | public readonly string Path;
6 | public readonly long Size;
7 | public readonly uint TocEntryIndex;
8 | public readonly FIoOffsetAndLength ChunkOffsetLengths;
9 | public readonly FIoStoreTocHeader IoStoreTocHeader;
10 | public FIoStoreTocCompressedBlockEntry CompressionBlock;
11 | public FIoChunkId ChunkId;
12 | public string Ucas;
13 | public string LastUcas;
14 | public string Utoc;
15 | public int LastPartition;
16 | public long Offset;
17 | public byte[] CompressedBuffer;
18 | public byte[] UncompressedBuffer;
19 | public bool IsEncrypted;
20 | public GameFile(string path, uint tocentryindex, FIoOffsetAndLength chunkOffsetLengths, FIoStoreTocHeader ioStoreTocHeader)
21 | {
22 | Path = path;
23 | TocEntryIndex = tocentryindex;
24 | ChunkOffsetLengths = chunkOffsetLengths;
25 | Size = (long)ChunkOffsetLengths.Length;
26 | IoStoreTocHeader = ioStoreTocHeader;
27 | }
28 |
29 | public GameFile()
30 | {
31 |
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/Workspace/CProvider/README.md:
--------------------------------------------------------------------------------
1 | ## What Is CProvider?
2 |
3 | CProvider is a rewrite of [CUE4Parse](https://github.com/FabianFG/CUE4Parse) designed to fit Galaxy Swapper.
4 |
5 | ## What Is Different?
6 |
7 | CProvider is tailored to the sole purpose of reading utoc files to export an asset. It does not parse assets in any way, unlike Cue4Parse.
8 |
9 | ## Why is this important?
10 |
11 | Given that Galaxy Swapper only requires asset export, CProvider streamlines the process by eliminating unnecessary components and optimizing it to meet Galaxy Swapper's requirements. This results in approximately 30% memory usage reduction and a 50% increase in parsing speed.
12 |
13 | ## Intended Exclusively for Galaxy Swapper:
14 |
15 | CProvider is designed solely for use with Galaxy Swapper and is not meant to be used as a standalone package. It serves the specific purpose of assisting Galaxy Swapper and is optimized to enhance its functionality.
16 |
17 | ## Authors
18 |
19 | * [@Wslt](https://github.com/CodeWslt)
20 |
21 | ## License
22 |
23 | Galaxy Swapper v2 is licensed under [GNU General Public License v3.0](https://github.com/GalaxySwapperOfficial/Galaxy-Swapper-v2/blob/main/LICENSE)
24 |
25 |
--------------------------------------------------------------------------------
/Workspace/ClientSettings/Objects/FCustomVersion.cs:
--------------------------------------------------------------------------------
1 | using Galaxy_Swapper_v2.Workspace.CProvider.Objects;
2 | using Galaxy_Swapper_v2.Workspace.Swapping.Other;
3 |
4 | namespace Galaxy_Swapper_v2.Workspace.ClientSettings.Objects
5 | {
6 | public class FCustomVersion
7 | {
8 | public FGuid Key;
9 | public int Version;
10 | public FCustomVersion()
11 | {
12 |
13 | }
14 |
15 | public FCustomVersion(Reader reader)
16 | {
17 | Key = reader.Read();
18 | Version = reader.Read();
19 | }
20 |
21 | public void Write(Writer writer)
22 | {
23 | writer.Write(Key);
24 | writer.Write(Version);
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/Workspace/Components/CCloseControl.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Workspace/Components/CCloseControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 | using System.Windows.Input;
3 | using System.Windows.Media;
4 |
5 | namespace Galaxy_Swapper_v2.Workspace.Components
6 | {
7 | ///
8 | /// Interaction logic for CCloseControl.xaml
9 | ///
10 | public partial class CCloseControl : UserControl
11 | {
12 | public CCloseControl()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | private void Close_Hover(object sender, MouseEventArgs e) => Close.Background = Properties.Colors.Red;
18 |
19 | private void Close_Leave(object sender, MouseEventArgs e) => Close.Background = Brushes.Transparent;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Workspace/Components/CLobbyControl.xaml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Workspace/Components/CLobbyControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using Galaxy_Swapper_v2.Workspace.Structs;
2 | using Galaxy_Swapper_v2.Workspace.Swapping;
3 | using Galaxy_Swapper_v2.Workspace.Utilities;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using System.Windows.Input;
7 |
8 | namespace Galaxy_Swapper_v2.Workspace.Components
9 | {
10 | public partial class CLobbyControl : UserControl
11 | {
12 | public LobbyData LobbyData { get; set; }
13 | public CLobbyControl(LobbyData lobbydata)
14 | {
15 | InitializeComponent();
16 | LobbyData = lobbydata;
17 | Logo.LoadImage(lobbydata.Preview);
18 | Logo.ToolTip = lobbydata.Name;
19 | NsfwHeader.Text = Languages.Read(Languages.Type.View, "LobbyView", "NSFWHeader");
20 |
21 | if (!lobbydata.IsNsfw)
22 | {
23 | Blur.Radius = 0;
24 | NsfwHeader.Visibility = Visibility.Hidden;
25 | Show.Visibility = Visibility.Hidden;
26 | Show.IsEnabled = false;
27 | }
28 | }
29 |
30 | private void root_MouseEnter(object sender, MouseEventArgs e)
31 | {
32 | Margin = new Thickness(5);
33 | Height += 10;
34 | Width += 10;
35 | }
36 |
37 | private void root_MouseLeave(object sender, MouseEventArgs e)
38 | {
39 | Margin = new Thickness(10);
40 | Height -= 10;
41 | Width -= 10;
42 | }
43 |
44 | private void Show_Click(object sender, MouseButtonEventArgs e)
45 | {
46 | Hide.Visibility = Visibility.Visible;
47 | Show.Visibility = Visibility.Hidden;
48 |
49 | Blur.Radius = 0;
50 | NsfwHeader.Visibility = Visibility.Hidden;
51 | }
52 |
53 | private void Hide_Click(object sender, MouseButtonEventArgs e)
54 | {
55 | Show.Visibility = Visibility.Visible;
56 | Hide.Visibility = Visibility.Hidden;
57 |
58 | Blur.Radius = 20;
59 | NsfwHeader.Visibility = Visibility.Visible;
60 | }
61 |
62 | private void Lobby_Convert(object sender, MouseButtonEventArgs e)
63 | {
64 | if (LobbyData.IsNsfw && Message.DisplaySTA(Languages.Read(Languages.Type.Header, "Warning"), Languages.Read(Languages.Type.View, "LobbyView", "NSFW"), MessageBoxButton.YesNo) == MessageBoxResult.No)
65 | {
66 | return;
67 | }
68 |
69 | LobbyBGSwap.Convert(LobbyData.Download);
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/Workspace/Components/CMessageboxControl.xaml:
--------------------------------------------------------------------------------
1 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Workspace/Components/CMinimizeControl.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Workspace/Components/CMinimizeControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 | using System.Windows.Input;
3 | using System.Windows.Media;
4 |
5 | namespace Galaxy_Swapper_v2.Workspace.Components
6 | {
7 | ///
8 | /// Interaction logic for CMinimizeControl.xaml
9 | ///
10 | public partial class CMinimizeControl : UserControl
11 | {
12 | public CMinimizeControl()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | private void Minimize_Hover(object sender, MouseEventArgs e) => Minimize.Background = Properties.Colors.ControlHover_Brush;
18 |
19 | private void Minimize_Leave(object sender, MouseEventArgs e) => Minimize.Background = Brushes.Transparent;
20 | }
21 | }
--------------------------------------------------------------------------------
/Workspace/Components/CNewsControl.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Workspace/Components/CNewsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using Galaxy_Swapper_v2.Workspace.Utilities;
2 | using System.Windows;
3 | using System.Windows.Controls;
4 | using System.Windows.Media;
5 |
6 | namespace Galaxy_Swapper_v2.Workspace.Components
7 | {
8 | ///
9 | /// Interaction logic for CNewsControl.xaml
10 | ///
11 | public partial class CNewsControl : UserControl
12 | {
13 | public static readonly DependencyProperty HeaderProperty =
14 | DependencyProperty.Register("Header", typeof(string), typeof(CNewsControl));
15 |
16 | public string Header
17 | {
18 | get { return (string)GetValue(HeaderProperty); }
19 | set { SetValue(HeaderProperty, value); }
20 | }
21 |
22 | public static readonly DependencyProperty DescriptionProperty =
23 | DependencyProperty.Register("Description", typeof(string), typeof(CNewsControl));
24 |
25 | public string Description
26 | {
27 | get { return (string)GetValue(DescriptionProperty); }
28 | set { SetValue(DescriptionProperty, value); }
29 | }
30 |
31 | public static readonly DependencyProperty URLProperty =
32 | DependencyProperty.Register("URL", typeof(string), typeof(CNewsControl));
33 |
34 | public string URL
35 | {
36 | get { return (string)GetValue(URLProperty); }
37 | set { SetValue(URLProperty, value); }
38 | }
39 |
40 | public static readonly DependencyProperty NewsProperty =
41 | DependencyProperty.Register("News", typeof(ImageSource), typeof(CNewsControl));
42 |
43 | public ImageSource News
44 | {
45 | get { return (ImageSource)GetValue(NewsProperty); }
46 | set { SetValue(NewsProperty, value); }
47 | }
48 |
49 | public CNewsControl()
50 | {
51 | InitializeComponent();
52 | }
53 |
54 | private void News_Click(object sender, System.Windows.Input.MouseButtonEventArgs e)
55 | {
56 | if (!string.IsNullOrEmpty(this.URL))
57 | this.URL.UrlStart();
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Workspace/Components/CPluginControl.xaml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Workspace/Components/CSearchbarControl.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Workspace/Components/CSearchbarControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace Galaxy_Swapper_v2.Workspace.Components
5 | {
6 | ///
7 | /// Interaction logic for CSearchbarControl.xaml
8 | ///
9 | public partial class CSearchbarControl : UserControl
10 | {
11 | public CSearchbarControl()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void Searchbar_GotFocus(object sender, RoutedEventArgs e)
17 | {
18 | if (Searchbar.Text == "Search")
19 | Searchbar.Clear();
20 | }
21 |
22 | private void Searchbar_LostFocus(object sender, RoutedEventArgs e)
23 | {
24 | if (Searchbar.Text.Length == 0)
25 | Searchbar.Text = "Search";
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Workspace/Components/CSettingsControl.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Workspace/Components/CSettingsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Collections.ObjectModel;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 |
6 | namespace Galaxy_Swapper_v2.Workspace.Components
7 | {
8 | ///
9 | /// Interaction logic for CSettingsControl.xaml
10 | ///
11 | public partial class CSettingsControl : UserControl
12 | {
13 | public CSettingsControl()
14 | {
15 | InitializeComponent();
16 | //Additional = new ObservableCollection();
17 | }
18 |
19 | public static readonly DependencyProperty HeaderProperty =
20 | DependencyProperty.Register("Header", typeof(string), typeof(CSettingsControl));
21 |
22 | public string Header
23 | {
24 | get { return (string)GetValue(HeaderProperty); }
25 | set { SetValue(HeaderProperty, value); }
26 | }
27 |
28 | public static readonly DependencyProperty DescriptionProperty =
29 | DependencyProperty.Register("Description", typeof(string), typeof(CSettingsControl));
30 |
31 | public string Description
32 | {
33 | get { return (string)GetValue(DescriptionProperty); }
34 | set { SetValue(DescriptionProperty, value); }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Workspace/Components/CSocialControl.xaml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Workspace/Components/CSocialControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using Galaxy_Swapper_v2.Workspace.Structs;
2 | using Galaxy_Swapper_v2.Workspace.Utilities;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using System.Windows.Input;
6 |
7 | namespace Galaxy_Swapper_v2.Workspace.Components
8 | {
9 | ///
10 | /// Interaction logic for CSocialControl.xaml
11 | ///
12 | public partial class CSocialControl : UserControl
13 | {
14 | private Social Social = null!;
15 | public CSocialControl(Social social)
16 | {
17 | InitializeComponent();
18 | Logo.LoadImage(social.Icon);
19 | Logo.ToolTip = social.Header;
20 | Social = social;
21 | }
22 |
23 | private void root_MouseEnter(object sender, MouseEventArgs e)
24 | {
25 | Margin = new Thickness(2.5, 0, 2.5, 0);
26 | Height += 5;
27 | Width += 5;
28 | }
29 |
30 | private void root_MouseLeave(object sender, MouseEventArgs e)
31 | {
32 | Margin = new Thickness(5, 0, 5, 0);
33 | Height -= 5;
34 | Width -= 5;
35 | }
36 |
37 | private void root_Click(object sender, MouseButtonEventArgs e)
38 | {
39 | if (string.IsNullOrEmpty(Social.URL))
40 | {
41 | Message.Display(Languages.Read(Languages.Type.Header, "Info"), Social.Header, MessageBoxButton.OK);
42 | }
43 | else if (Message.Display(Languages.Read(Languages.Type.Header, "Warning"), string.Format(Languages.Read(Languages.Type.Message, "OpenUrl"), Social.URL), MessageBoxButton.YesNoCancel) == MessageBoxResult.Yes)
44 | {
45 | Social.URL.UrlStart();
46 | }
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/Workspace/Components/CSwappedControl.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Workspace/Components/CSwappedControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using System.Windows.Media;
4 |
5 | namespace Galaxy_Swapper_v2.Workspace.Components
6 | {
7 | ///
8 | /// Interaction logic for CSwappedControl.xaml
9 | ///
10 | public partial class CSwappedControl : UserControl
11 | {
12 | public CSwappedControl()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | public static readonly DependencyProperty IconProperty = DependencyProperty.Register("Icon", typeof(ImageSource), typeof(CSwappedControl));
18 |
19 | public ImageSource Icon
20 | {
21 | get { return (ImageSource)GetValue(IconProperty); }
22 | set { SetValue(IconProperty, value); }
23 | }
24 |
25 | public static readonly DependencyProperty OverrideIconProperty = DependencyProperty.Register("OverrideIcon", typeof(ImageSource), typeof(CSwappedControl));
26 |
27 | public ImageSource OverrideIcon
28 | {
29 | get { return (ImageSource)GetValue(OverrideIconProperty); }
30 | set { SetValue(OverrideIconProperty, value); }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Workspace/Components/CTabControl.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Workspace/Components/CTabControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using System.Windows.Media;
4 |
5 | namespace Galaxy_Swapper_v2.Workspace.Components
6 | {
7 | ///
8 | /// Interaction logic for CTabControl.xaml
9 | ///
10 | public partial class CTabControl : UserControl
11 | {
12 | public static readonly DependencyProperty IconProperty =
13 | DependencyProperty.Register("Icon", typeof(ImageSource), typeof(CTabControl));
14 |
15 | public ImageSource Icon
16 | {
17 | get { return (ImageSource)GetValue(IconProperty); }
18 | set { SetValue(IconProperty, value); }
19 | }
20 |
21 | public static readonly DependencyProperty IconClickedProperty =
22 | DependencyProperty.Register("IconClicked", typeof(ImageSource), typeof(CTabControl));
23 |
24 | public ImageSource IconClicked
25 | {
26 | get { return (ImageSource)GetValue(IconClickedProperty); }
27 | set { SetValue(IconClickedProperty, value); }
28 | }
29 |
30 | public static readonly DependencyProperty ColorProperty =
31 | DependencyProperty.Register("Color", typeof(Brush), typeof(CTabControl), new PropertyMetadata(Properties.Colors.External_Brush));
32 |
33 | public Brush Color
34 | {
35 | get { return (Brush)GetValue(ColorProperty); }
36 | set { SetValue(ColorProperty, value); }
37 | }
38 |
39 | public static readonly DependencyProperty PresenceProperty =
40 | DependencyProperty.Register("Presence", typeof(string), typeof(CNewsControl));
41 |
42 | public string Presence
43 | {
44 | get { return (string)GetValue(PresenceProperty); }
45 | set { SetValue(PresenceProperty, value); }
46 | }
47 |
48 | public CTabControl()
49 | {
50 | InitializeComponent();
51 | }
52 |
53 | public void Tab_Default()
54 | {
55 | this.Clicked.Visibility = Visibility.Hidden;
56 | this.Default.Visibility = Visibility.Visible;
57 | this.Color = Properties.Colors.External_Brush;
58 | }
59 |
60 | public void Tab_Clicked()
61 | {
62 | this.Default.Visibility = Visibility.Hidden;
63 | this.Clicked.Visibility = Visibility.Visible;
64 | this.Color = Properties.Colors.Blue_Brush;
65 | Utilities.Presence.Update(Presence);
66 | }
67 |
68 | private void CTabControl_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
69 | {
70 | this.Width = 42;
71 | this.Height = 42;
72 | this.Margin = new Thickness(7);
73 | }
74 |
75 | private void CTabControl_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
76 | {
77 | this.Width = 40;
78 | this.Height = 40;
79 | this.Margin = new Thickness(8);
80 | }
81 | }
82 | }
--------------------------------------------------------------------------------
/Workspace/Compression/aes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Security.Cryptography;
4 |
5 | namespace Galaxy_Swapper_v2.Workspace.Compression
6 | {
7 | public static class aes
8 | {
9 | public static byte[] Encrypt(string plainText, byte[] key)
10 | {
11 | using (Aes aesAlg = Aes.Create())
12 | {
13 | aesAlg.Key = key;
14 | aesAlg.Mode = CipherMode.CBC;
15 | aesAlg.Padding = PaddingMode.PKCS7;
16 |
17 | using (ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV))
18 | using (MemoryStream memoryStream = new MemoryStream())
19 | {
20 | memoryStream.Write(aesAlg.IV, 0, aesAlg.IV.Length);
21 |
22 | using (CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write))
23 | using (StreamWriter streamWriter = new StreamWriter(cryptoStream))
24 | {
25 | streamWriter.Write(plainText);
26 | }
27 |
28 | return memoryStream.ToArray();
29 | }
30 | }
31 | }
32 |
33 | public static byte[] Decrypt(byte[] encryptedBytes, byte[] key)
34 | {
35 | using (Aes aesAlg = Aes.Create())
36 | {
37 | aesAlg.Key = key;
38 | aesAlg.Mode = CipherMode.CBC;
39 | aesAlg.Padding = PaddingMode.PKCS7;
40 |
41 | byte[] iv = new byte[16];
42 | Array.Copy(encryptedBytes, 0, iv, 0, 16);
43 | aesAlg.IV = iv;
44 |
45 | using (ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV))
46 | using (MemoryStream memoryStream = new MemoryStream(encryptedBytes, 16, encryptedBytes.Length - 16))
47 | using (CryptoStream cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read))
48 | {
49 | using (MemoryStream decryptedMemoryStream = new MemoryStream())
50 | {
51 | cryptoStream.CopyTo(decryptedMemoryStream);
52 | return decryptedMemoryStream.ToArray();
53 | }
54 | }
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Workspace/Compression/gzip.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.IO.Compression;
4 | using System.Text;
5 |
6 | namespace Galaxy_Swapper_v2.Workspace.Compression
7 | {
8 | public static class gzip
9 | {
10 | public static byte[] Compress(byte[] data)
11 | {
12 | using (MemoryStream compressedStream = new MemoryStream())
13 | {
14 | using (GZipStream gzipStream = new GZipStream(compressedStream, CompressionMode.Compress))
15 | {
16 | gzipStream.Write(data, 0, data.Length);
17 | }
18 |
19 | return compressedStream.ToArray();
20 | }
21 | }
22 |
23 | public static byte[] Compress(string data)
24 | {
25 | return Compress(Encoding.ASCII.GetBytes(data));
26 | }
27 |
28 | public static byte[] Decompress(byte[] compressedData)
29 | {
30 | using (MemoryStream compressedStream = new MemoryStream(compressedData))
31 | using (MemoryStream decompressedStream = new MemoryStream())
32 | {
33 | using (GZipStream gzipStream = new GZipStream(compressedStream, CompressionMode.Decompress))
34 | {
35 | byte[] buffer = new byte[4096];
36 | int bytesRead;
37 | while ((bytesRead = gzipStream.Read(buffer, 0, buffer.Length)) > 0)
38 | {
39 | decompressedStream.Write(buffer, 0, bytesRead);
40 | }
41 | }
42 |
43 | return decompressedStream.ToArray();
44 | }
45 | }
46 |
47 | public static byte[] Decompress(string base64)
48 | {
49 | return Decompress(Convert.FromBase64String(base64));
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Workspace/Compression/zlib.cs:
--------------------------------------------------------------------------------
1 | using Ionic.Zlib;
2 | using System.IO;
3 |
4 | namespace Galaxy_Swapper_v2.Workspace.Compression
5 | {
6 | public static class zlib
7 | {
8 | public static byte[] Compress(byte[] buffer)
9 | {
10 | using (MemoryStream ms = new MemoryStream())
11 | {
12 | using (ZlibStream zls = new ZlibStream(ms, CompressionMode.Compress, CompressionLevel.Level9))
13 | {
14 | zls.Write(buffer, 0, buffer.Length);
15 | }
16 | return ms.ToArray();
17 | }
18 | }
19 |
20 | public static byte[] Decompress(byte[] compressedData, int uncompressedsize)
21 | {
22 | byte[] uncompresed = new byte[uncompressedsize];
23 | using (var memoryStream = new MemoryStream(compressedData))
24 | {
25 | var zlib = new ZlibStream(memoryStream, CompressionMode.Decompress);
26 | zlib.Read(uncompresed, 0, uncompressedsize);
27 | zlib.Dispose();
28 | }
29 |
30 | return uncompresed;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Workspace/Generation/Formats/Asset.cs:
--------------------------------------------------------------------------------
1 | using Galaxy_Swapper_v2.Workspace.CProvider.Objects;
2 | using Galaxy_Swapper_v2.Workspace.Structs;
3 | using Newtonsoft.Json.Linq;
4 | using System;
5 |
6 | namespace Galaxy_Swapper_v2.Workspace.Generation.Formats
7 | {
8 | public class Asset : ICloneable
9 | {
10 | public string Object;
11 | public string OverrideObject;
12 | public string OverrideBuffer;
13 | public bool IsStreamData = false;
14 | public bool Invalidate = false;
15 | public JToken Swaps;
16 | public MaterialData MaterialData;
17 | public TextureData TextureData;
18 | public GameFile Export { get; set; } = default!;
19 | public GameFile OverrideExport { get; set; } = default!;
20 | public object Clone()
21 | {
22 | return this.MemberwiseClone();
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/Workspace/Generation/Formats/Cosmetic.cs:
--------------------------------------------------------------------------------
1 | using Galaxy_Swapper_v2.Workspace.Structs;
2 | using Newtonsoft.Json.Linq;
3 | using System.Collections.Generic;
4 |
5 | namespace Galaxy_Swapper_v2.Workspace.Generation.Formats
6 | {
7 | public class Cosmetic
8 | {
9 | public string Name;
10 | public string ID;
11 | public string Icon;
12 | public string OverrideFrontend;
13 | public string Message;
14 | public bool Nsfw = false;
15 | public bool UseMainUEFN = false;
16 | public string UEFNTag;
17 | public int Stats = 0;
18 | public Generate.Type Type;
19 | public JToken Parse;
20 | public List