Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayveer committed Mar 9, 2021
0 parents commit d9bebad
Show file tree
Hide file tree
Showing 28 changed files with 1,477 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.vs/
Debug/
Release/
X64/
mgs/3rdparty/zlib/zconf.h
mgs/3rdparty/zlib/zlib.h
mgs/3rdparty/zlib/zlib.lib
31 changes: 31 additions & 0 deletions Arsenal.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Arsenal", "Arsenal.vcxproj", "{8C944FD4-90E3-4FC2-9143-CDA2A21FF96D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8C944FD4-90E3-4FC2-9143-CDA2A21FF96D}.Debug|x64.ActiveCfg = Debug|x64
{8C944FD4-90E3-4FC2-9143-CDA2A21FF96D}.Debug|x64.Build.0 = Debug|x64
{8C944FD4-90E3-4FC2-9143-CDA2A21FF96D}.Debug|x86.ActiveCfg = Debug|Win32
{8C944FD4-90E3-4FC2-9143-CDA2A21FF96D}.Debug|x86.Build.0 = Debug|Win32
{8C944FD4-90E3-4FC2-9143-CDA2A21FF96D}.Release|x64.ActiveCfg = Release|x64
{8C944FD4-90E3-4FC2-9143-CDA2A21FF96D}.Release|x64.Build.0 = Release|x64
{8C944FD4-90E3-4FC2-9143-CDA2A21FF96D}.Release|x86.ActiveCfg = Release|Win32
{8C944FD4-90E3-4FC2-9143-CDA2A21FF96D}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {48227280-F7AF-4A74-A5C7-1CD24EB09673}
EndGlobalSection
EndGlobal
182 changes: 182 additions & 0 deletions Arsenal.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{8c944fd4-90e3-4fc2-9143-cda2a21ff96d}</ProjectGuid>
<RootNamespace>Arsenal</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>"mgs/3rdparty/zlib/zlib.lib";%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>"mgs/3rdparty/zlib/zlib.lib";%(AdditionalDependencies)</AdditionalDependencies>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>"mgs/3rdparty/zlib/zlib.lib";%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>"mgs/3rdparty/zlib/zlib.lib";%(AdditionalDependencies)</AdditionalDependencies>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="dictionary\dictionary.cpp" />
<ClCompile Include="interface\cli\cli.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="mgs\3rdparty\zlib\wrapper\ZlibWrapper.cpp" />
<ClCompile Include="mgs\archive\face\face.cpp" />
<ClCompile Include="mgs\archive\face\stage\stage.cpp" />
<ClCompile Include="mgs\common\decryptor\decryptor.cpp" />
<ClCompile Include="mgs\common\game\game.cpp" />
<ClCompile Include="mgs\config\cnf.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="dictionary\dictionary.h" />
<ClInclude Include="interface\cli\cli.h" />
<ClInclude Include="mgs\3rdparty\zlib\wrapper\ZlibWrapper.h" />
<ClInclude Include="mgs\3rdparty\zlib\zconf.h" />
<ClInclude Include="mgs\3rdparty\zlib\zlib.h" />
<ClInclude Include="mgs\archive\archive.h" />
<ClInclude Include="mgs\archive\face\face.h" />
<ClInclude Include="mgs\archive\face\stage\stage.h" />
<ClInclude Include="mgs\common\decryptor\decryptor.h" />
<ClInclude Include="mgs\common\ext_table.h" />
<ClInclude Include="mgs\common\fileutil.h" />
<ClInclude Include="mgs\common\game\game.h" />
<ClInclude Include="mgs\common\strcode.h" />
<ClInclude Include="mgs\common\util.h" />
<ClInclude Include="mgs\config\cnf.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
93 changes: 93 additions & 0 deletions Arsenal.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="dictionary\dictionary.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="interface\cli\cli.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgs\3rdparty\zlib\wrapper\ZlibWrapper.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgs\common\decryptor\decryptor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgs\common\game\game.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgs\config\cnf.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgs\archive\face\stage\stage.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mgs\archive\face\face.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="dictionary\dictionary.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="interface\cli\cli.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\3rdparty\zlib\wrapper\ZlibWrapper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\3rdparty\zlib\zconf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\3rdparty\zlib\zlib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\archive\archive.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\common\decryptor\decryptor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\common\game\game.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\common\ext_table.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\common\fileutil.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\common\strcode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\common\util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\config\cnf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\archive\face\stage\stage.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mgs\archive\face\face.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
10 changes: 10 additions & 0 deletions Arsenal.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommandArguments>"STAGE2.DAT"</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

# Arsenal


Arsenal is a free open source tool designed to be used with the PS2 version of the game Metal Gear Solid 2. It allows the user to extract Face and Stage archive files packaged with the game. The dictionary provided is thanks to [GirianSeed](https://github.com/GirianSeed) you can check out his mgs dictionary project [here](https://github.com/Joy-Division/JoyDict)

This project uses [Zlib](https://github.com/madler/zlib) by [Mark Adler](https://github.com/madler)

### To Do
- Add multithreaded extract
- Add error handling
- Create GUI variant
- Clean up the code

## Usage

Currently only a CLI version of the application exists. An optional output directory can also be added. it is also possible to just drag the file you wish to extract on the executable. A dictionary file is also included in order to resolve a lot of the hashes.

If you wish to use the dictionary to resolve filenames place it alonside Arsenal.exe, please note this program is currently only designed to work with the PS2 version of MGS2.

```
Arsenal.exe "path\to\STAGE.DAT"
```
The above instruction will extract all files from STAGE.DAT to the current directory.

```
Arsenal.exe -sub "path\to\STAGE.DAT"
```
The above instruction will extract all files from STAGE.DAT for the subsistence version of the game.

```
Arsenal.exe "path\to\FACE.DAT" "path\to\output"
```
The same can be used for Face files. An optional output path can be added at the end, if it is not included then it will extract to the directory of the file being extracted.

## License
[MIT](LICENSE.md)
This project falls under the MIT license.
16 changes: 16 additions & 0 deletions dictionary/dictionary.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "dictionary.h"
#include "../mgs/common/strcode.h"

std::map<unsigned int, std::string> FileNames;

void loadDictionary(const std::string& dictionary) {
std::string str;
std::ifstream file(dictionary);

if (!file) return;

while (std::getline(file, str)) {
int hashed = strcode(str.c_str());
FileNames[hashed] = str;
}
}
8 changes: 8 additions & 0 deletions dictionary/dictionary.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

#include <map>
#include <string>
#include <fstream>

extern std::map<unsigned int, std::string> FileNames;
extern void loadDictionary(const std::string& dictionary);
Loading

0 comments on commit d9bebad

Please sign in to comment.