Skip to content

Commit

Permalink
Fixed AFS extraction bug for some games.
Browse files Browse the repository at this point in the history
- Fixed trying to extract AFS files into non-existing directories for games like Soul Calibur 2, which store truncated paths instead of file names.
  • Loading branch information
MaikelChan committed Dec 15, 2020
1 parent 613fc9e commit 145bd24
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions AFSPacker/AFS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ public static void ExtractAFS(string inputFile, string outputDirectory, string f
fs1.Read(name, 0, name.Length);
fileName[n] = Encoding.Default.GetString(name).Replace("\0", "");

// There are some cases where instead of a file name, an AFS file will store a truncated path like in Soul Calibur 2.
// Remove that path just in case to prevent from extracting into non-existing directories
fileName[n] = Path.GetFileName(fileName[n]);

atrributes[n].Year = br.ReadUInt16();
atrributes[n].Month = br.ReadUInt16();
atrributes[n].Day = br.ReadUInt16();
Expand Down
4 changes: 2 additions & 2 deletions AFSPacker/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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.2.3.0")]
[assembly: AssemblyFileVersion("1.2.3.0")]
[assembly: AssemblyVersion("1.2.4.0")]
[assembly: AssemblyFileVersion("1.2.4.0")]
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.4] - 2020-12-15
### Fixed
- Fixed trying to extract AFS files into non-existing directories for games like Soul Calibur 2, which store truncated paths instead of file names.

## [1.2.3] - 2020-10-31
### Fixed
- Fixed error when trying to read the attribute information of an AFS archive that contains random bytes as padding.
Expand Down

0 comments on commit 145bd24

Please sign in to comment.