From 56bef79a66c552ec434f0c5a47233eda7484f600 Mon Sep 17 00:00:00 2001 From: VocalFan <45863583+Mou-Ikkai@users.noreply.github.com> Date: Mon, 12 Sep 2022 16:31:31 -0400 Subject: [PATCH 01/40] Merge and Fork --- .github/dependabot.yml | 42 ++++ .github/workflows/LibForge-EXT.yml | 40 ++++ .github/workflows/LibForge-main.yml | 68 ++++++ LibForge/ForgeTool/ForgeTool.csproj | 65 +----- LibForge/ForgeTool/Program.cs | 12 ++ LibForge/ForgeToolGUI/ForgeBrowser.cs | 4 - LibForge/ForgeToolGUI/ForgeToolGUI.csproj | 203 +++--------------- .../Inspectors/MeshInspector.Designer.cs | 5 +- .../ForgeToolGUI/Inspectors/MeshInspector.cs | 8 +- LibForge/ForgeToolGUI/Program.cs | 1 + .../LibForge/Extensions/StreamExtensions.cs | 46 ++++ LibForge/LibForge/LibForge.csproj | 130 ++--------- LibForge/LibForge/Texture/TextureConverter.cs | 53 ++++- LibForge/LibForge/Texture/TextureReader.cs | 21 ++ LibForge/LibForge/Texture/TextureWriter.cs | 6 + LibForge/LibForge/Util/BinReader.cs | 15 +- LibForge/LibForge/Util/BinWriter.cs | 59 ++++- LibForge/LibForgeTests/LibForgeTests.csproj | 80 ++----- README.md | 16 +- 19 files changed, 425 insertions(+), 449 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/LibForge-EXT.yml create mode 100644 .github/workflows/LibForge-main.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1b4661f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,42 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: +- package-ecosystem: nuget + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 999 + +- package-ecosystem: nuget + directory: "/LibForge/LibForge" + schedule: + interval: daily + open-pull-requests-limit: 999 + +- package-ecosystem: nuget + directory: "/LibForge/ForgeTool" + schedule: + interval: daily + open-pull-requests-limit: 999 + +- package-ecosystem: nuget + directory: "/LibForge/ForgeToolGUI" + schedule: + interval: daily + open-pull-requests-limit: 999 + +- package-ecosystem: nuget + directory: "/LibForge/LibForgeTests" + schedule: + interval: daily + open-pull-requests-limit: 999 + +- package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every day + interval: "daily" diff --git a/.github/workflows/LibForge-EXT.yml b/.github/workflows/LibForge-EXT.yml new file mode 100644 index 0000000..1969622 --- /dev/null +++ b/.github/workflows/LibForge-EXT.yml @@ -0,0 +1,40 @@ +name: External Branch Build + +on: + push: + branches-ignore: + - main + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + with: + vs-version: 17.3.3 + msbuild-architecture: x64 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.7 + with: + nuget-version: latest + + - name: Clear NuGet cache + run: dotnet nuget locals all --clear + + - name: Restore NuGet Packages + working-directory: ./LibForge/ + run: nuget restore LibForge.sln + + - name: Build LibForge + working-directory: ./LibForge/ + run: msbuild LibForge.sln /p:Configuration=Release /p:DeployOnBuild=true diff --git a/.github/workflows/LibForge-main.yml b/.github/workflows/LibForge-main.yml new file mode 100644 index 0000000..3d866b3 --- /dev/null +++ b/.github/workflows/LibForge-main.yml @@ -0,0 +1,68 @@ +name: Main Compilation + +on: + push: + branches: [ "main" ] + +env: + version: 0.1.${{ github.run_number }} + +jobs: + build: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + with: + vs-version: 17.3.3 + msbuild-architecture: x64 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.7 + with: + nuget-version: latest + + - name: Clear NuGet cache + run: dotnet nuget locals all --clear + + - name: Restore NuGet Packages + working-directory: ./LibForge/ + run: nuget restore LibForge.sln + + - name: Build LibForge + working-directory: ./LibForge/ + run: msbuild LibForge.sln /p:Configuration=Release /p:DeployOnBuild=true + + - name: Zip LibForge + uses: TheDoctor0/zip-release@main + with: + type: 'zip' + path: .\LibForge\LibForge\bin\Release\ + filename: LibForge-${{ env.version }}.zip + + - name: Zip ForgeTool + uses: TheDoctor0/zip-release@main + with: + type: 'zip' + path: .\LibForge\ForgeTool\bin\Release\ + filename: ForgeTool-${{ env.version }}.zip + + - name: Zip ForgeToolGUI + uses: TheDoctor0/zip-release@main + with: + type: 'zip' + path: .\LibForge\ForgeToolGUI\bin\Release\ + filename: ForgeToolGUI-${{ env.version }}.zip + + - name: GH Release + uses: ncipollo/release-action@v1 + with: + artifacts: "LibForge-${{ env.version }}.zip,ForgeTool-${{ env.version }}.zip,ForgeToolGUI-${{ env.version }}.zip" + generateReleaseNotes: true + name: Release ${{ env.version }} + tag: ${{ env.version }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/LibForge/ForgeTool/ForgeTool.csproj b/LibForge/ForgeTool/ForgeTool.csproj index 8e2de4b..5b4fd06 100644 --- a/LibForge/ForgeTool/ForgeTool.csproj +++ b/LibForge/ForgeTool/ForgeTool.csproj @@ -1,37 +1,9 @@ - - - + - Debug - AnyCPU - {CB848B8C-A1B6-4777-A674-D3E5C255AAC1} + net6.0 Exe - ForgeTool - ForgeTool - v4.7.1 - 512 - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false + false + False @@ -40,31 +12,16 @@ ..\..\Dependencies\MidiCS.dll - - - - - - - - - - - - - - {906748f0-3a55-4b20-bccb-9dc7187f1d5e} - GameArchives - - - {3684b7e6-0978-487a-895c-d0ed8f6b7b9a} - LibForge - + + - + + + + all + - \ No newline at end of file diff --git a/LibForge/ForgeTool/Program.cs b/LibForge/ForgeTool/Program.cs index f335747..40397a1 100644 --- a/LibForge/ForgeTool/Program.cs +++ b/LibForge/ForgeTool/Program.cs @@ -75,6 +75,14 @@ void WithIO(Action action) TextureWriter.WriteStream(tex, fo); }); break; + case "png2amptex": + WithIO((fi, fo) => + { + var img = System.Drawing.Image.FromStream(fi); + var tex = TextureConverter.ToTextureMaintainingSize(img); + TextureWriter.WriteStreamBigEndian(tex, fo); + }); + break; case "milopng2tex": WithIO((fi, fo) => { @@ -417,6 +425,10 @@ static void Usage() Console.WriteLine(" - converts a Standard Midi File to a Forge midi"); Console.WriteLine(" tex2png "); Console.WriteLine(" - converts a Forge texture to PNG"); + Console.WriteLine(" png2tex "); + Console.WriteLine(" - converts a PNG to a Forge texture"); + Console.WriteLine(" png2amptex "); + Console.WriteLine(" - converts a PNG to an Amplitude Forge texture"); Console.WriteLine(" mesh2obj "); Console.WriteLine(" - converts a Forge mesh to OBJ"); Console.WriteLine(" con2gp4 [--scee] [--id 16CHARIDENTIFIER] [--desc \"Package Description\"] "); diff --git a/LibForge/ForgeToolGUI/ForgeBrowser.cs b/LibForge/ForgeToolGUI/ForgeBrowser.cs index 07d679f..fd6126c 100644 --- a/LibForge/ForgeToolGUI/ForgeBrowser.cs +++ b/LibForge/ForgeToolGUI/ForgeBrowser.cs @@ -68,8 +68,6 @@ private void LoadPackage(string filename) if(filename.EndsWith(".pkg")) { - try - { string contentId; using (var tempS = pkgFile.GetStream()) { @@ -80,8 +78,6 @@ private void LoadPackage(string filename) new string(LibOrbisPkg.Util.Crypto.ComputeKeys( contentId, "00000000000000000000000000000000", 1) .Select(b => (char)b).ToArray())); - } - catch (Exception) { } } else { diff --git a/LibForge/ForgeToolGUI/ForgeToolGUI.csproj b/LibForge/ForgeToolGUI/ForgeToolGUI.csproj index b656671..cb58152 100644 --- a/LibForge/ForgeToolGUI/ForgeToolGUI.csproj +++ b/LibForge/ForgeToolGUI/ForgeToolGUI.csproj @@ -1,37 +1,10 @@ - - - + - Debug - AnyCPU - {233099F7-0471-4064-B000-F6DDE21E64E6} + net6.0-windows WinExe - ForgeToolGUI - ForgeToolGUI - v4.7.1 - 512 - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false + false + true + true anvil.ico @@ -43,174 +16,56 @@ ..\..\Dependencies\MidiCS.dll - - ..\packages\OpenTK.3.0.1\lib\net20\OpenTK.dll - - - ..\packages\OpenTK.GLControl.3.0.1\lib\net20\OpenTK.GLControl.dll - - - - - - - - - - - - - Form - - - ErrorWindow.cs - - - Form - - - ForgeBrowser.cs - - + UserControl - - ConversionInspector.cs - - + UserControl - - FuserInspector.cs - - + UserControl - - MeshInspector.cs - - + UserControl - - PropertyInspector.cs - - + UserControl - - RBMidiInspector.cs - - - + UserControl - - ObjectInspector.cs - - + UserControl - - StringInspector.cs - - + UserControl - - TextureInspector.cs - - + UserControl - - StartupInspector.cs - - - - + UserControl - - SongDataInspector.cs - - - ErrorWindow.cs - - - ForgeBrowser.cs - - - ConversionInspector.cs - - - FuserInspector.cs - - - MeshInspector.cs - - - PropertyInspector.cs - - - RBMidiInspector.cs - - - ObjectInspector.cs - - - StartupInspector.cs - - - StringInspector.cs - - - TextureInspector.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - SongDataInspector.cs - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - {906748f0-3a55-4b20-bccb-9dc7187f1d5e} - GameArchives - - - {b053f491-ff0f-4cbb-b03b-520591bb0441} - LibOrbisPkg - - - {3684b7e6-0978-487a-895c-d0ed8f6b7b9a} - LibForge - + + + - + + + + + + + + all + + + \ No newline at end of file diff --git a/LibForge/ForgeToolGUI/Inspectors/MeshInspector.Designer.cs b/LibForge/ForgeToolGUI/Inspectors/MeshInspector.Designer.cs index 2c9cae5..1fa478f 100644 --- a/LibForge/ForgeToolGUI/Inspectors/MeshInspector.Designer.cs +++ b/LibForge/ForgeToolGUI/Inspectors/MeshInspector.Designer.cs @@ -28,7 +28,7 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.glControl1 = new OpenTK.GLControl(); + this.glControl1 = new OpenTK.WinForms.GLControl(); this.checkBox1 = new System.Windows.Forms.CheckBox(); this.label1 = new System.Windows.Forms.Label(); this.trisLabel = new System.Windows.Forms.Label(); @@ -47,7 +47,6 @@ private void InitializeComponent() this.glControl1.Name = "glControl1"; this.glControl1.Size = new System.Drawing.Size(721, 652); this.glControl1.TabIndex = 0; - this.glControl1.VSync = false; this.glControl1.Load += new System.EventHandler(this.glControl1_Load); this.glControl1.Paint += new System.Windows.Forms.PaintEventHandler(this.glControl1_Paint); this.glControl1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.glControl1_MouseDown); @@ -125,7 +124,7 @@ private void InitializeComponent() #endregion - private OpenTK.GLControl glControl1; + private OpenTK.WinForms.GLControl glControl1; private System.Windows.Forms.CheckBox checkBox1; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label trisLabel; diff --git a/LibForge/ForgeToolGUI/Inspectors/MeshInspector.cs b/LibForge/ForgeToolGUI/Inspectors/MeshInspector.cs index ef660d3..769f7e5 100644 --- a/LibForge/ForgeToolGUI/Inspectors/MeshInspector.cs +++ b/LibForge/ForgeToolGUI/Inspectors/MeshInspector.cs @@ -1,13 +1,15 @@ -using System; +using OpenTK; +using OpenTK.Graphics.OpenGL4; +using OpenTK.Mathematics; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; +using System.Threading.Tasks; using System.Windows.Forms; -using OpenTK; -using OpenTK.Graphics.OpenGL; using LibForge.Mesh; namespace ForgeToolGUI diff --git a/LibForge/ForgeToolGUI/Program.cs b/LibForge/ForgeToolGUI/Program.cs index 4e7235b..03541e1 100644 --- a/LibForge/ForgeToolGUI/Program.cs +++ b/LibForge/ForgeToolGUI/Program.cs @@ -14,6 +14,7 @@ static class Program static void Main() { Application.EnableVisualStyles(); + Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new ForgeBrowser()); } diff --git a/LibForge/LibForge/Extensions/StreamExtensions.cs b/LibForge/LibForge/Extensions/StreamExtensions.cs index fcd0331..7a8954a 100644 --- a/LibForge/LibForge/Extensions/StreamExtensions.cs +++ b/LibForge/LibForge/Extensions/StreamExtensions.cs @@ -83,7 +83,18 @@ public static short ReadInt16BE(this Stream s) ret |= tmp[1] & 0x00FF; return (short)ret; } + public static void WriteInt16BE(this Stream s, short i) + { + s.WriteUInt16BE(unchecked((ushort)i)); + } + public static void WriteUInt16BE(this Stream s, ushort i) + { + byte[] tmp = new byte[2]; + tmp[1] = (byte)(i & 0xFF); + tmp[0] = (byte)((i >> 8) & 0xFF); + s.Write(tmp, 0, 2); + } public static void WriteUInt24LE(this Stream s, uint i) { byte[] tmp = new byte[3]; @@ -236,6 +247,21 @@ public static int ReadInt32BE(this Stream s) return ret; } + public static void WriteInt32BE(this Stream s, int i) + { + s.WriteUInt32BE(unchecked((uint)i)); + } + + public static void WriteUInt32BE(this Stream s, uint i) + { + byte[] tmp = new byte[4]; + tmp[3] = (byte)(i & 0xFF); + tmp[2] = (byte)((i >> 8) & 0xFF); + tmp[1] = (byte)((i >> 16) & 0xFF); + tmp[0] = (byte)((i >> 24) & 0xFF); + s.Write(tmp, 0, 4); + } + /// /// Read an unsigned 64-bit little-endian integer from the stream. /// @@ -314,6 +340,26 @@ public static long ReadInt64BE(this Stream s) return ret; } + public static void WriteInt64BE(this Stream s, long i) + { + s.WriteUInt64BE(unchecked((ulong)i)); + } + + public static void WriteUInt64BE(this Stream s, ulong i) + { + byte[] tmp = new byte[8]; + tmp[7] = (byte)(i & 0xFF); + tmp[6] = (byte)((i >> 8) & 0xFF); + tmp[5] = (byte)((i >> 16) & 0xFF); + tmp[4] = (byte)((i >> 24) & 0xFF); + i >>= 32; + tmp[3] = (byte)(i & 0xFF); + tmp[2] = (byte)((i >> 8) & 0xFF); + tmp[1] = (byte)((i >> 16) & 0xFF); + tmp[0] = (byte)((i >> 24) & 0xFF); + s.Write(tmp, 0, 8); + } + /// /// Reads a multibyte value of the specified length from the stream. /// diff --git a/LibForge/LibForge/LibForge.csproj b/LibForge/LibForge/LibForge.csproj index fedf575..9d6d485 100644 --- a/LibForge/LibForge/LibForge.csproj +++ b/LibForge/LibForge/LibForge.csproj @@ -1,42 +1,11 @@ - - - + - Debug - AnyCPU - {3684B7E6-0978-487A-895C-D0ED8F6B7B9A} + net6.0 Library - Properties - LibForge - LibForge - v4.7.1 - 512 - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - latest - true - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + false latest true - false + false @@ -45,92 +14,17 @@ ..\..\Dependencies\MidiCS.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - {906748f0-3a55-4b20-bccb-9dc7187f1d5e} - GameArchives - - - {b053f491-ff0f-4cbb-b03b-520591bb0441} - LibOrbisPkg - + + + + all + + - \ No newline at end of file diff --git a/LibForge/LibForge/Texture/TextureConverter.cs b/LibForge/LibForge/Texture/TextureConverter.cs index 85a4cd3..9c37294 100644 --- a/LibForge/LibForge/Texture/TextureConverter.cs +++ b/LibForge/LibForge/Texture/TextureConverter.cs @@ -123,9 +123,9 @@ private static IEnumerable EnumerateBlockColors(Bitmap img, int x, int y) yield return img.GetPixel(x + x0, y + y0); } - private static byte[] EncodeDxt(Image image, int mapLevel, int nominalSize = 256) + private static byte[] EncodeDxt(Image image, int mapLevel, int nominalWidth = 256, int nominalHeight = 256) { - var img = new Bitmap(image, new Size(nominalSize >> mapLevel, nominalSize >> mapLevel)); + var img = new Bitmap(image, new Size(nominalWidth >> mapLevel, nominalHeight >> mapLevel)); var data = new byte[img.Width * img.Height / 2]; var idx = 0; for(var y = 0; y < img.Height; y += 4) @@ -209,6 +209,25 @@ private static byte[] EncodeDxt(Image image, int mapLevel, int nominalSize = 256 return data; } + static byte[] HeaderDataAmplitudePS3 = new byte[] + { + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 + }; + static byte[] HeaderData256x256 = new byte[] { 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, @@ -314,5 +333,35 @@ public static Texture ToTexture(Image image) Mipmaps = maps }; } + public static Texture ToTextureMaintainingSize(Image image) + { + int w = image.Width; + int h = image.Height; + int NumMipmaps = 0; + while(w > 16 && h > 16) + { + NumMipmaps++; + w /= 2; + h /= 2; + } + Texture.Mipmap[] maps = new Texture.Mipmap[NumMipmaps]; + for (var i = 0; i < maps.Length; i++) + { + maps[i] = new Texture.Mipmap + { + Width = image.Width / (1 << i), + Height = image.Height / (1 << i), + Data = EncodeDxt(image, i, image.Width / (1 << i), image.Height / (1 << i)) + }; + } + + return new Texture + { + HeaderData = HeaderDataAmplitudePS3, + FooterData = FooterData256x256, + Version = 4, + Mipmaps = maps + }; + } } } diff --git a/LibForge/LibForge/Texture/TextureReader.cs b/LibForge/LibForge/Texture/TextureReader.cs index a15d4ec..e6c4385 100644 --- a/LibForge/LibForge/Texture/TextureReader.cs +++ b/LibForge/LibForge/Texture/TextureReader.cs @@ -18,6 +18,27 @@ public TextureReader(Stream s) : base(s) { } public override Texture Read() { var magic = Int(); + + switch (magic) + { + case 6: + case 4: + break; + + case 67108864: + magic = 4; + BigEndian = true; + break; + + case 100663296: + magic = 6; + BigEndian = true; + break; + + default: + throw new Exception($"Unknown texture magic {magic}"); + } + if(magic != 6 && magic != 4) { throw new Exception($"Unknown texture magic {magic}"); diff --git a/LibForge/LibForge/Texture/TextureWriter.cs b/LibForge/LibForge/Texture/TextureWriter.cs index c7e69dd..e815dc2 100644 --- a/LibForge/LibForge/Texture/TextureWriter.cs +++ b/LibForge/LibForge/Texture/TextureWriter.cs @@ -13,6 +13,12 @@ public static void WriteStream(Texture r, Stream s) { new TextureWriter(s).WriteStream(r); } + public static void WriteStreamBigEndian(Texture r, Stream s) + { + TextureWriter Writer = new TextureWriter(s); + Writer.BigEndian = true; + Writer.WriteStream(r); + } private TextureWriter(Stream s) : base(s) { } public override void WriteStream(Texture r) { diff --git a/LibForge/LibForge/Util/BinReader.cs b/LibForge/LibForge/Util/BinReader.cs index 9ba60a6..b8d73e5 100644 --- a/LibForge/LibForge/Util/BinReader.cs +++ b/LibForge/LibForge/Util/BinReader.cs @@ -9,6 +9,7 @@ namespace LibForge.Util { public class BinReader { + protected bool BigEndian = false; protected Stream s; public BinReader(Stream stream) { @@ -102,20 +103,20 @@ public T[] CheckedArr(Func constructor, uint size) // For skipping unknown data public Action Skip(int count) => () => s.Position += count; // For reading simple types - public int Int() => s.ReadInt32LE(); - public uint UInt() => s.ReadUInt32LE(); - public long Long() => s.ReadInt64LE(); - public ulong ULong() => s.ReadUInt64LE(); + public int Int() => BigEndian ? s.ReadInt32BE() : s.ReadInt32LE(); + public uint UInt() => BigEndian ? s.ReadUInt32BE() : s.ReadUInt32LE(); + public long Long() => BigEndian ? s.ReadInt64BE() : s.ReadInt64LE(); + public ulong ULong() => BigEndian ? s.ReadUInt64BE() : s.ReadUInt64LE(); public float Half() => s.ReadHalfFloat(); public float Float() => s.ReadFloat(); - public short Short() => s.ReadInt16LE(); - public ushort UShort() => s.ReadUInt16LE(); + public short Short() => BigEndian ? s.ReadInt16BE() : s.ReadInt16LE(); + public ushort UShort() => BigEndian ? s.ReadUInt16BE() : s.ReadUInt16LE(); public byte Byte() => (byte)s.ReadByte(); public string String() => s.ReadLengthPrefixedString(Encoding.UTF8); public string String(int length) => s.ReadFixedLengthNullTerminatedString(length); public string FixedString(int length) => s.ReadFixedLengthString(length); public string UE4String() => String(Int()); - public uint UInt24() => s.ReadUInt24LE(); + public uint UInt24() => BigEndian ? s.ReadUInt24BE() : s.ReadUInt24LE(); /// /// Reads a byte as a boolean, throwing if it's not 1 or 0 /// diff --git a/LibForge/LibForge/Util/BinWriter.cs b/LibForge/LibForge/Util/BinWriter.cs index eb48dfd..684cb38 100644 --- a/LibForge/LibForge/Util/BinWriter.cs +++ b/LibForge/LibForge/Util/BinWriter.cs @@ -9,24 +9,69 @@ namespace LibForge.Util { public class BinWriter { + protected bool BigEndian = false; protected Stream s; public BinWriter(Stream s) { this.s = s; } public void Write(byte v) => s.WriteByte(v); - public void Write(short v) => s.WriteInt16LE(v); - public void Write(ushort v) => s.WriteUInt16LE(v); - public void Write(int v) => s.WriteInt32LE(v); - public void Write(uint v) => s.WriteUInt32LE(v); - public void Write(long v) => s.WriteInt64LE(v); - public void Write(ulong v) => s.WriteUInt64LE(v); + public void Write(short v) + { + if (BigEndian) + s.WriteInt16BE(v); + else + s.WriteInt16LE(v); + } + public void Write(ushort v) + { + if (BigEndian) + s.WriteUInt16BE(v); + else + s.WriteUInt16LE(v); + } + public void Write(int v) + { + if (BigEndian) + s.WriteInt32BE(v); + else + s.WriteInt32LE(v); + } + public void Write(uint v) + { + if (BigEndian) + s.WriteUInt32BE(v); + else + s.WriteUInt32LE(v); + } + public void Write(long v) + { + if (BigEndian) + s.WriteInt64BE(v); + else + s.WriteInt64LE(v); + } + public void Write(ulong v) + { + if (BigEndian) + s.WriteUInt64BE(v); + else + s.WriteUInt64LE(v); + } public void Write(float v) => s.Write(BitConverter.GetBytes(v), 0, 4); public void Write(bool v) => s.WriteByte((byte)(v ? 1 : 0)); public void Write(string v) { var bytes = Encoding.UTF8.GetBytes(v); - s.WriteInt32LE(bytes.Length); + + if (BigEndian) + { + s.WriteInt32BE(bytes.Length); + } + else + { + s.WriteInt32LE(bytes.Length); + } s.Write(bytes, 0, bytes.Length); } public void Write(string v, int length) diff --git a/LibForge/LibForgeTests/LibForgeTests.csproj b/LibForge/LibForgeTests/LibForgeTests.csproj index b8299ca..b292b53 100644 --- a/LibForge/LibForgeTests/LibForgeTests.csproj +++ b/LibForge/LibForgeTests/LibForgeTests.csproj @@ -1,70 +1,28 @@ - - - + - Debug - AnyCPU - {DB683EFE-A4DE-4A8C-BD78-30B84787A027} - Library - Properties - LibForgeTests - LibForgeTests - v4.7.1 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + net6.0 + false + False - - ..\packages\MSTest.TestFramework.1.2.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll - - - ..\packages\MSTest.TestFramework.1.2.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll - ..\..\Dependencies\MidiCS.dll - - - - - - - - + - - {3684b7e6-0978-487a-895c-d0ed8f6b7b9a} - LibForge - + + 2.2.10 + + + 2.2.10 + + + all + - Always @@ -73,14 +31,4 @@ Always - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 5d934bb..3d0910e 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,12 @@ # About This Repository -I am keeping track of my research into RB4 customs here. +This is a revival of LibForge, in order to renew the code and also make it compatible with Amplitude 2016. -I am working out the structure of the files in Rock Band 4. These are being documented in the form of 010 Editor Template files, which are in the `010` directory. +# How to Build -# Latest Build +You need: .NET 6 | .NET Core 3.1 -Can be downloaded at [Appveyor](https://ci.appveyor.com/project/maxton/libforge/branch/master/artifacts) - -# LibForge - -This is a library I'm working on that handles reading, writing, and converting for formats in the Forge engine used by Rock Band 4 and Rock Band VR. - -It is licensed under the GNU LGPLv3 and includes two frontends at the moment: +Compile using LibForge.sln, when the compilation is complete, there should be a bin folder inside each program folder. (ForgeTool, ForgeToolGUI, LibForge, LibForgeTests) ## ForgeTool @@ -55,4 +49,4 @@ This has an ark/PFS/folder browser with support for previewing the following: - .songdta files - Data (.dta/.dtb/.\*\_dta\_\*/.moggsong) files - RBmid files - - RBsong files \ No newline at end of file + - RBsong files From c6fad4ab81f07a4c694324301d23907b3695d684 Mon Sep 17 00:00:00 2001 From: VocalFan <45863583+Mou-Ikkai@users.noreply.github.com> Date: Mon, 12 Sep 2022 16:40:28 -0400 Subject: [PATCH 02/40] Delete Dependencies directory --- Dependencies/DtxCS.dll | Bin 22016 -> 0 bytes Dependencies/DtxCS.xml | 509 -------------------------------------- Dependencies/GameArchives | 1 - Dependencies/LICENSE | 166 ------------- Dependencies/LibOrbisPkg | 1 - Dependencies/MidiCS.dll | Bin 29696 -> 0 bytes 6 files changed, 677 deletions(-) delete mode 100644 Dependencies/DtxCS.dll delete mode 100644 Dependencies/DtxCS.xml delete mode 160000 Dependencies/GameArchives delete mode 100644 Dependencies/LICENSE delete mode 160000 Dependencies/LibOrbisPkg delete mode 100644 Dependencies/MidiCS.dll diff --git a/Dependencies/DtxCS.dll b/Dependencies/DtxCS.dll deleted file mode 100644 index 92a982e0836ab31ea169be5580155b530826bdb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22016 zcmeHv33yyrk#60kZ+BnGvedHGk~g&%*=;Qy*^(V)aco(V9T7`bEZLE41*s*qq_(BL zN_We#Vie@;E5SoZU`Uvd$pZodB*6Dr0v{njAVA(rm;pXW0K=Do0K>q9FfU91zrX6- zUS!FEneTh^eeccdYRJdxmWHu{B|;k$i#K_EYYWN=ie@YZw%(ZE~@-& z5q;AC?AlLj`<`9fGagTcrjpKBGCCO=jwTXLIy4juC8raicp}ugzdJPPjKm^Kme?Cy z)m?2w`!s`|Iq=7UOlxOoU8q2-C+Y;nQq*;mxQB4f;UX%QvaalA0^2XYCjmj{pFz8B zW>Nk>cXv@H;rHAG(S9z>5%qE)&iy?^R0!I;juEXom-j|^h{%`6_W{2=509i{C(^*f z9RT2ouddy|(1IyQ80}IVT$AG{F zp9SS~cF?xmn4I4}R9p}f1obbrFH?Vkefc_Uc4Kk-*63j*TgJ{yU^e&jifkNL{H1ZU zDo$6H4-HmBVUZ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V4SW1urYNXfJq;N=OvQ(}OZO=R+Cb7l#H0E1EnAqHz1tYd&N zMJ5InnN$goO!bqjy;S?Cj4m=1P-2C3C89e6p! z24TM$z@KJo9)VtgPz8!lpkH8tKwDs;z#=rq-PRW9ztS5ReUR7 z?SWe4rXT_QrK7GPZTJSFjZl;a+WaNGGCBioW=Qk-FeWiFk<1}NIun=}12Ry&^_sSZ zBtzIW&JY2vRY^-I55weN22<_{(tzqyX>X}P!`tJi4% zNbGpO*xA1?K9s~MY(F-+{Wye(MN=`wiA;?QaTEW~{a)jbcimrL5`|C(n}5&zyJw0z zfP=5riHQ#EkJK4yEG8R!=ANyB4xTUm3;g)2RQV=(ZoacTK;%2+1$36X99J(me^A4O zNhtHDUx)BMWdIOo>?pP4O-m>6cECL-^Y8QKum8jw4RtYv%cMRz!JTK^JhjZiPKu?} zo@)3)3WWgf|J4u zjP2mnf6mTUU?tEirPaqm0WZwMfpIZ+h_`l~jsQw0G1C9y)|L?zE1pYT)N%QOg diff --git a/Dependencies/DtxCS.xml b/Dependencies/DtxCS.xml deleted file mode 100644 index 2cfa558..0000000 --- a/Dependencies/DtxCS.xml +++ /dev/null @@ -1,509 +0,0 @@ - - - - DtxCS - - - -

- Builtin functions, in case I end up writing an interpreter. - - - - - Represents an array of DataNodes. - - - - - Returns DataType.ARRAY - - - - - The children of this array. - - - - - Default constructor for a Data Array. - - - - - Add a node to this Array. - - Node to add - The added node. - - - - Get or set the child of this array at the given index. - - - - - - - Find the array in this array's children at the given index. - - - - - - - Find the integer in this array's children at the given index. - - - - - - - Find the float in this array's children at the given index. - - - - - - - Find the string in this array's children at the given index. - - - - - - - Find the symbol in this array's children at the given index. - - - - - - - Find the variable in this array's children at the given index. - - - - - - - Finds any node at the given index and returns it as a string. - - - - - - - Find the first array in this array's children whose name matches. - If none is found, returns null. - - - - - - - The string representation of the first element of the array, unless - that element is another array, which would result in an empty string. - - - - - The number of elements in this array. - - - - - The string representation of this Array, suitable for putting right - back into a .dta file. - - - - - - Returns a copy of this datacommand with all children evaulated. - - - - - The most basic element of dta. - - - - - The type of this Atom. - - - - - The value of this Atom. - - - - - The value of this Atom. - - - - - The value of this Atom. - - - - - Construct an Atom whose value is a string or symbol. - - The value assigned to this atom. - - - - Construct an Atom whose value is an integer. - - - - - - Construct an Atom whose value is a floating-point value. - - - - - - The string representation of this Atom. - - - - - Returns the string representation of this Atom. - - - - - - Makes a data variable. Scoping not implemented because we're not an interpreter. - Don't give this the $. - - - - - - Represents the possible types of values in a DataArray. - - - - - Integral value. - - - - - Floating point value. - - - - - $-prefixed variable type - - - - - Symbol value. - - - - - '() - - - - - #ifdef directive - - - - - #else directive - - - - - #endif directive - - - - - Array. - - - - - {}-enclosed function call - - - - - ""-enclosed String value. - - - - - []-enclosed macro definition - - - - - #define directive - - - - - #include directive - - - - - #merge directive - - - - - #ifndef directive - - - - - #autorun directive - - - - - #undef directive - - - - - Represents the basic element of DTA, which could be an Atom or an Array. - - - - - The parent of this data node. If null, this is a root node. - - - - - The name of this data node. - - - - - The type of this data node. - - - - - Evaluate this node to get a value. - - - - - - Represents a .dta/.dtx file. - - - - - Parses a plaintext DTA given its bytes in a byte array. If an encoding tag is set, tries to use the correct encoding. - - - - - - - Parses the entirety of a .dta file in plain text into a DataArray. - - - - - - Parses the entirety of a .dta file in a stream to a DataArray. - - - - - - - Parses the string as DTA elements, adding each one to the given root array. - - string of DTA info - top-level array to add the string to - - - - Parses a binary format (dtb) file. - - - - - - Provides a means to decrypt an encrypted DTB file (or any other file using this crypt method). - - - - - Read a signed 8-bit integer from the stream. - - - - - - - Read an unsigned 8-bit integer from the stream. - - - - - - - Read an unsigned 16-bit little-endian integer from the stream. - - - - - - - Read a signed 16-bit little-endian integer from the stream. - - - - - - - Read an unsigned 16-bit Big-endian integer from the stream. - - - - - - - Read a signed 16-bit Big-endian integer from the stream. - - - - - - - Read an unsigned 24-bit little-endian integer from the stream. - - - - - - - Read a signed 24-bit little-endian integer from the stream. - - - - - - - Read an unsigned 24-bit Big-endian integer from the stream. - - - - - - - Read a signed 24-bit Big-endian integer from the stream. - - - - - - - Read an unsigned 32-bit little-endian integer from the stream. - - - - - - - Read a signed 32-bit little-endian integer from the stream. - - - - - - - Read an unsigned 32-bit Big-endian integer from the stream. - - - - - - - Read a signed 32-bit Big-endian integer from the stream. - - - - - - - Read an unsigned 64-bit little-endian integer from the stream. - - - - - - - Read a signed 64-bit little-endian integer from the stream. - - - - - - - Read a single-precision (4-byte) floating-point value from the stream. - - - - - - - Read a null-terminated ASCII string from the given stream. - - - - - - - Read a length-prefixed string of the specified encoding type from the file. - The length is a 32-bit little endian integer. - - - The encoding to use to decode the string. - - - - - Read a length-prefixed UTF-8 string from the given stream. - - - - - - - Read a given number of bytes from a stream into a new byte array. - - - Number of bytes to read (maximum) - New byte array of size <=count. - - - - Read a variable-length integral value as found in MIDI messages. - - - - - - diff --git a/Dependencies/GameArchives b/Dependencies/GameArchives deleted file mode 160000 index 8d718b4..0000000 --- a/Dependencies/GameArchives +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8d718b41e2f672bb69da58d20a0766874a8a65ba diff --git a/Dependencies/LICENSE b/Dependencies/LICENSE deleted file mode 100644 index 341c30b..0000000 --- a/Dependencies/LICENSE +++ /dev/null @@ -1,166 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. - diff --git a/Dependencies/LibOrbisPkg b/Dependencies/LibOrbisPkg deleted file mode 160000 index 6434772..0000000 --- a/Dependencies/LibOrbisPkg +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 643477263b2644e0803e0f58b8726ea4e3f3b7d4 diff --git a/Dependencies/MidiCS.dll b/Dependencies/MidiCS.dll deleted file mode 100644 index b7c03508fb3145f97504fa48fff88e1d7af0a56f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29696 zcmeHw34B!Lx%YFHnIP06 zv30FW#i~_HYp}Mqy?SeHZPjWowAyOb&#jAHw9v)YZnxgs-rn}M`u(5heP_u6wfElN z@B4ko(-s;`^h9fYKJOgudP@t@Cc~ni zee$IXGSQCFtWbebM>K#MTh(6u0hA%UNAV^q5!zIFa|P!wuVX;e^UI>ft5}u)%axkt zD!l69_Z%ihiJs$*82>s#REWC2TuU^4yzFFrh{&BMcZ1)M$JeH#d(+@==m$V1ZPj^$ zlUInSvo@JZc7v1LMnP~x<9O%28Zlh8$>=}=ikvGQ!JB<0@y>fS60OZ+h3w;g#fx(@ z$w>>FiC)B*7*hN9!z?q5$aZfHOoMd}nu-#>{AD-J0O2+5(y|1G!#mF|Jy-)}G{=4k z%B&mKy5(8j@~mzMbCWvkvV$|aLIk>_v#(~JX}uK2{IIqCDP!&JQcGFAe8?`dW^`v5 zc{3G5i|Le0!Cu>y*Zbh| zeR#ozM&P4EaGBeNb9$%Kn;DxE=Lf?HV~ff0uJg;-PslIdhnJf%d44m@FdCZ4a~0C& z`C5^kgB2&4gJb&9o_4UhysHzl$_fYABhL>krF?(yZhqL)tm^XYxMM6U)NDbjQ&g%l zZ%&pgGQoi7IuV&>rf??`RbAd$1COQRk#oIL=Q<MY@MD^1v3S2Al=hk8m3yF#rnQK+$j?`C3kXumsgJM@`^F0m~$2_MqgQ&!`6%?R%w4tX}=dU5`$tFlol>1 zwr6x!w)$(l@aHcn(a{{XEJ1=Sl5V`?^WIo*jrG(;^jw#Jj+4 zyAqh6-g(y4T92K;*6+0z7nljmFz-uq3l<%-6J;P}T_7FVZ`9)R+A`&M+p*P@vs?)b zzqe+o8AeLpFs>fFM6>%P?^R|3W8k&=x0{Jd5Oof#e}PZYO0*+3(Xor$Y0(Ga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JR&uAOYp<6+1 z#3^$#_>I8zp!xNLzoP00RJBcU$g;WEr&it##y*uw5Y1|bUICUm) z_T>8}^}K=bU9AvmX9LGRWyw522_cqxwxc5QS)ZS^@F|nq!q01RPewA&lT!TbgJvOO zCgzaX>_acA`!?Mue8bHJolK9cL#!0;0l0lbW7?m2j@69z^Q#WKdCqPd?2@p|^;aD- zSb{f~-2N5#-kgC^Jx+}?LlkdM4t&-<%uv?FB*BSUlAbgC8%m<_g$KI=Ae?_m3 ztqb9sS|Qv?)gcG@(F3Z1mwZ2Jr1{wuKO5uwPCkLF*Xfe$InoR285~E>^bu#yBZylw zw3naTai8SpTq}L5?l*dHC)15K=UO_}jw9AfUyjuu-=pLEa~-~KY+&~Aoe8&rpNaBQ sh!feZzzCd*?=aS)KbGN}gYv@=s=0qZj;Q}<;I;Tw&i{G+|JMWm8xCJg Date: Mon, 12 Sep 2022 16:41:17 -0400 Subject: [PATCH 03/40] Fix Dependency links --- Dependencies/GameArchives/.gitattributes | 63 ++ Dependencies/GameArchives/.gitignore | 212 +++++ .../GameArchives/ArchiveExplorer/App.config | 6 + .../ArchiveExplorer.Designer.cs | 220 +++++ .../ArchiveExplorer/ArchiveExplorer.cs | 202 +++++ .../ArchiveExplorer/ArchiveExplorer.csproj | 28 + .../ArchiveExplorer.licenseheader | 21 + .../ArchiveExplorer/ArchiveExplorer.resx | 126 +++ .../ArchiveExplorer/Images/File_large.png | Bin 0 -> 1000 bytes .../ArchiveExplorer/Images/File_small.png | Bin 0 -> 445 bytes .../ArchiveExplorer/Images/Folder_large.png | Bin 0 -> 533 bytes .../ArchiveExplorer/Images/Folder_small.png | Bin 0 -> 229 bytes .../ArchiveExplorer/Images/spinner.gif | Bin 0 -> 2128 bytes .../KeyRequestForm.Designer.cs | 99 ++ .../ArchiveExplorer/KeyRequestForm.cs | 38 + .../ArchiveExplorer/KeyRequestForm.resx | 120 +++ .../GameArchives/ArchiveExplorer/Program.cs | 42 + .../Properties/AssemblyInfo.cs | 36 + .../Properties/Resources.Designer.cs | 73 ++ .../ArchiveExplorer/Properties/Resources.resx | 124 +++ .../Properties/Settings.Designer.cs | 26 + .../Properties/Settings.settings | 7 + Dependencies/GameArchives/GameArchives.sln | 44 + .../GameArchivesTests.csproj | 46 + .../Local/LocalDirectoryTests.cs | 19 + .../Properties/AssemblyInfo.cs | 36 + Dependencies/GameArchives/LICENSE | 166 ++++ .../EditorWindow.Designer.cs | 242 +++++ .../LibArchiveExplorer/EditorWindow.cs | 177 ++++ .../LibArchiveExplorer/EditorWindow.resx | 120 +++ .../LibArchiveExplorer/Extensions.cs | 46 + .../LibArchiveExplorer/FolderSelectDialog.cs | 154 ++++ .../LibArchiveExplorer.csproj | 25 + .../LibArchiveExplorer/PackageManager.cs | 70 ++ .../PackageView.Designer.cs | 279 ++++++ .../LibArchiveExplorer/PackageView.cs | 308 +++++++ .../LibArchiveExplorer/PackageView.resx | 524 +++++++++++ .../Properties/AssemblyInfo.cs | 36 + .../LibArchiveExplorer/Reflector.cs | 183 ++++ .../GameArchives/Library/.editorconfig | 14 + .../GameArchives/Library/ArchiveInterfaces.cs | 246 +++++ .../GameArchives/Library/Ark/ArkDirectory.cs | 31 + .../GameArchives/Library/Ark/ArkPackage.cs | 470 ++++++++++ .../Library/Ark/HdrCryptStream.cs | 139 +++ .../Library/Ark/ProtectedFileStream.cs | 220 +++++ .../Library/Common/DefaultDirectory.cs | 109 +++ .../Library/Common/MultiStream.cs | 213 +++++ .../GameArchives/Library/Common/OffsetFile.cs | 87 ++ .../Library/Common/OffsetStream.cs | 122 +++ .../Library/FSAR/AesCryptStream.cs | 155 ++++ .../Library/FSAR/FSARDirectory.cs | 31 + .../GameArchives/Library/FSAR/FSARFile.cs | 79 ++ .../GameArchives/Library/FSAR/FSARPackage.cs | 149 +++ .../Library/FSGIMG/FSGIMGDirectory.cs | 33 + .../Library/FSGIMG/FSGIMGPackage.cs | 175 ++++ .../GameArchives/Library/GameArchives.csproj | 32 + .../Library/GameArchives.licenseheader | 21 + .../Library/Local/LocalDirectory.cs | 115 +++ .../GameArchives/Library/Local/LocalFile.cs | 67 ++ .../Library/PFS/PFSCDecompressStream.cs | 159 ++++ .../GameArchives/Library/PFS/PFSDirectory.cs | 32 + .../GameArchives/Library/PFS/PFSFile.cs | 34 + .../GameArchives/Library/PFS/PFSPackage.cs | 379 ++++++++ .../Library/PFS/XtsCryptStream.cs | 206 +++++ .../GameArchives/Library/PKF/PKFDirectory.cs | 12 + .../GameArchives/Library/PKF/PKFFile.cs | 61 ++ .../GameArchives/Library/PKF/PKFPackage.cs | 127 +++ .../Library/PSARC/PSARCDirectory.cs | 31 + .../GameArchives/Library/PSARC/PSARCFile.cs | 76 ++ .../Library/PSARC/PSARCPackage.cs | 197 ++++ .../GameArchives/Library/PackageReader.cs | 141 +++ .../GameArchives/Library/PackageType.cs | 138 +++ .../Library/Properties/AssemblyInfo.cs | 55 ++ .../Library/STFS/STFSDirectory.cs | 34 + .../GameArchives/Library/STFS/STFSFile.cs | 255 ++++++ .../GameArchives/Library/STFS/STFSPackage.cs | 423 +++++++++ .../Library/Seven45/PowerChordCryptStream.cs | 153 ++++ .../Library/Seven45/Seven45Package.cs | 204 +++++ .../GameArchives/Library/StreamExtensions.cs | 375 ++++++++ .../GameArchives/Library/U8/U8Directory.cs | 30 + .../GameArchives/Library/U8/U8Package.cs | 143 +++ Dependencies/GameArchives/Library/Util.cs | 102 +++ .../Library/XISO/XISODirectory.cs | 40 + .../GameArchives/Library/XISO/XISOFSNode.cs | 18 + .../GameArchives/Library/XISO/XISOFile.cs | 21 + .../GameArchives/Library/XISO/XISOPackage.cs | 222 +++++ Dependencies/GameArchives/README.md | 64 ++ Dependencies/GameArchives/appveyor.yml | 22 + Dependencies/LibOrbisPkg/.editorconfig | 4 + Dependencies/LibOrbisPkg/.gitattributes | 66 ++ Dependencies/LibOrbisPkg/.gitignore | 261 ++++++ Dependencies/LibOrbisPkg/.gitmodules | 0 Dependencies/LibOrbisPkg/CollisionResolver.bt | 26 + Dependencies/LibOrbisPkg/LICENSE.txt | 165 ++++ Dependencies/LibOrbisPkg/LibOrbisPkg.Core.sln | 31 + .../LibOrbisPkg.Core/LibOrbisPkg.Core.csproj | 75 ++ Dependencies/LibOrbisPkg/LibOrbisPkg.sln | 79 ++ .../LibOrbisPkg/LibOrbisPkg/GP4/Gp4Creator.cs | 221 +++++ .../LibOrbisPkg/LibOrbisPkg/GP4/Gp4Project.cs | 513 +++++++++++ .../LibOrbisPkg/GP4/Gp4Validator.cs | 209 +++++ .../LibOrbisPkg/LibOrbisPkg.csproj | 17 + .../LibOrbisPkg/LibOrbisPkg/PFS/FSTree.cs | 194 ++++ .../LibOrbisPkg/PFS/FlatPathTable.cs | 149 +++ .../LibOrbisPkg/LibOrbisPkg/PFS/PFSBuilder.cs | 670 ++++++++++++++ .../LibOrbisPkg/LibOrbisPkg/PFS/PFSCReader.cs | 162 ++++ .../LibOrbisPkg/LibOrbisPkg/PFS/PFSCWriter.cs | 54 ++ .../LibOrbisPkg/PFS/PfsProperties.cs | 135 +++ .../LibOrbisPkg/LibOrbisPkg/PFS/PfsReader.cs | 303 +++++++ .../LibOrbisPkg/LibOrbisPkg/PFS/PfsStructs.cs | 586 ++++++++++++ .../LibOrbisPkg/PFS/XtsDecryptReader.cs | 165 ++++ .../LibOrbisPkg/LibOrbisPkg/PKG/Entry.cs | 464 ++++++++++ .../LibOrbisPkg/LibOrbisPkg/PKG/Enums.cs | 759 ++++++++++++++++ .../LibOrbisPkg/LibOrbisPkg/PKG/Pkg.cs | 263 ++++++ .../LibOrbisPkg/LibOrbisPkg/PKG/PkgBuilder.cs | 533 +++++++++++ .../LibOrbisPkg/PKG/PkgProperties.cs | 82 ++ .../LibOrbisPkg/LibOrbisPkg/PKG/PkgReader.cs | 276 ++++++ .../LibOrbisPkg/PKG/PkgValidator.cs | 352 ++++++++ .../LibOrbisPkg/LibOrbisPkg/PKG/PkgWriter.cs | 118 +++ .../LibOrbisPkg/PlayGo/ChunkDat.cs | 214 +++++ .../LibOrbisPkg/PlayGo/Manifest.cs | 54 ++ .../LibOrbisPkg/Properties/AssemblyInfo.cs | 36 + .../LibOrbisPkg/LibOrbisPkg/Rif/LicenseDat.cs | 169 ++++ .../LibOrbisPkg/Rif/LicenseInfo.cs | 42 + .../LibOrbisPkg/LibOrbisPkg/SFO/ParamSfo.cs | 455 ++++++++++ .../LibOrbisPkg/LibOrbisPkg/Util/Crypto.cs | 382 ++++++++ .../LibOrbisPkg/Util/Extensions.cs | 36 + .../LibOrbisPkg/LibOrbisPkg/Util/Keys.cs | 503 +++++++++++ .../LibOrbisPkg/Util/MemoryMapped.cs | 269 ++++++ .../LibOrbisPkg/Util/MersenneTwister.cs | 90 ++ .../LibOrbisPkg/Util/OffsetStream.cs | 75 ++ .../LibOrbisPkg/Util/ReaderBase.cs | 76 ++ .../LibOrbisPkg/Util/StreamExtensions.cs | 482 ++++++++++ .../LibOrbisPkg/LibOrbisPkg/Util/SubStream.cs | 96 ++ .../LibOrbisPkg/Util/WriterBase.cs | 99 ++ .../LibOrbisPkg/Util/XtsBlockTransform.cs | 85 ++ .../LibOrbisPkgTests/LibOrbisPkgTests.csproj | 19 + .../LibOrbisPkgTests/PfsBuildTests.cs | 41 + .../LibOrbisPkgTests/PfsReaderTests.cs | 63 ++ .../LibOrbisPkgTests/PkgBuildTest.cs | 171 ++++ .../LibOrbisPkgTests/PkgReadTest.cs | 94 ++ .../Properties/AssemblyInfo.cs | 20 + .../LibOrbisPkg/LibOrbisPkgTests/SfoTest.cs | 75 ++ .../LibOrbisPkg/LibOrbisPkgTests/TempDir.cs | 31 + .../LibOrbisPkg/LibOrbisPkgTests/TempFile.cs | 29 + .../LibOrbisPkgTests/TestHelper.cs | 122 +++ .../LibOrbisPkg/LibOrbisPkgTests/XtsTest.cs | 35 + Dependencies/LibOrbisPkg/PFSC.bt | 22 + Dependencies/LibOrbisPkg/PS4PFS.bt | 310 +++++++ Dependencies/LibOrbisPkg/PS4PKG.bt | 852 ++++++++++++++++++ .../PkgEditor.Core/PkgEditor.Core.csproj | 68 ++ .../PkgEditor/Images/File_large.png | Bin 0 -> 1000 bytes .../PkgEditor/Images/File_small.png | Bin 0 -> 445 bytes .../PkgEditor/Images/Folder_large.png | Bin 0 -> 533 bytes .../PkgEditor/Images/Folder_small.png | Bin 0 -> 229 bytes .../LibOrbisPkg/PkgEditor/Images/spinner.gif | Bin 0 -> 2128 bytes Dependencies/LibOrbisPkg/PkgEditor/KeyDB.cs | 79 ++ .../PkgEditor/LogWindow.Designer.cs | 63 ++ .../LibOrbisPkg/PkgEditor/LogWindow.cs | 43 + .../LibOrbisPkg/PkgEditor/LogWindow.resx | 120 +++ .../LibOrbisPkg/PkgEditor/MainWin.Designer.cs | 260 ++++++ Dependencies/LibOrbisPkg/PkgEditor/MainWin.cs | 327 +++++++ .../LibOrbisPkg/PkgEditor/MainWin.resx | 152 ++++ .../PkgEditor/PasscodeEntry.Designer.cs | 101 +++ .../LibOrbisPkg/PkgEditor/PasscodeEntry.cs | 23 + .../LibOrbisPkg/PkgEditor/PasscodeEntry.resx | 120 +++ .../LibOrbisPkg/PkgEditor/PkgEditor.csproj | 52 ++ Dependencies/LibOrbisPkg/PkgEditor/Program.cs | 22 + .../PkgEditor/Properties/AssemblyInfo.cs | 36 + .../Properties/Resources.Designer.cs | 63 ++ .../PkgEditor/Properties/Resources.resx | 117 +++ .../PkgEditor/Properties/Settings.Designer.cs | 26 + .../PkgEditor/Properties/Settings.settings | 7 + .../PkgEditor/ValidationDialog.Designer.cs | 122 +++ .../LibOrbisPkg/PkgEditor/ValidationDialog.cs | 73 ++ .../PkgEditor/ValidationDialog.resx | 120 +++ .../PkgEditor/Views/CryptoDebug.Designer.cs | 277 ++++++ .../PkgEditor/Views/CryptoDebug.cs | 125 +++ .../PkgEditor/Views/CryptoDebug.resx | 120 +++ .../PkgEditor/Views/FileView.Designer.cs | 189 ++++ .../LibOrbisPkg/PkgEditor/Views/FileView.cs | 189 ++++ .../LibOrbisPkg/PkgEditor/Views/FileView.resx | 539 +++++++++++ .../PkgEditor/Views/GP4View.Designer.cs | 412 +++++++++ .../LibOrbisPkg/PkgEditor/Views/GP4View.cs | 519 +++++++++++ .../LibOrbisPkg/PkgEditor/Views/GP4View.resx | 180 ++++ .../PkgEditor/Views/ObjectView.Designer.cs | 56 ++ .../LibOrbisPkg/PkgEditor/Views/ObjectView.cs | 110 +++ .../PkgEditor/Views/ObjectView.resx | 120 +++ .../PkgEditor/Views/PFSView.Designer.cs | 57 ++ .../LibOrbisPkg/PkgEditor/Views/PFSView.cs | 65 ++ .../LibOrbisPkg/PkgEditor/Views/PFSView.resx | 120 +++ .../PkgEditor/Views/PkgView.Designer.cs | 658 ++++++++++++++ .../LibOrbisPkg/PkgEditor/Views/PkgView.cs | 506 +++++++++++ .../LibOrbisPkg/PkgEditor/Views/PkgView.resx | 123 +++ .../PkgEditor/Views/SFOView.Designer.cs | 733 +++++++++++++++ .../LibOrbisPkg/PkgEditor/Views/SFOView.cs | 468 ++++++++++ .../LibOrbisPkg/PkgEditor/Views/SFOView.resx | 126 +++ .../LibOrbisPkg/PkgEditor/Views/View.cs | 51 ++ Dependencies/LibOrbisPkg/PkgEditor/app.config | 3 + .../LibOrbisPkg/PkgEditor/pkgtool.ico | Bin 0 -> 1406 bytes .../PkgTool.Core/PkgTool.Core.csproj | 24 + .../LibOrbisPkg/PkgTool/PkgTool.csproj | 18 + Dependencies/LibOrbisPkg/PkgTool/Program.cs | 756 ++++++++++++++++ .../PkgTool/Properties/AssemblyInfo.cs | 36 + Dependencies/LibOrbisPkg/PlaygoChunkDat.bt | 86 ++ Dependencies/LibOrbisPkg/README.md | 89 ++ Dependencies/LibOrbisPkg/Rif.bt | 24 + Dependencies/LibOrbisPkg/SFO.bt | 19 + Dependencies/LibOrbisPkg/appveyor.yml | 90 ++ Dependencies/LibOrbisPkg/idx.bt | 15 + Dependencies/LibOrbisPkg/rifa.bt | 33 + 210 files changed, 31089 insertions(+) create mode 100644 Dependencies/GameArchives/.gitattributes create mode 100644 Dependencies/GameArchives/.gitignore create mode 100644 Dependencies/GameArchives/ArchiveExplorer/App.config create mode 100644 Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.Designer.cs create mode 100644 Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.cs create mode 100644 Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.csproj create mode 100644 Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.licenseheader create mode 100644 Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.resx create mode 100644 Dependencies/GameArchives/ArchiveExplorer/Images/File_large.png create mode 100644 Dependencies/GameArchives/ArchiveExplorer/Images/File_small.png create mode 100644 Dependencies/GameArchives/ArchiveExplorer/Images/Folder_large.png create mode 100644 Dependencies/GameArchives/ArchiveExplorer/Images/Folder_small.png create mode 100644 Dependencies/GameArchives/ArchiveExplorer/Images/spinner.gif create mode 100644 Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.Designer.cs create mode 100644 Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.cs create mode 100644 Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.resx create mode 100644 Dependencies/GameArchives/ArchiveExplorer/Program.cs create mode 100644 Dependencies/GameArchives/ArchiveExplorer/Properties/AssemblyInfo.cs create mode 100644 Dependencies/GameArchives/ArchiveExplorer/Properties/Resources.Designer.cs create mode 100644 Dependencies/GameArchives/ArchiveExplorer/Properties/Resources.resx create mode 100644 Dependencies/GameArchives/ArchiveExplorer/Properties/Settings.Designer.cs create mode 100644 Dependencies/GameArchives/ArchiveExplorer/Properties/Settings.settings create mode 100644 Dependencies/GameArchives/GameArchives.sln create mode 100644 Dependencies/GameArchives/GameArchivesTests/GameArchivesTests.csproj create mode 100644 Dependencies/GameArchives/GameArchivesTests/Local/LocalDirectoryTests.cs create mode 100644 Dependencies/GameArchives/GameArchivesTests/Properties/AssemblyInfo.cs create mode 100644 Dependencies/GameArchives/LICENSE create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.Designer.cs create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.cs create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.resx create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/Extensions.cs create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/FolderSelectDialog.cs create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/LibArchiveExplorer.csproj create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/PackageManager.cs create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/PackageView.Designer.cs create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/PackageView.cs create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/PackageView.resx create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/Properties/AssemblyInfo.cs create mode 100644 Dependencies/GameArchives/LibArchiveExplorer/Reflector.cs create mode 100644 Dependencies/GameArchives/Library/.editorconfig create mode 100644 Dependencies/GameArchives/Library/ArchiveInterfaces.cs create mode 100644 Dependencies/GameArchives/Library/Ark/ArkDirectory.cs create mode 100644 Dependencies/GameArchives/Library/Ark/ArkPackage.cs create mode 100644 Dependencies/GameArchives/Library/Ark/HdrCryptStream.cs create mode 100644 Dependencies/GameArchives/Library/Ark/ProtectedFileStream.cs create mode 100644 Dependencies/GameArchives/Library/Common/DefaultDirectory.cs create mode 100644 Dependencies/GameArchives/Library/Common/MultiStream.cs create mode 100644 Dependencies/GameArchives/Library/Common/OffsetFile.cs create mode 100644 Dependencies/GameArchives/Library/Common/OffsetStream.cs create mode 100644 Dependencies/GameArchives/Library/FSAR/AesCryptStream.cs create mode 100644 Dependencies/GameArchives/Library/FSAR/FSARDirectory.cs create mode 100644 Dependencies/GameArchives/Library/FSAR/FSARFile.cs create mode 100644 Dependencies/GameArchives/Library/FSAR/FSARPackage.cs create mode 100644 Dependencies/GameArchives/Library/FSGIMG/FSGIMGDirectory.cs create mode 100644 Dependencies/GameArchives/Library/FSGIMG/FSGIMGPackage.cs create mode 100644 Dependencies/GameArchives/Library/GameArchives.csproj create mode 100644 Dependencies/GameArchives/Library/GameArchives.licenseheader create mode 100644 Dependencies/GameArchives/Library/Local/LocalDirectory.cs create mode 100644 Dependencies/GameArchives/Library/Local/LocalFile.cs create mode 100644 Dependencies/GameArchives/Library/PFS/PFSCDecompressStream.cs create mode 100644 Dependencies/GameArchives/Library/PFS/PFSDirectory.cs create mode 100644 Dependencies/GameArchives/Library/PFS/PFSFile.cs create mode 100644 Dependencies/GameArchives/Library/PFS/PFSPackage.cs create mode 100644 Dependencies/GameArchives/Library/PFS/XtsCryptStream.cs create mode 100644 Dependencies/GameArchives/Library/PKF/PKFDirectory.cs create mode 100644 Dependencies/GameArchives/Library/PKF/PKFFile.cs create mode 100644 Dependencies/GameArchives/Library/PKF/PKFPackage.cs create mode 100644 Dependencies/GameArchives/Library/PSARC/PSARCDirectory.cs create mode 100644 Dependencies/GameArchives/Library/PSARC/PSARCFile.cs create mode 100644 Dependencies/GameArchives/Library/PSARC/PSARCPackage.cs create mode 100644 Dependencies/GameArchives/Library/PackageReader.cs create mode 100644 Dependencies/GameArchives/Library/PackageType.cs create mode 100644 Dependencies/GameArchives/Library/Properties/AssemblyInfo.cs create mode 100644 Dependencies/GameArchives/Library/STFS/STFSDirectory.cs create mode 100644 Dependencies/GameArchives/Library/STFS/STFSFile.cs create mode 100644 Dependencies/GameArchives/Library/STFS/STFSPackage.cs create mode 100644 Dependencies/GameArchives/Library/Seven45/PowerChordCryptStream.cs create mode 100644 Dependencies/GameArchives/Library/Seven45/Seven45Package.cs create mode 100644 Dependencies/GameArchives/Library/StreamExtensions.cs create mode 100644 Dependencies/GameArchives/Library/U8/U8Directory.cs create mode 100644 Dependencies/GameArchives/Library/U8/U8Package.cs create mode 100644 Dependencies/GameArchives/Library/Util.cs create mode 100644 Dependencies/GameArchives/Library/XISO/XISODirectory.cs create mode 100644 Dependencies/GameArchives/Library/XISO/XISOFSNode.cs create mode 100644 Dependencies/GameArchives/Library/XISO/XISOFile.cs create mode 100644 Dependencies/GameArchives/Library/XISO/XISOPackage.cs create mode 100644 Dependencies/GameArchives/README.md create mode 100644 Dependencies/GameArchives/appveyor.yml create mode 100644 Dependencies/LibOrbisPkg/.editorconfig create mode 100644 Dependencies/LibOrbisPkg/.gitattributes create mode 100644 Dependencies/LibOrbisPkg/.gitignore create mode 100644 Dependencies/LibOrbisPkg/.gitmodules create mode 100644 Dependencies/LibOrbisPkg/CollisionResolver.bt create mode 100644 Dependencies/LibOrbisPkg/LICENSE.txt create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg.Core.sln create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg.Core/LibOrbisPkg.Core.csproj create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg.sln create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/GP4/Gp4Creator.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/GP4/Gp4Project.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/GP4/Gp4Validator.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/LibOrbisPkg.csproj create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PFS/FSTree.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PFS/FlatPathTable.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PFS/PFSBuilder.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PFS/PFSCReader.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PFS/PFSCWriter.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PFS/PfsProperties.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PFS/PfsReader.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PFS/PfsStructs.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PFS/XtsDecryptReader.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PKG/Entry.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PKG/Enums.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PKG/Pkg.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PKG/PkgBuilder.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PKG/PkgProperties.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PKG/PkgReader.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PKG/PkgValidator.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PKG/PkgWriter.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PlayGo/ChunkDat.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/PlayGo/Manifest.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Properties/AssemblyInfo.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Rif/LicenseDat.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Rif/LicenseInfo.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/SFO/ParamSfo.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Util/Crypto.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Util/Extensions.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Util/Keys.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Util/MemoryMapped.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Util/MersenneTwister.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Util/OffsetStream.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Util/ReaderBase.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Util/StreamExtensions.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Util/SubStream.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Util/WriterBase.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkg/Util/XtsBlockTransform.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkgTests/LibOrbisPkgTests.csproj create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkgTests/PfsBuildTests.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkgTests/PfsReaderTests.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkgTests/PkgBuildTest.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkgTests/PkgReadTest.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkgTests/Properties/AssemblyInfo.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkgTests/SfoTest.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkgTests/TempDir.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkgTests/TempFile.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkgTests/TestHelper.cs create mode 100644 Dependencies/LibOrbisPkg/LibOrbisPkgTests/XtsTest.cs create mode 100644 Dependencies/LibOrbisPkg/PFSC.bt create mode 100644 Dependencies/LibOrbisPkg/PS4PFS.bt create mode 100644 Dependencies/LibOrbisPkg/PS4PKG.bt create mode 100644 Dependencies/LibOrbisPkg/PkgEditor.Core/PkgEditor.Core.csproj create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Images/File_large.png create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Images/File_small.png create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Images/Folder_large.png create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Images/Folder_small.png create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Images/spinner.gif create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/KeyDB.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/LogWindow.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/LogWindow.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/LogWindow.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/MainWin.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/MainWin.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/MainWin.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/PasscodeEntry.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/PasscodeEntry.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/PasscodeEntry.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/PkgEditor.csproj create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Program.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Properties/AssemblyInfo.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Properties/Resources.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Properties/Resources.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Properties/Settings.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Properties/Settings.settings create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/ValidationDialog.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/ValidationDialog.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/ValidationDialog.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/CryptoDebug.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/CryptoDebug.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/CryptoDebug.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/FileView.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/FileView.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/FileView.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/GP4View.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/GP4View.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/GP4View.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/ObjectView.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/ObjectView.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/ObjectView.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/PFSView.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/PFSView.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/PFSView.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/PkgView.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/PkgView.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/PkgView.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/SFOView.Designer.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/SFOView.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/SFOView.resx create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/Views/View.cs create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/app.config create mode 100644 Dependencies/LibOrbisPkg/PkgEditor/pkgtool.ico create mode 100644 Dependencies/LibOrbisPkg/PkgTool.Core/PkgTool.Core.csproj create mode 100644 Dependencies/LibOrbisPkg/PkgTool/PkgTool.csproj create mode 100644 Dependencies/LibOrbisPkg/PkgTool/Program.cs create mode 100644 Dependencies/LibOrbisPkg/PkgTool/Properties/AssemblyInfo.cs create mode 100644 Dependencies/LibOrbisPkg/PlaygoChunkDat.bt create mode 100644 Dependencies/LibOrbisPkg/README.md create mode 100644 Dependencies/LibOrbisPkg/Rif.bt create mode 100644 Dependencies/LibOrbisPkg/SFO.bt create mode 100644 Dependencies/LibOrbisPkg/appveyor.yml create mode 100644 Dependencies/LibOrbisPkg/idx.bt create mode 100644 Dependencies/LibOrbisPkg/rifa.bt diff --git a/Dependencies/GameArchives/.gitattributes b/Dependencies/GameArchives/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/Dependencies/GameArchives/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/Dependencies/GameArchives/.gitignore b/Dependencies/GameArchives/.gitignore new file mode 100644 index 0000000..b06e864 --- /dev/null +++ b/Dependencies/GameArchives/.gitignore @@ -0,0 +1,212 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +## TODO: Comment the next line if you want to checkin your +## web deploy settings but do note that will include unencrypted +## passwords +#*.pubxml + +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml diff --git a/Dependencies/GameArchives/ArchiveExplorer/App.config b/Dependencies/GameArchives/ArchiveExplorer/App.config new file mode 100644 index 0000000..d1428ad --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.Designer.cs b/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.Designer.cs new file mode 100644 index 0000000..02846cd --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.Designer.cs @@ -0,0 +1,220 @@ +namespace ArchiveExplorer +{ + partial class ArchiveExplorer + { + ///

+ /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.detailsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.iconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.listToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openGitHubRepositoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.packagesTabControl = new System.Windows.Forms.TabControl(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.spinnerLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.menuStrip1.SuspendLayout(); + this.statusStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.viewToolStripMenuItem, + this.helpToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(684, 24); + this.menuStrip1.TabIndex = 0; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.openToolStripMenuItem, + this.closeToolStripMenuItem, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "File"; + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(112, 22); + this.openToolStripMenuItem.Text = "Open..."; + this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // closeToolStripMenuItem + // + this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; + this.closeToolStripMenuItem.Size = new System.Drawing.Size(112, 22); + this.closeToolStripMenuItem.Text = "Close"; + this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(112, 22); + this.exitToolStripMenuItem.Text = "Exit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // viewToolStripMenuItem + // + this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.detailsToolStripMenuItem, + this.iconsToolStripMenuItem, + this.listToolStripMenuItem}); + this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; + this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.viewToolStripMenuItem.Text = "View"; + // + // detailsToolStripMenuItem + // + this.detailsToolStripMenuItem.Checked = true; + this.detailsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.detailsToolStripMenuItem.Name = "detailsToolStripMenuItem"; + this.detailsToolStripMenuItem.Size = new System.Drawing.Size(109, 22); + this.detailsToolStripMenuItem.Text = "Details"; + this.detailsToolStripMenuItem.Click += new System.EventHandler(this.detailsToolStripMenuItem_Click); + // + // iconsToolStripMenuItem + // + this.iconsToolStripMenuItem.Name = "iconsToolStripMenuItem"; + this.iconsToolStripMenuItem.Size = new System.Drawing.Size(109, 22); + this.iconsToolStripMenuItem.Text = "Icons"; + this.iconsToolStripMenuItem.Click += new System.EventHandler(this.iconsToolStripMenuItem_Click); + // + // listToolStripMenuItem + // + this.listToolStripMenuItem.Name = "listToolStripMenuItem"; + this.listToolStripMenuItem.Size = new System.Drawing.Size(109, 22); + this.listToolStripMenuItem.Text = "List"; + this.listToolStripMenuItem.Click += new System.EventHandler(this.listToolStripMenuItem_Click); + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.openGitHubRepositoryToolStripMenuItem}); + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem.Text = "Help"; + // + // openGitHubRepositoryToolStripMenuItem + // + this.openGitHubRepositoryToolStripMenuItem.Name = "openGitHubRepositoryToolStripMenuItem"; + this.openGitHubRepositoryToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.openGitHubRepositoryToolStripMenuItem.Text = "Open GitHub repository"; + this.openGitHubRepositoryToolStripMenuItem.Click += new System.EventHandler(this.gitHubToolStripMenuItem_Click); + // + // packagesTabControl + // + this.packagesTabControl.AllowDrop = true; + this.packagesTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.packagesTabControl.Location = new System.Drawing.Point(0, 27); + this.packagesTabControl.Multiline = true; + this.packagesTabControl.Name = "packagesTabControl"; + this.packagesTabControl.SelectedIndex = 0; + this.packagesTabControl.Size = new System.Drawing.Size(684, 409); + this.packagesTabControl.TabIndex = 1; + this.packagesTabControl.DragDrop += new System.Windows.Forms.DragEventHandler(this.packagesTabControl_DragDrop); + this.packagesTabControl.DragEnter += new System.Windows.Forms.DragEventHandler(this.packagesTabControl_DragEnter); + this.packagesTabControl.MouseClick += new System.Windows.Forms.MouseEventHandler(this.tabControl1_Click); + // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.spinnerLabel, + this.toolStripStatusLabel1}); + this.statusStrip1.Location = new System.Drawing.Point(0, 439); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size(684, 22); + this.statusStrip1.TabIndex = 2; + this.statusStrip1.Text = "statusStrip1"; + // + // spinnerLabel + // + this.spinnerLabel.Image = global::ArchiveExplorer.Properties.Resources.spinner; + this.spinnerLabel.Name = "spinnerLabel"; + this.spinnerLabel.Size = new System.Drawing.Size(16, 17); + this.spinnerLabel.Visible = false; + // + // toolStripStatusLabel1 + // + this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + this.toolStripStatusLabel1.Size = new System.Drawing.Size(42, 17); + this.toolStripStatusLabel1.Text = "Ready."; + // + // ArchiveExplorer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(684, 461); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.packagesTabControl); + this.Controls.Add(this.menuStrip1); + this.MainMenuStrip = this.menuStrip1; + this.Name = "ArchiveExplorer"; + this.Text = "ArchiveExplorer"; + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem detailsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem iconsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem listToolStripMenuItem; + private System.Windows.Forms.TabControl packagesTabControl; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.ToolStripStatusLabel spinnerLabel; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openGitHubRepositoryToolStripMenuItem; + } +} + diff --git a/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.cs b/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.cs new file mode 100644 index 0000000..7fdcae3 --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.cs @@ -0,0 +1,202 @@ +/* + * ArchiveExplorer.cs + * + * Copyright (c) 2015,2016, maxton. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; If not, see + * . + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using GameArchives; +using System.IO; +using FolderSelect; +using LibArchiveExplorer; + +namespace ArchiveExplorer +{ + public partial class ArchiveExplorer : Form + { + private PackageManager pm; + + public ArchiveExplorer() + { + InitializeComponent(); + pm = PackageManager.GetInstance(); + pm.Spinner = this.spinnerLabel; + pm.StatusLabel = this.toolStripStatusLabel1; + pm.Loader = LoadFile; + pm.SetReady(); + string[] args = Environment.GetCommandLineArgs(); + if (args.Length > 1) + { + if(File.Exists(args[1])) + { + LoadFile(Util.LocalFile(args[1])); + } + } + } + + private string passcode_popup(string prompt) + { + var form = new KeyRequestForm(prompt); + return form.ShowDialog() == DialogResult.OK ? form.Passcode : ""; + } + + /// + /// Deal with a new file. + /// + /// + private async Task LoadFile(IFile file) + { + var newPage = new TabPage(); + newPage.Text = "Loading..."; + packagesTabControl.Controls.Add(newPage); + PackageView packageView = null; + try + { + var newPackage = await Task.Run(() => PackageReader.ReadPackageFromFile(file, passcode_popup)); + packageView = new PackageView(newPackage, pm); + packageView.OnRemoveTab += RemoveTab; + newPage.Text = newPackage.FileName; + newPage.Controls.Add(packageView); + packageView.Tag = newPage; + packageView.SetView(view); + packageView.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + packageView.Dock = System.Windows.Forms.DockStyle.Fill; + packageView.Location = new System.Drawing.Point(3, 3); + packageView.Margin = new System.Windows.Forms.Padding(0); + packageView.Name = "packageView"; + packageView.TabIndex = 0; + packagesTabControl.SelectedTab = newPage; + } + catch (Exception ex) + { + packagesTabControl.Controls.Remove(newPage); + MessageBox.Show("Could not load archive!" + Environment.NewLine + ex.Message, "Error"); + } + return packageView; + }//LoadFile + + public void RemoveTab(TabPage p) + { + packagesTabControl.Controls.Remove(p); + } + + + + private void openToolStripMenuItem_Click(object sender, EventArgs e) + { + var of = new OpenFileDialog(); + of.Title = "Select package to open."; + of.Filter += "All Files (*.*)|*.*|" + PackageReader.SupportedFormats; + if (of.ShowDialog() == DialogResult.OK) + { + LoadFile(Util.LocalFile(of.FileName)); + } + } + + private void detailsToolStripMenuItem_Click(object sender, EventArgs e) + { + if (!detailsToolStripMenuItem.Checked) + { + detailsToolStripMenuItem.Checked = true; + iconsToolStripMenuItem.Checked = false; + listToolStripMenuItem.Checked = false; + SetView(View.Details); + } + } + + private void iconsToolStripMenuItem_Click(object sender, EventArgs e) + { + if (!iconsToolStripMenuItem.Checked) + { + detailsToolStripMenuItem.Checked = false; + iconsToolStripMenuItem.Checked = true; + listToolStripMenuItem.Checked = false; + SetView(View.LargeIcon); + } + } + + private void listToolStripMenuItem_Click(object sender, EventArgs e) + { + if (!listToolStripMenuItem.Checked) + { + detailsToolStripMenuItem.Checked = false; + iconsToolStripMenuItem.Checked = false; + listToolStripMenuItem.Checked = true; + SetView(View.List); + } + } + + private View view = View.Details; + private void SetView(View v) + { + view = v; + foreach(TabPage t in packagesTabControl.TabPages) + { + if(t.Controls.Count > 0) + (t.Controls[0] as PackageView)?.SetView(v); + } + } + + private void exitToolStripMenuItem_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void closeToolStripMenuItem_Click(object sender, EventArgs e) + { + (packagesTabControl.SelectedTab?.Controls[0] as PackageView)?.Unload(); + } + + private void tabControl1_Click(object sender, MouseEventArgs e) + { + var ctrl = sender as TabControl; + if (e.Button == MouseButtons.Middle) + { + (ctrl.TabPages.Cast() + .Where((t, i) => ctrl.GetTabRect(i).Contains(e.Location)) + .First().Controls[0] as PackageView).Unload(); + } + } + + private void gitHubToolStripMenuItem_Click(object sender, EventArgs e) + { + System.Diagnostics.Process.Start("https://github.com/maxton/GameArchives"); + } + + private void packagesTabControl_DragDrop(object sender, DragEventArgs e) + { + var files = e.Data.GetData(DataFormats.FileDrop) as string[]; + foreach(string file in files) + { + LoadFile(Util.LocalFile(file)); + } + } + + private void packagesTabControl_DragEnter(object sender, DragEventArgs e) + { + if (e.Data.GetDataPresent(DataFormats.FileDrop)) + e.Effect = DragDropEffects.Copy; + } + } +} diff --git a/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.csproj b/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.csproj new file mode 100644 index 0000000..d591f90 --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.csproj @@ -0,0 +1,28 @@ + + + net6.0 + WinExe + false + true + true + + + + + + + + + + + + + + + + + all + + + + \ No newline at end of file diff --git a/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.licenseheader b/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.licenseheader new file mode 100644 index 0000000..058d400 --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.licenseheader @@ -0,0 +1,21 @@ +extensions: designer.cs generated.cs +extensions: .cs .cpp .h +/* + * %FileName% + * + * Copyright (c) 2015,%CurrentYear%, maxton. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; If not, see + * . + */ \ No newline at end of file diff --git a/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.resx b/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.resx new file mode 100644 index 0000000..f1d13d7 --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/ArchiveExplorer.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 132, 17 + + \ No newline at end of file diff --git a/Dependencies/GameArchives/ArchiveExplorer/Images/File_large.png b/Dependencies/GameArchives/ArchiveExplorer/Images/File_large.png new file mode 100644 index 0000000000000000000000000000000000000000..461868412d9deb28f272c32d8988eac426cc4a2d GIT binary patch literal 1000 zcmV>P)=2=Xn^&oA}&pVrpt?ve9U~G)=PtfD#KJ zfDj-O_hk$)bOXAsBWq^iI1U(NxHU5~zPPyfJfF{x^(g=XktldNN-Pn&K^VqSKV-96 zq%s-I&&}0VR#w(5%NkEO0J*Fm0{{CvheT(L!M1IbN+o1W6ZLw1?9uY_i$bAL73~L2 zUPa`=pQCU90LO7)+cr|E6za3Hm8GSnHOsPUN@O%{=FhWqDvh@r8?bB}p67vc4##nD zb9%bcY&M^*uCCs89A`&K1!VYsnlfklaE{vKB!-8tAeYNwuuwpuSj5oK5HwxKgN21! zwOYLkAg!nZDzbk3&~;su%O#Y{r5>;SRtr`>kI~W5iS_mMs{lSG7yt=WiF&HZ7=zR4 zoOsRv@Pp<)=#h5V-eB}I>!iv?A} z=oe+=e2zYFg)%C?7eo(`dbe>k0f_7cBn)1lGNA!zQK-`=@M;Dc89Io93gCN$s;1yk~TpW1m9uNW6Pw+8hlwyJE`o#k- zP9ZvL#ziT?|O5D}1sh+wg}!R~v9wr%mg-C|S$jw(omb)l@4Yz_pe&?YxBY-gAL<>&pIsk&VGrkV{GxXe8qzPZ!6KjC*fq8tOX-iX5+x>WovI z=a@86!m32DOi720^CRyUkfAO}QRk_p>5v3;N+}h~!$n;R9U?{VH{?f_i z(YnubzVkf)SO0xZ@%yuTZMR1C=53RR&Es0YAh`B=se|B2rfl5{QEZ44-__Lf*d;0G^d)XLN z+|(pI^xT9h>bKmylHX&Q!5}bEWQ50CX+IscSfJon};>$h3uWz z0!WDQ`zf`05~P%`?y+$exgw)yd9 zS?z67A#V~7v%4Q-`w(>ch;W>Hr@WV*fPal`=&xflgd*f+l!BgoKD(D&C%Nb5k9*9Y z5BQ09+~+)Mo^s&TJ5jrT9AQ>I6_O`zKbp<-!g2w_f1U@jTg#jD6cgT@07f8#r>mdK II;Vst06xUj6#xJL literal 0 HcmV?d00001 diff --git a/Dependencies/GameArchives/ArchiveExplorer/Images/Folder_small.png b/Dependencies/GameArchives/ArchiveExplorer/Images/Folder_small.png new file mode 100644 index 0000000000000000000000000000000000000000..bbcff1e95d12925804ec76233dfd4bceca6eb355 GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNBO8N>-qLi-GN4eAr;B5V#p&cf|Nq-Ft2VICe(?SM zeO3txiFd{Z1{@Po8JL-!4{jHq&SH1xMoakSDbBn{8s6XEpZw$T=VoUfnMJ#JY_#Gc zO!r&f>wMLe&K_kT^7rq@#)rpWpRR~Kc*H?b!Zaa5;=qsp|LfOiPE=uLyTZ*N6sxgV U=Jwl%K-(ESUHx3vIVCg!09pZ1MF0Q* literal 0 HcmV?d00001 diff --git a/Dependencies/GameArchives/ArchiveExplorer/Images/spinner.gif b/Dependencies/GameArchives/ArchiveExplorer/Images/spinner.gif new file mode 100644 index 0000000000000000000000000000000000000000..ad6360758db34b5f58c4e811231342e3dbb93b24 GIT binary patch literal 2128 zcmZ?wbhEHb6krfw_{6~Q;ll?828Qk1x7*p-0U0qdF;!Jnot>SE|GE8KLxPwc6cV!%D{}G^Q}iD8JzOW7Eb1{;*gxf?l&Wi({-capg^mIwj6nT_E#;>&)i8GRIbEGey1? z|HIgPnBQn+iq!o5EZB?!`YlOS`;<}J#5Z%o;#<3yakeV*uo$|uC&~z}a%v@XE2Z_%?cMLnl&b5Dh@S!Bq=#w}8u zxO;=?_oZ6f7nv-dqlL2ox$zA{e literal 0 HcmV?d00001 diff --git a/Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.Designer.cs b/Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.Designer.cs new file mode 100644 index 0000000..13e091a --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.Designer.cs @@ -0,0 +1,99 @@ +namespace ArchiveExplorer +{ + partial class KeyRequestForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.passcodeTextBox = new System.Windows.Forms.TextBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // button1 + // + this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; + this.button1.Location = new System.Drawing.Point(148, 83); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 0; + this.button1.Text = "OK"; + this.button1.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(150, 13); + this.label1.TabIndex = 1; + this.label1.Text = "A passcode or key is needed: "; + // + // passcodeTextBox + // + this.passcodeTextBox.Location = new System.Drawing.Point(15, 26); + this.passcodeTextBox.Name = "passcodeTextBox"; + this.passcodeTextBox.Size = new System.Drawing.Size(344, 20); + this.passcodeTextBox.TabIndex = 2; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(15, 52); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(107, 17); + this.checkBox1.TabIndex = 3; + this.checkBox1.Text = "Decode from hex"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // KeyRequestForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(371, 118); + this.ControlBox = false; + this.Controls.Add(this.checkBox1); + this.Controls.Add(this.passcodeTextBox); + this.Controls.Add(this.label1); + this.Controls.Add(this.button1); + this.Name = "KeyRequestForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.Text = "Decryption Key"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox passcodeTextBox; + private System.Windows.Forms.CheckBox checkBox1; + } +} \ No newline at end of file diff --git a/Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.cs b/Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.cs new file mode 100644 index 0000000..7f9d594 --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ArchiveExplorer +{ + public partial class KeyRequestForm : Form + { + public string Passcode + { + get + { + if (checkBox1.Checked) + { + StringBuilder sb = new StringBuilder(); + var key = passcodeTextBox.Text.Replace(" ", ""); + for (var x = 0; x < key.Length; x += 2) + { + sb.Append((char)Convert.ToByte(key.Substring(x, 2), 16)); + } + return sb.ToString(); + } + return passcodeTextBox.Text; + } + } + public KeyRequestForm(string request = "") + { + InitializeComponent(); + label1.Text += request; + } + } +} diff --git a/Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.resx b/Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/KeyRequestForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Dependencies/GameArchives/ArchiveExplorer/Program.cs b/Dependencies/GameArchives/ArchiveExplorer/Program.cs new file mode 100644 index 0000000..f716994 --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/Program.cs @@ -0,0 +1,42 @@ +/* + * Program.cs + * + * Copyright (c) 2015,2016, maxton. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; If not, see + * . + */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ArchiveExplorer +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetHighDpiMode(HighDpiMode.SystemAware); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new ArchiveExplorer()); + } + } +} diff --git a/Dependencies/GameArchives/ArchiveExplorer/Properties/AssemblyInfo.cs b/Dependencies/GameArchives/ArchiveExplorer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ab628b2 --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ArchiveExplorer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ArchiveExplorer")] +[assembly: AssemblyCopyright("Copyright © maxton 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("eac2e703-6d41-4e69-b14d-d881a3c9909c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.12.0.*")] +[assembly: AssemblyFileVersion("0.12.0.0")] diff --git a/Dependencies/GameArchives/ArchiveExplorer/Properties/Resources.Designer.cs b/Dependencies/GameArchives/ArchiveExplorer/Properties/Resources.Designer.cs new file mode 100644 index 0000000..386068a --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ArchiveExplorer.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ArchiveExplorer.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap spinner { + get { + object obj = ResourceManager.GetObject("spinner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Dependencies/GameArchives/ArchiveExplorer/Properties/Resources.resx b/Dependencies/GameArchives/ArchiveExplorer/Properties/Resources.resx new file mode 100644 index 0000000..a742263 --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Images\spinner.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Dependencies/GameArchives/ArchiveExplorer/Properties/Settings.Designer.cs b/Dependencies/GameArchives/ArchiveExplorer/Properties/Settings.Designer.cs new file mode 100644 index 0000000..0ffdf86 --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ArchiveExplorer.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Dependencies/GameArchives/ArchiveExplorer/Properties/Settings.settings b/Dependencies/GameArchives/ArchiveExplorer/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Dependencies/GameArchives/ArchiveExplorer/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Dependencies/GameArchives/GameArchives.sln b/Dependencies/GameArchives/GameArchives.sln new file mode 100644 index 0000000..f295a8b --- /dev/null +++ b/Dependencies/GameArchives/GameArchives.sln @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2000 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameArchives", "Library\GameArchives.csproj", "{906748F0-3A55-4B20-BCCB-9DC7187F1D5E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArchiveExplorer", "ArchiveExplorer\ArchiveExplorer.csproj", "{EAC2E703-6D41-4E69-B14D-D881A3C9909C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibArchiveExplorer", "LibArchiveExplorer\LibArchiveExplorer.csproj", "{29722AA8-E9FC-4B5B-9C73-31A6293DBA55}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + Release-minimal|Any CPU = Release-minimal|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {906748F0-3A55-4B20-BCCB-9DC7187F1D5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {906748F0-3A55-4B20-BCCB-9DC7187F1D5E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {906748F0-3A55-4B20-BCCB-9DC7187F1D5E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {906748F0-3A55-4B20-BCCB-9DC7187F1D5E}.Release|Any CPU.Build.0 = Release|Any CPU + {906748F0-3A55-4B20-BCCB-9DC7187F1D5E}.Release-minimal|Any CPU.ActiveCfg = Release-minimal|Any CPU + {906748F0-3A55-4B20-BCCB-9DC7187F1D5E}.Release-minimal|Any CPU.Build.0 = Release-minimal|Any CPU + {EAC2E703-6D41-4E69-B14D-D881A3C9909C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EAC2E703-6D41-4E69-B14D-D881A3C9909C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EAC2E703-6D41-4E69-B14D-D881A3C9909C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EAC2E703-6D41-4E69-B14D-D881A3C9909C}.Release|Any CPU.Build.0 = Release|Any CPU + {EAC2E703-6D41-4E69-B14D-D881A3C9909C}.Release-minimal|Any CPU.ActiveCfg = Release|Any CPU + {EAC2E703-6D41-4E69-B14D-D881A3C9909C}.Release-minimal|Any CPU.Build.0 = Release|Any CPU + {29722AA8-E9FC-4B5B-9C73-31A6293DBA55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29722AA8-E9FC-4B5B-9C73-31A6293DBA55}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29722AA8-E9FC-4B5B-9C73-31A6293DBA55}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29722AA8-E9FC-4B5B-9C73-31A6293DBA55}.Release|Any CPU.Build.0 = Release|Any CPU + {29722AA8-E9FC-4B5B-9C73-31A6293DBA55}.Release-minimal|Any CPU.ActiveCfg = Release|Any CPU + {29722AA8-E9FC-4B5B-9C73-31A6293DBA55}.Release-minimal|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DEF13207-4D07-42E5-8F0E-69817D41B933} + EndGlobalSection +EndGlobal diff --git a/Dependencies/GameArchives/GameArchivesTests/GameArchivesTests.csproj b/Dependencies/GameArchives/GameArchivesTests/GameArchivesTests.csproj new file mode 100644 index 0000000..265f677 --- /dev/null +++ b/Dependencies/GameArchives/GameArchivesTests/GameArchivesTests.csproj @@ -0,0 +1,46 @@ + + + net6.0 + Library + false + + + + + + + + + + + + + + + + + + + + + False + + + False + + + False + + + False + + + + + + + all + + + + \ No newline at end of file diff --git a/Dependencies/GameArchives/GameArchivesTests/Local/LocalDirectoryTests.cs b/Dependencies/GameArchives/GameArchivesTests/Local/LocalDirectoryTests.cs new file mode 100644 index 0000000..0969b18 --- /dev/null +++ b/Dependencies/GameArchives/GameArchivesTests/Local/LocalDirectoryTests.cs @@ -0,0 +1,19 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using GameArchives.Local; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GameArchives.Local.Tests +{ + [TestClass()] + public class LocalDirectoryTests + { + [TestMethod()] + public void GetDirectoryTest() + { + } + } +} \ No newline at end of file diff --git a/Dependencies/GameArchives/GameArchivesTests/Properties/AssemblyInfo.cs b/Dependencies/GameArchives/GameArchivesTests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7953a35 --- /dev/null +++ b/Dependencies/GameArchives/GameArchivesTests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("GameArchivesTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("GameArchivesTests")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4312aa1c-904e-4fcd-860a-aa888d5be0ce")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Dependencies/GameArchives/LICENSE b/Dependencies/GameArchives/LICENSE new file mode 100644 index 0000000..341c30b --- /dev/null +++ b/Dependencies/GameArchives/LICENSE @@ -0,0 +1,166 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + diff --git a/Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.Designer.cs b/Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.Designer.cs new file mode 100644 index 0000000..c30cc94 --- /dev/null +++ b/Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.Designer.cs @@ -0,0 +1,242 @@ +namespace LibArchiveExplorer +{ + partial class EditorWindow + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.discUsageGraphic = new System.Windows.Forms.PictureBox(); + this.label1 = new System.Windows.Forms.Label(); + this.discUsageBar = new System.Windows.Forms.ProgressBar(); + this.listView1 = new System.Windows.Forms.ListView(); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.label2 = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.lblTotalFileSize = new System.Windows.Forms.Label(); + this.lblTotalFiles = new System.Windows.Forms.Label(); + this.lblPackageSize = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.actionsGroupBox = new System.Windows.Forms.GroupBox(); + this.button1 = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.discUsageGraphic)).BeginInit(); + this.groupBox1.SuspendLayout(); + this.actionsGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // discUsageGraphic + // + this.discUsageGraphic.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.discUsageGraphic.BackColor = System.Drawing.Color.White; + this.discUsageGraphic.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.discUsageGraphic.Location = new System.Drawing.Point(12, 25); + this.discUsageGraphic.Name = "discUsageGraphic"; + this.discUsageGraphic.Size = new System.Drawing.Size(560, 64); + this.discUsageGraphic.TabIndex = 0; + this.discUsageGraphic.TabStop = false; + this.discUsageGraphic.Paint += new System.Windows.Forms.PaintEventHandler(this.DrawGraphic); + this.discUsageGraphic.MouseDown += new System.Windows.Forms.MouseEventHandler(this.discUsageGraphic_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(65, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Disc Usage:"; + // + // discUsageBar + // + this.discUsageBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.discUsageBar.Enabled = false; + this.discUsageBar.Location = new System.Drawing.Point(12, 95); + this.discUsageBar.Name = "discUsageBar"; + this.discUsageBar.Size = new System.Drawing.Size(560, 23); + this.discUsageBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous; + this.discUsageBar.TabIndex = 2; + // + // listView1 + // + this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1}); + this.listView1.HideSelection = false; + this.listView1.Location = new System.Drawing.Point(12, 124); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(394, 225); + this.listView1.TabIndex = 3; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); + // + // columnHeader1 + // + this.columnHeader1.Text = "Name"; + this.columnHeader1.Width = 345; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(17, 30); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(74, 13); + this.label2.TabIndex = 4; + this.label2.Text = "Package size:"; + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.lblTotalFileSize); + this.groupBox1.Controls.Add(this.lblTotalFiles); + this.groupBox1.Controls.Add(this.lblPackageSize); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Location = new System.Drawing.Point(413, 249); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(160, 99); + this.groupBox1.TabIndex = 5; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Package Info"; + // + // lblTotalFileSize + // + this.lblTotalFileSize.AutoSize = true; + this.lblTotalFileSize.Location = new System.Drawing.Point(97, 64); + this.lblTotalFileSize.Name = "lblTotalFileSize"; + this.lblTotalFileSize.Size = new System.Drawing.Size(23, 13); + this.lblTotalFileSize.TabIndex = 9; + this.lblTotalFileSize.Text = "0 B"; + // + // lblTotalFiles + // + this.lblTotalFiles.AutoSize = true; + this.lblTotalFiles.Location = new System.Drawing.Point(97, 47); + this.lblTotalFiles.Name = "lblTotalFiles"; + this.lblTotalFiles.Size = new System.Drawing.Size(13, 13); + this.lblTotalFiles.TabIndex = 8; + this.lblTotalFiles.Text = "0"; + // + // lblPackageSize + // + this.lblPackageSize.AutoSize = true; + this.lblPackageSize.Location = new System.Drawing.Point(97, 30); + this.lblPackageSize.Name = "lblPackageSize"; + this.lblPackageSize.Size = new System.Drawing.Size(23, 13); + this.lblPackageSize.TabIndex = 7; + this.lblPackageSize.Text = "0 B"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(20, 64); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(71, 13); + this.label4.TabIndex = 6; + this.label4.Text = "Total file size:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(36, 47); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(55, 13); + this.label3.TabIndex = 5; + this.label3.Text = "Total files:"; + // + // actionsGroupBox + // + this.actionsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.actionsGroupBox.Controls.Add(this.button1); + this.actionsGroupBox.Enabled = false; + this.actionsGroupBox.Location = new System.Drawing.Point(413, 124); + this.actionsGroupBox.Name = "actionsGroupBox"; + this.actionsGroupBox.Size = new System.Drawing.Size(159, 119); + this.actionsGroupBox.TabIndex = 6; + this.actionsGroupBox.TabStop = false; + this.actionsGroupBox.Text = "Actions"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(6, 19); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(147, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Replace File"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // EditorWindow + // + this.AllowDrop = true; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(584, 361); + this.Controls.Add(this.actionsGroupBox); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.listView1); + this.Controls.Add(this.discUsageBar); + this.Controls.Add(this.label1); + this.Controls.Add(this.discUsageGraphic); + this.MinimumSize = new System.Drawing.Size(600, 400); + this.Name = "EditorWindow"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Package Editor"; + ((System.ComponentModel.ISupportInitialize)(this.discUsageGraphic)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.actionsGroupBox.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox discUsageGraphic; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ProgressBar discUsageBar; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Label lblTotalFileSize; + private System.Windows.Forms.Label lblTotalFiles; + private System.Windows.Forms.Label lblPackageSize; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.GroupBox actionsGroupBox; + } +} + diff --git a/Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.cs b/Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.cs new file mode 100644 index 0000000..c8e8ed3 --- /dev/null +++ b/Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.cs @@ -0,0 +1,177 @@ +using GameArchives; +using GameArchives.Common; +using GameArchives.XISO; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace LibArchiveExplorer +{ + public partial class EditorWindow : Form + { + private AbstractPackage _pkg; + private List _allFiles; + + public EditorWindow(AbstractPackage pkg) + { + InitializeComponent(); + _pkg = pkg; + Resize += (o,e) => discUsageGraphic.Invalidate(); + LoadPackage(); + } + + /// + /// Draws a graphic that looks like the old Disk Defragmenter disk usage image. + /// + /// + /// + private void DrawGraphic(object sender, PaintEventArgs evt) + { + evt.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed; + foreach (var file in _allFiles ?? new List()) + { + var rect = new RectangleF + { + X = file.DataLocation * discUsageGraphic.Width / (float)_pkg.Size, + Y = 0, + Height = discUsageGraphic.Height, + Width = file.Size * discUsageGraphic.Width / (float)_pkg.Size + }; + evt.Graphics.FillRectangle(Brushes.Gray, rect); + } + evt.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + foreach (ListViewItem f in listView1.SelectedItems) + { + var file = f.Tag as OffsetFile; + var rect = new RectangleF + { + X = file.DataLocation * discUsageGraphic.Width / (float)_pkg.Size, + Y = -1, + Height = discUsageGraphic.Height + 2, + Width = Math.Max(file.Size * discUsageGraphic.Width / (float)_pkg.Size, 1) + }; + evt.Graphics.FillRectangle(Brushes.Black, rect); + } + } + + /// + /// Load the package. + /// + private void LoadPackage() + { + if (_pkg.FileType.IsSubclassOrEqual(typeof(OffsetFile))) + { + discUsageGraphic.Invalidate(); + _allFiles = _pkg.GetAllFiles(); + var totalSize = _allFiles.Sum((f) => f.Size); + discUsageBar.Value = ((int)(100 * totalSize / _pkg.Size)).Clamp(discUsageBar.Minimum, discUsageBar.Maximum); + _allFiles.Sort((f, f2) => Math.Sign(f.DataLocation - f2.DataLocation)); + _allFiles.ForEach(f => + listView1.Items.Add(new ListViewItem(new string[] { f.Name }) + { + Tag = f + })); + + lblPackageSize.Text = _pkg.Size.HumanReadableFileSize(); + lblTotalFiles.Text = _allFiles.Count.ToString(); + lblTotalFileSize.Text = totalSize.HumanReadableFileSize(); + actionsGroupBox.Enabled = _pkg.Writeable; + } + else + { + throw new NotImplementedException("Editor support is not implemented for this package type"); + } + } + + private void SelectFileAtByte(long b) + { + foreach(ListViewItem item in listView1.SelectedItems) + { + item.Selected = false; + item.Focused = false; + } + foreach(ListViewItem item in listView1.Items) + { + var file = item.Tag as OffsetFile; + if(file.DataLocation <= b && file.DataLocation + file.Size >= b) + { + listView1.FocusedItem = item; + item.Selected = true; + item.Focused = true; + item.EnsureVisible(); + break; + } + } + } + + /// + /// Closes the currently opened package. + /// + private void ClosePackage() + { + _pkg = null; + listView1.Items.Clear(); + _allFiles?.Clear(); + discUsageGraphic.Invalidate(); + discUsageBar.Value = 0; + } + + + private void toolStripMenuItem1_Click(object sender, EventArgs e) + { + Close(); + } + + private void listView1_SelectedIndexChanged(object sender, EventArgs e) + { + discUsageGraphic.Invalidate(); + } + + private void discUsageGraphic_Click(object sender, MouseEventArgs e) + { + SelectFileAtByte((e as MouseEventArgs).X * _pkg.Size / discUsageGraphic.Width); + } + + private void button1_Click(object sender, EventArgs e) + { + if(listView1.SelectedItems.Count != 1) + { + MessageBox.Show(this, "Please select only one item."); + return; + } + var file = listView1.SelectedItems[0].Tag as OffsetFile; + var x = new OpenFileDialog(); + if(x.ShowDialog() == DialogResult.OK) + { + var newFile = Util.LocalFile(x.FileName); + if(MessageBox.Show("This will PERMANENTLY modify the archive." + +Environment.NewLine+"Are you sure you want to continue?","Confirm Action", MessageBoxButtons.YesNo) + == DialogResult.Yes) + { + try + { + if((_pkg as MutablePackage)?.FileReplaceCheck(file, newFile) == true + && (_pkg as MutablePackage)?.TryReplaceFile(file, newFile) == true) + { + MessageBox.Show("Successfully replaced."); + } + else + { + throw new Exception("Failed"); + } + } + catch(Exception ex) + { + MessageBox.Show(ex.Message); + } + } + } + } + } +} diff --git a/Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.resx b/Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Dependencies/GameArchives/LibArchiveExplorer/EditorWindow.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Dependencies/GameArchives/LibArchiveExplorer/Extensions.cs b/Dependencies/GameArchives/LibArchiveExplorer/Extensions.cs new file mode 100644 index 0000000..30adc90 --- /dev/null +++ b/Dependencies/GameArchives/LibArchiveExplorer/Extensions.cs @@ -0,0 +1,46 @@ +using GameArchives; +using System; +using System.Collections.Generic; + +namespace LibArchiveExplorer +{ + static class Extensions + { + public static string HumanReadableFileSize(this long size) + { + if (size > (1024 * 1024 * 1024)) + { + return (size / (double)(1024 * 1024 * 1024)).ToString("F") + " GiB"; + } + else if (size > (1024 * 1024)) + { + return (size / (double)(1024 * 1024)).ToString("F") + " MiB"; + } + else if (size > 1024) + { + return (size / 1024.0).ToString("F") + " KiB"; + } + else + { + return size.ToString() + " B"; + } + } + + public static bool IsSubclassOrEqual(this Type type, Type other) + { + return type.IsSubclassOf(other) || type == other; + } + + public static int Clamp(this int value, int min, int max) + { + if (value < min) return min; + if (value > max) return max; + return value; + } + + public static Tuple GetLargestFreeBlock(this AbstractPackage pkg) + { + return new Tuple(0, 0); + } + } +} diff --git a/Dependencies/GameArchives/LibArchiveExplorer/FolderSelectDialog.cs b/Dependencies/GameArchives/LibArchiveExplorer/FolderSelectDialog.cs new file mode 100644 index 0000000..20a8234 --- /dev/null +++ b/Dependencies/GameArchives/LibArchiveExplorer/FolderSelectDialog.cs @@ -0,0 +1,154 @@ +using System; +using System.Windows.Forms; + +// ------------------------------------------------------------------ +// Wraps System.Windows.Forms.OpenFileDialog to make it present +// a vista-style dialog. +// ------------------------------------------------------------------ + +namespace FolderSelect +{ + /// + /// Wraps System.Windows.Forms.OpenFileDialog to make it present + /// a vista-style dialog. + /// + public class FolderSelectDialog + { + // Wrapped dialog + System.Windows.Forms.OpenFileDialog ofd = null; + + /// + /// Default constructor + /// + public FolderSelectDialog() + { + ofd = new System.Windows.Forms.OpenFileDialog(); + + ofd.Filter = "Folders|\n"; + ofd.AddExtension = false; + ofd.CheckFileExists = false; + ofd.DereferenceLinks = true; + ofd.Multiselect = false; + } + + #region Properties + + /// + /// Gets/Sets the initial folder to be selected. A null value selects the current directory. + /// + public string InitialDirectory + { + get { return ofd.InitialDirectory; } + set { ofd.InitialDirectory = value == null || value.Length == 0 ? Environment.CurrentDirectory : value; } + } + + /// + /// Gets/Sets the title to show in the dialog + /// + public string Title + { + get { return ofd.Title; } + set { ofd.Title = value == null ? "Select a folder" : value; } + } + + /// + /// Gets the selected folder + /// + public string FileName + { + get { return ofd.FileName; } + } + + #endregion + + #region Methods + + /// + /// Shows the dialog + /// + /// True if the user presses OK else false + public bool ShowDialog() + { + return ShowDialog(IntPtr.Zero); + } + + /// + /// Shows the dialog + /// + /// Handle of the control to be parent + /// True if the user presses OK else false + public bool ShowDialog(IntPtr hWndOwner) + { + bool flag = false; + + if (Environment.OSVersion.Version.Major >= 6) + { + var r = new Reflector("System.Windows.Forms"); + + uint num = 0; + Type typeIFileDialog = r.GetType("FileDialogNative.IFileDialog"); + object dialog = r.Call(ofd, "CreateVistaDialog"); + r.Call(ofd, "OnBeforeVistaDialog", dialog); + + uint options = (uint)r.CallAs(typeof(System.Windows.Forms.FileDialog), ofd, "GetOptions"); + options |= (uint)r.GetEnum("FileDialogNative.FOS", "FOS_PICKFOLDERS"); + r.CallAs(typeIFileDialog, dialog, "SetOptions", options); + + object pfde = r.New("FileDialog.VistaDialogEvents", ofd); + object[] parameters = new object[] { pfde, num }; + r.CallAs2(typeIFileDialog, dialog, "Advise", parameters); + num = (uint)parameters[1]; + try + { + int num2 = (int)r.CallAs(typeIFileDialog, dialog, "Show", hWndOwner); + flag = 0 == num2; + } + finally + { + r.CallAs(typeIFileDialog, dialog, "Unadvise", num); + GC.KeepAlive(pfde); + } + } + else + { + var fbd = new FolderBrowserDialog(); + fbd.Description = this.Title; + fbd.SelectedPath = this.InitialDirectory; + fbd.ShowNewFolderButton = false; + if (fbd.ShowDialog(new WindowWrapper(hWndOwner)) != DialogResult.OK) return false; + ofd.FileName = fbd.SelectedPath; + flag = true; + } + + return flag; + } + + #endregion + } + + /// + /// Creates IWin32Window around an IntPtr + /// + public class WindowWrapper : System.Windows.Forms.IWin32Window + { + /// + /// Constructor + /// + /// Handle to wrap + public WindowWrapper(IntPtr handle) + { + _hwnd = handle; + } + + /// + /// Original ptr + /// + public IntPtr Handle + { + get { return _hwnd; } + } + + private IntPtr _hwnd; + } + +} diff --git a/Dependencies/GameArchives/LibArchiveExplorer/LibArchiveExplorer.csproj b/Dependencies/GameArchives/LibArchiveExplorer/LibArchiveExplorer.csproj new file mode 100644 index 0000000..53311a6 --- /dev/null +++ b/Dependencies/GameArchives/LibArchiveExplorer/LibArchiveExplorer.csproj @@ -0,0 +1,25 @@ + + + net6.0 + Library + false + true + true + + + + UserControl + + + + + + + + + + all + + + + \ No newline at end of file diff --git a/Dependencies/GameArchives/LibArchiveExplorer/PackageManager.cs b/Dependencies/GameArchives/LibArchiveExplorer/PackageManager.cs new file mode 100644 index 0000000..49d1805 --- /dev/null +++ b/Dependencies/GameArchives/LibArchiveExplorer/PackageManager.cs @@ -0,0 +1,70 @@ +using GameArchives; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace LibArchiveExplorer +{ + public class PackageManager + { + private static PackageManager _pm; + public static PackageManager GetInstance() + { + if(_pm == null) + { + return (_pm = new PackageManager()); + } + return _pm; + } + + public bool Ready { get; private set; } + + public Func> Loader { get; set; } + + private System.Windows.Forms.ToolStripStatusLabel statusLabel; + private System.Windows.Forms.ToolStripStatusLabel spinner; + private PackageManager() + { + Ready = true; + } + + public System.Windows.Forms.ToolStripStatusLabel Spinner + { + set { spinner = value; } + } + public System.Windows.Forms.ToolStripStatusLabel StatusLabel + { + set { statusLabel = value; } + } + + public void SetReady() + { + Ready = true; + if(spinner != null) + spinner.Visible = false; + if (statusLabel != null) + statusLabel.Text = "Ready."; + } + + public void SetBusyState(string busyState) + { + Ready = false; + if (spinner != null) + spinner.Visible = true; + if (statusLabel != null) + statusLabel.Text = busyState; + } + + public async void LoadFile(IFile f, PackageView owner = null) + { + if(Loader == null) return; + var pkgView = await Loader(f); + if(owner != null && pkgView != null) + { + owner.AddChildPackage(pkgView); + } + } + } +} diff --git a/Dependencies/GameArchives/LibArchiveExplorer/PackageView.Designer.cs b/Dependencies/GameArchives/LibArchiveExplorer/PackageView.Designer.cs new file mode 100644 index 0000000..05277fe --- /dev/null +++ b/Dependencies/GameArchives/LibArchiveExplorer/PackageView.Designer.cs @@ -0,0 +1,279 @@ +namespace LibArchiveExplorer +{ + partial class PackageView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackageView)); + this.label1 = new System.Windows.Forms.Label(); + this.fileViewContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.extractSelectedItems = new System.Windows.Forms.ToolStripMenuItem(); + this.openSelectedArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.largeImageList = new System.Windows.Forms.ImageList(this.components); + this.smallImageList = new System.Windows.Forms.ImageList(this.components); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.fileView = new System.Windows.Forms.ListView(); + this.nameColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.typeColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.sizeColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.fileInspectorTabControl = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.filePropertyGrid = new System.Windows.Forms.PropertyGrid(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.openEditorButton = new System.Windows.Forms.Button(); + this.printExtendedInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.fileViewContextMenu.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.fileInspectorTabControl.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(0, 0); + this.label1.Margin = new System.Windows.Forms.Padding(0); + this.label1.Name = "label1"; + this.label1.Padding = new System.Windows.Forms.Padding(0, 4, 0, 4); + this.label1.Size = new System.Drawing.Size(29, 21); + this.label1.TabIndex = 5; + this.label1.Text = "Path"; + // + // fileViewContextMenu + // + this.fileViewContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.extractSelectedItems, + this.openSelectedArchiveToolStripMenuItem, + this.printExtendedInfoToolStripMenuItem}); + this.fileViewContextMenu.Name = "fileViewContextMenu"; + this.fileViewContextMenu.Size = new System.Drawing.Size(197, 92); + // + // extractSelectedItems + // + this.extractSelectedItems.Name = "extractSelectedItems"; + this.extractSelectedItems.Size = new System.Drawing.Size(196, 22); + this.extractSelectedItems.Text = "Extract selected items..."; + this.extractSelectedItems.Click += new System.EventHandler(this.extractItemsToolStripMenuItem_Click); + // + // openSelectedArchiveToolStripMenuItem + // + this.openSelectedArchiveToolStripMenuItem.Name = "openSelectedArchiveToolStripMenuItem"; + this.openSelectedArchiveToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + this.openSelectedArchiveToolStripMenuItem.Text = "Open selected archive"; + this.openSelectedArchiveToolStripMenuItem.Click += new System.EventHandler(this.openSelectedArchiveToolStripMenuItem_Click); + // + // largeImageList + // + this.largeImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("largeImageList.ImageStream"))); + this.largeImageList.TransparentColor = System.Drawing.Color.Transparent; + this.largeImageList.Images.SetKeyName(0, "Folder_large.png"); + this.largeImageList.Images.SetKeyName(1, "File_large.png"); + // + // smallImageList + // + this.smallImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("smallImageList.ImageStream"))); + this.smallImageList.TransparentColor = System.Drawing.Color.Transparent; + this.smallImageList.Images.SetKeyName(0, "Folder_small.png"); + this.smallImageList.Images.SetKeyName(1, "File_small.png"); + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.flowLayoutPanel1.Location = new System.Drawing.Point(29, 0); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(643, 26); + this.flowLayoutPanel1.TabIndex = 6; + // + // fileView + // + this.fileView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.nameColumn, + this.typeColumn, + this.sizeColumn}); + this.fileView.ContextMenuStrip = this.fileViewContextMenu; + this.fileView.Dock = System.Windows.Forms.DockStyle.Fill; + this.fileView.FullRowSelect = true; + this.fileView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.fileView.HideSelection = false; + this.fileView.LargeImageList = this.largeImageList; + this.fileView.Location = new System.Drawing.Point(0, 0); + this.fileView.Name = "fileView"; + this.fileView.Size = new System.Drawing.Size(430, 388); + this.fileView.SmallImageList = this.smallImageList; + this.fileView.TabIndex = 7; + this.fileView.UseCompatibleStateImageBehavior = false; + this.fileView.View = System.Windows.Forms.View.Details; + this.fileView.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.fileView_ItemSelectionChanged); + this.fileView.DoubleClick += new System.EventHandler(this.fileView_DoubleClick); + // + // nameColumn + // + this.nameColumn.Text = "Name"; + this.nameColumn.Width = 270; + // + // typeColumn + // + this.typeColumn.Text = "Type"; + // + // sizeColumn + // + this.sizeColumn.Text = "Size"; + this.sizeColumn.Width = 80; + // + // splitContainer1 + // + this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer1.Location = new System.Drawing.Point(3, 32); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.fileView); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.fileInspectorTabControl); + this.splitContainer1.Size = new System.Drawing.Size(669, 388); + this.splitContainer1.SplitterDistance = 430; + this.splitContainer1.TabIndex = 11; + // + // fileInspectorTabControl + // + this.fileInspectorTabControl.Controls.Add(this.tabPage1); + this.fileInspectorTabControl.Controls.Add(this.tabPage2); + this.fileInspectorTabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.fileInspectorTabControl.Location = new System.Drawing.Point(0, 0); + this.fileInspectorTabControl.Name = "fileInspectorTabControl"; + this.fileInspectorTabControl.SelectedIndex = 0; + this.fileInspectorTabControl.Size = new System.Drawing.Size(235, 388); + this.fileInspectorTabControl.TabIndex = 10; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.filePropertyGrid); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(227, 362); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Properties"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // filePropertyGrid + // + this.filePropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill; + this.filePropertyGrid.HelpVisible = false; + this.filePropertyGrid.Location = new System.Drawing.Point(3, 3); + this.filePropertyGrid.Name = "filePropertyGrid"; + this.filePropertyGrid.Size = new System.Drawing.Size(221, 356); + this.filePropertyGrid.TabIndex = 9; + this.filePropertyGrid.ToolbarVisible = false; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.openEditorButton); + this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(227, 362); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "Tools"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // openEditorButton + // + this.openEditorButton.Location = new System.Drawing.Point(6, 6); + this.openEditorButton.Name = "openEditorButton"; + this.openEditorButton.Size = new System.Drawing.Size(75, 23); + this.openEditorButton.TabIndex = 0; + this.openEditorButton.Text = "Open Editor"; + this.openEditorButton.UseVisualStyleBackColor = true; + this.openEditorButton.Click += new System.EventHandler(this.openEditorButton_Click); + // + // printExtendedInfoToolStripMenuItem + // + this.printExtendedInfoToolStripMenuItem.Name = "printExtendedInfoToolStripMenuItem"; + this.printExtendedInfoToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + this.printExtendedInfoToolStripMenuItem.Text = "Print extended info"; + this.printExtendedInfoToolStripMenuItem.Click += new System.EventHandler(this.printExtendedInfoToolStripMenuItem_Click); + // + // PackageView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer1); + this.Controls.Add(this.label1); + this.Controls.Add(this.flowLayoutPanel1); + this.Margin = new System.Windows.Forms.Padding(0); + this.Name = "PackageView"; + this.Size = new System.Drawing.Size(675, 423); + this.fileViewContextMenu.ResumeLayout(false); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.fileInspectorTabControl.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabPage2.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.ContextMenuStrip fileViewContextMenu; + private System.Windows.Forms.ToolStripMenuItem extractSelectedItems; + private System.Windows.Forms.ImageList largeImageList; + private System.Windows.Forms.ImageList smallImageList; + private System.Windows.Forms.ToolStripMenuItem openSelectedArchiveToolStripMenuItem; + private System.Windows.Forms.ListView fileView; + private System.Windows.Forms.ColumnHeader nameColumn; + private System.Windows.Forms.ColumnHeader typeColumn; + private System.Windows.Forms.ColumnHeader sizeColumn; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.TabControl fileInspectorTabControl; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.PropertyGrid filePropertyGrid; + private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.Button openEditorButton; + private System.Windows.Forms.ToolStripMenuItem printExtendedInfoToolStripMenuItem; + } +} diff --git a/Dependencies/GameArchives/LibArchiveExplorer/PackageView.cs b/Dependencies/GameArchives/LibArchiveExplorer/PackageView.cs new file mode 100644 index 0000000..e7bb6f8 --- /dev/null +++ b/Dependencies/GameArchives/LibArchiveExplorer/PackageView.cs @@ -0,0 +1,308 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.ComponentModel.Design; +using GameArchives; +using System.IO; +using FolderSelect; + +namespace LibArchiveExplorer +{ + [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] + public partial class PackageView : UserControl + { + private IDirectory currentDirectory; + private AbstractPackage currentPackage; + + private List children; + private PackageManager pm; + private PackageView parent = null; + + private EditorWindow ew; + + public delegate void FileOpenEventHandler(IFile file); + public delegate void RemoveTabEventHandler(TabPage t); + + public event FileOpenEventHandler OnFileOpen; + public event RemoveTabEventHandler OnRemoveTab; + + public PackageView(AbstractPackage pkg, PackageManager pm) + { + InitializeComponent(); + InitCustomComponents(); + + this.pm = pm; + children = new List(0); + currentPackage = pkg; + currentDirectory = currentPackage.RootDirectory; + filePropertyGrid.SelectedObject = currentPackage; + ResetBreadcrumbs(); + FillFileView(); + } + + private void InitCustomComponents() + { + this.filePropertyGrid.ToolbarVisible = false; + } + + /// + /// Sets the display mode of the files in the view (e.g., icons, details, list...) + /// + public void SetView(View v) + { + fileView.View = v; + } + + /// + /// Navigates the view to the given directory. + /// + private void SetCurrentDir(IDirectory dir) + { + currentDirectory = dir; + FillFileView(); + ResetBreadcrumbs(); + } + + /// + /// Add a package as a child of this package. + /// This means the given package will be closed if this package is closed. + /// + public void AddChildPackage(PackageView p) + { + this.children.Add(p); + p.SetParentPackage(this); + } + + private void RemoveChildPackage(PackageView p) + { + this.children.Remove(p); + } + + private void SetParentPackage(PackageView p) + { + parent = p; + } + + public void Unload() + { + parent?.RemoveChildPackage(this); + ew?.Close(); + var childrenFixed = children.ToArray(); + foreach(var pkg in childrenFixed) + { + pkg.Unload(); + } + currentPackage?.Dispose(); + currentPackage = null; + currentDirectory = null; + FillFileView(); + ResetBreadcrumbs(); + OnRemoveTab?.Invoke(Tag as TabPage); + } + + private void FillFileView() + { + fileView.Items.Clear(); + if (currentDirectory != null) + { + foreach (var dir in currentDirectory.Dirs) + { + var item = new ListViewItem(new string[] { dir.Name, "Directory" }); + item.Tag = dir; + item.ImageIndex = 0; + fileView.Items.Add(item); + } + foreach (var file in currentDirectory.Files) + { + var item = new ListViewItem(new string[] { file.Name, "File", file.Size.HumanReadableFileSize() }); + item.Tag = file; + item.ImageIndex = 1; + fileView.Items.Add(item); + } + } + } + + private void ResetBreadcrumbs() + { + var dir = currentDirectory; + var i = 1; + var breadcrumbs = new List