Skip to content

Commit

Permalink
Fix unpacking DSII SotFS .bdt files
Browse files Browse the repository at this point in the history
  • Loading branch information
Atvaark committed Oct 17, 2017
1 parent 0798803 commit 09a5b04
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 37 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*.user
*.sln.docstates

.vs/

# Build results
[Dd]ebug/
[Dd]ebugPublic/
Expand Down
9 changes: 3 additions & 6 deletions BinderTool.Core/Bhd5/Bhd5BucketEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ public static Bhd5BucketEntry Read(Stream inputStream)
BinaryReader reader = new BinaryReader(inputStream, Encoding.UTF8, true);
result.FileNameHash = reader.ReadUInt32();
result.FileSize = reader.ReadInt32();
result.FileOffset = reader.ReadUInt32();
reader.Skip(4);
int saltedHashOffset = reader.ReadInt32();
reader.Skip(4);
int aesKeyOffset = reader.ReadInt32();
reader.Skip(4);
result.FileOffset = reader.ReadInt64();
long saltedHashOffset = reader.ReadInt64();
long aesKeyOffset = reader.ReadInt64();

if (saltedHashOffset != 0)
{
Expand Down
7 changes: 4 additions & 3 deletions BinderTool.Core/BinderTool.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BinderTool.Core</RootNamespace>
<AssemblyName>BinderTool.Core</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -32,8 +33,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
<Reference Include="BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
<HintPath>..\packages\BouncyCastle.1.8.1\lib\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\packages\ICSharpCode.SharpZipLib.dll.0.85.4.369\lib\net20\ICSharpCode.SharpZipLib.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions BinderTool.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("615e60b8-3eb0-4f54-ad9b-4fa1a9fe0df0")]
[assembly: AssemblyVersion("0.3.0.0")]
[assembly: AssemblyFileVersion("0.3.0.0")]
[assembly: AssemblyVersion("0.3.1.0")]
[assembly: AssemblyFileVersion("0.3.1.0")]
2 changes: 1 addition & 1 deletion BinderTool.Core/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
<package id="BouncyCastle" version="1.8.1" targetFramework="net45" />
<package id="ICSharpCode.SharpZipLib.dll" version="0.85.4.369" targetFramework="net45" />
</packages>
6 changes: 3 additions & 3 deletions BinderTool/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
</configuration>
</configuration>
14 changes: 5 additions & 9 deletions BinderTool/BinderTool.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand All @@ -9,11 +9,13 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BinderTool</RootNamespace>
<AssemblyName>BinderTool</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<NuGetPackageImportStamp>abf6a274</NuGetPackageImportStamp>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -52,7 +54,6 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BinderTool.Core\BinderTool.Core.csproj">
Expand All @@ -65,19 +66,14 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="FodyWeavers.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Aktivieren Sie die Wiederherstellung von NuGet-Paketen, um die fehlende Datei herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
<Error Condition="!Exists('..\packages\Fody.1.28.3\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.28.3\build\Fody.targets'))" />
</Target>
<Import Project="..\packages\Fody.1.28.3\build\Fody.targets" Condition="Exists('..\packages\Fody.1.28.3\build\Fody.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
5 changes: 0 additions & 5 deletions BinderTool/FodyWeavers.xml

This file was deleted.

10 changes: 10 additions & 0 deletions BinderTool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,22 @@ private static bool TryGetFileExtension(string signature, out string extension)
case "DCX\0":
extension = ".dcx";
return true;
case "DDS ":
extension = ".dds";
return true;
case "TAE ":
extension = ".tae";
return true;
case "FSB5":
extension = ".fsb";
return true;
case "fsSL":
case "fSSL":
extension = ".fssl";
return true;
case "MSB ":
extension = ".msb";
return true;
case "TPF\0":
extension = ".tpf";
return true;
Expand Down
4 changes: 2 additions & 2 deletions BinderTool/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("5d388695-6078-4404-8f5a-0bb1a94df97b")]
[assembly: AssemblyVersion("0.3.0.0")]
[assembly: AssemblyFileVersion("0.3.0.0")]
[assembly: AssemblyVersion("0.3.1.0")]
[assembly: AssemblyFileVersion("0.3.1.0")]
5 changes: 0 additions & 5 deletions BinderTool/packages.config

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ A Dark Souls II bdt, bhd, bnd, dcx and sl2 unpacking tool

## Requirements
```
Microsoft .NET Framework 4.5
Microsoft .NET Framework 4.5.2
```

## Usage
Expand Down

0 comments on commit 09a5b04

Please sign in to comment.