diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..4becb00 --- /dev/null +++ b/Program.cs @@ -0,0 +1,25 @@ +using System.IO; + +namespace Warrecs_2_Extractor +{ + class Program + { + static void Main(string[] args) + { + BinaryReader br = new BinaryReader(File.OpenRead(args[0])); + Directory.CreateDirectory(Path.GetDirectoryName(args[0]) + "//" + Path.GetExtension(args[0])); + int i = 0; + while (br.BaseStream.Position < br.BaseStream.Length) + { + using FileStream FS = File.Create(Path.GetDirectoryName(args[0]) + "//" + Path.GetExtension(args[0]) + "//" + i); + BinaryWriter bw = new(FS); + var variable = br.ReadBytes(4); + System.Array.Reverse(variable); + int size = System.BitConverter.ToInt32(variable, 0); + bw.Write(br.ReadBytes(size)); + bw.Close(); + i++; + } + } + } +} diff --git a/Warrecs-2-Extractor.csproj b/Warrecs-2-Extractor.csproj new file mode 100644 index 0000000..fbd2c77 --- /dev/null +++ b/Warrecs-2-Extractor.csproj @@ -0,0 +1,9 @@ + + + + Exe + net5.0 + Warrecs_2_Extractor + + + diff --git a/Warrecs-2-Extractor.sln b/Warrecs-2-Extractor.sln new file mode 100644 index 0000000..3be5c6b --- /dev/null +++ b/Warrecs-2-Extractor.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.34407.143 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Warrecs-2-Extractor", "Warrecs-2-Extractor.csproj", "{EEC2B9CA-70B3-47ED-A2D5-155D38D80D59}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EEC2B9CA-70B3-47ED-A2D5-155D38D80D59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EEC2B9CA-70B3-47ED-A2D5-155D38D80D59}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EEC2B9CA-70B3-47ED-A2D5-155D38D80D59}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EEC2B9CA-70B3-47ED-A2D5-155D38D80D59}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8C84D2DB-0693-4142-9638-DFC35F984374} + EndGlobalSection +EndGlobal