Atvaark / BinderTool

Dark Souls II / Dark Souls III / Bloodborne / Elden Ring bdt, bhd, bnd, dcx, tpf, fmg and param unpacking tool
MIT License
310 stars 50 forks source link

Unhandled exception when extracting DS2's sound files (.bnd) #18

Closed aEmadix closed 7 years ago

aEmadix commented 7 years ago

I successfully extracted GameDataEbl.bdt (in Dark Souls II non SoTFS). However, I get this error when I try to extract any of the .bnd files (like frpg2_main.bnd) in the folder GameDataEbl\Sound :

Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'N:\FRPG2\data\Sound\out\out_pc\frpg2_main.fev'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost) at System.IO.File.WriteAllBytes(String path, Byte[] bytes) at BinderTool.Program.UnpackBndFile(Stream inputStream, String outputPath) at BinderTool.Program.UnpackBndFile(Options options) at BinderTool.Program.Main(String[] args)

I am using V3, and I also tried using the latest one just in case. Same error. Is there any way I can get past this?

Thank you.

Atvaark commented 7 years ago

Try mapping a folder to the drive letter N before extracting that archive.

mkdir C:\Temp1\
subst N: C:\Temp1

Copy the extracted files somewhere else and remove the mapping and folder.

subst N: /D
rmdir C:\Temp1
aEmadix commented 7 years ago

I got a different error this time after I mapped the folder to N:

Unhandled Exception: System.Exception: Unknown signature at BinderTool.Core.Bnd4.Bnd4File.Read(Stream inputStream) in c:\Users\Tim\Documents\GitHub\BinderTool\BinderTool.Core\Bnd4\Bnd4File.cs:line 35 at BinderTool.Program.UnpackBndFile(Stream inputStream, String outputPath) at BinderTool.Program.UnpackBndFile(Options options) at BinderTool.Program.Main(String[] args)

Atvaark commented 7 years ago

Are you still trying to unpack frpg2_main.bnd or is this another file?

aEmadix commented 7 years ago

Yes, it is the _frpg2main.bnd file. However, I tried unpacking other .bnd files in the unpacked GameDataEbl\Sound folder and got the same two errors as well.

The reason I wanted to edit the _frpg2main.bnd file is because I was looking to modify some of the game's sound effects that I couldn't find in any .fsb file in the folder Game\Sound

Atvaark commented 7 years ago

Workarounds

Unknown signature

Open the XXXXX.bnd file in a text editor or hex editor and check if it starts with the letters DCX. If it does then rename the file to XXXXX.bnd.dcx and use this command to decompress the file.

BinderTool.exe XXXXX.bnd.dcx

This will create the file ...\XXXXX.bnd\XXXXX.bnd.

Could not find a part of the path N:\FRPG2...

e. g. Could not find a part of the path 'N:\FRPG2\data\Sound\out\out_pc\frpg2_main.fev'.

  1. Create a folder and map it to the drive letter N

    mkdir C:\Temp1
    subst N: C:\Temp1
  2. Create the missing folder manually

    mkdir N:\FRPG2\data\Sound\out\out_pc\
  3. Extract the .bnd file again Repeat step 2. if another directory is missing

  4. Remove the folder mapping

    subst N: /D
aEmadix commented 7 years ago

Thank you very much for your support. Indeed, it was a .dcx file, and renaming it resolved the problem.

Just another small question, I wonder if it would be possible at all to recompile the original .bnd (the .dcx one) after editing the sound files in _frpg2main.bnd, so that the game can read the modded sound files?

Atvaark commented 7 years ago

I can't think of a reason why that wouldn't be possible. Of course someone (not me) would have to build a recompiler first to prove it.

aEmadix commented 7 years ago

Actually, I don't think that will be necessary. I just placed the modified _frpg2main.fsb file in Dark Souls II\Game\Sound, and commented out the .bnd file entry in DarkSoulsII.exe.

The game seemed to load the .fsb file just fine and all the sounds played.