Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
rdavisau committed Dec 31, 2016
0 parents commit 508e983
Show file tree
Hide file tree
Showing 16 changed files with 864 additions and 0 deletions.
252 changes: 252 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
## 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/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# 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
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# 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
nCrunchTemp_*

# 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 database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/

# 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
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt

# 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/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/

# 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/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Ryan Davis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# sg-unpack
Unpacker for STEINS;GATE .mpk content files.

Tested with content files from the Steam edition of STEINS;GATE with the [Steam Improvement Patch](http://sonome.dareno.me/projects/sghd.html) applied. Other configurations might also work, as well as other games by the same publisher using the .mpk format, but these are untested.

### Downloading
Check the [releases](https://github.com/rdavisau/sg-unpack/releases) page for the latest version.

### Usage
`sg-unpack` is a command line tool that takes one or many .mpk inputs and extracts the content to a given output directory.

```
sg-unpack 1.0.0.0
Copyright © Ryan Davis 2017
-i, --input-path Required. Path to input/s. Can be an individual file, or a directory.
-m, --input-mask (Default: *.mpk) Search mask for --input-path, used if --input-path is a directory.
-o, --output-path Output path for extracted files. If ommitted, contents will be listed but not extracted.
-f, --output-filter Case-insensitive filter for files to extract.
-q, --quiet (Default: false) Set true to hide most output.
--help Display this help screen.
--version Display version information.
```

### Examples

#### List the files in the `bgm.mpk` pack by omitting the `output-path`:

###### Command
`sg-unpack.exe -i C:\Program Files (x86)\Steam\steamapps\common\STEINS;GATE\USRDIR\bgm.mpk`

###### Output
```
Using inputs [ bgm.mpk ] in C:\Program Files (x86)\Steam\steamapps\common\STEINS;GATE.
Scanning 1 inputs...
Processing 83 entries...
bgmBGM03.ogg ~4.87 MB
bgmBGM04.ogg ~3.49 MB
* snip *
bgmBGM999.ogg ~2.53 MB
bgmSONG1.ogg ~2.45 MB
83 entries found in 1 pack.
No files extracted. Use --output-path to specify an output directory.
```

#### Use output filter to extract all audio files (`.ogg`) from the mpk files in the content directory to `C:\SG`, without listing the processed files (`-q true`):

###### Command
`sg-unpack.exe -i C:\Program Files (x86)\Steam\steamapps\common\STEINS;GATE\USRDIR -f .ogg -o C:\SG -q true`

###### Output
```
Using inputs [ bg.mpk, bgm.mpk, chara.mpk, manual.mpk, mask.mpk, mgsshader.mpk, script.mpk, se.mpk, shader.mpk, system.mpk, voice.mpk ] in C:\Program Files (x86)\Steam\steamapps\common\STEINS;GATE.
Scanning 11 inputs...
Processing 16,096 entries matching on filter '.ogg'...
14,794 files (1.79 GB) extracted to 'C:\SG' in 00:00:07.7275492.
```

#### Extract All The Things:

###### Command
`sg-unpack.exe -i C:\Program Files (x86)\Steam\steamapps\common\STEINS;GATE\USRDIR -o C:\SG`

###### Output
```
Using inputs [ bg.mpk, bgm.mpk, chara.mpk, manual.mpk, mask.mpk, mgsshader.mpk, script.mpk, se.mpk, shader.mpk, system.mpk, voice.mpk ] in C:\Program Files (x86)\Steam\steamapps\common\STEINS;GATE.
Scanning 11 inputs...
Processing 16,096 entries...
* snip sixteen thousand lines *
16,096 files (3.31 GB) extracted to 'C:\SG' in 00:00:12.2559171.
```

### Issues
Error handling is minimal to non-existent :smile: If you have any problems, open an issue and depending on the nature of the error I might take a look. That said, I wrote this on the request of a friend so it's mostly provided here on an 'as-is' basis :shipit:
27 changes: 27 additions & 0 deletions sg-unpack.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26014.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sg-unpack", "sg-unpack\sg-unpack.csproj", "{8C4DC592-2429-48C4-8C78-FDD33AE303A0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3C945479-8A26-4D01-B645-8A4287041AC7}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8C4DC592-2429-48C4-8C78-FDD33AE303A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C4DC592-2429-48C4-8C78-FDD33AE303A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C4DC592-2429-48C4-8C78-FDD33AE303A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C4DC592-2429-48C4-8C78-FDD33AE303A0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions sg-unpack/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Loading

0 comments on commit 508e983

Please sign in to comment.