ividyon / WitchyBND

Unpacks/repacks FromSoftware archive formats and serializes FromSoftware data formats.
Other
116 stars 11 forks source link

Unpacking fails on binders with mixed drive roots #25

Closed JKAnderson closed 6 months ago

JKAnderson commented 6 months ago

Drive letters should still be unrooted even when there is no common root, since : isn't legal in a path. Hopefully Witchy still supports per-file roots and it wasn't exclusively moved to the top level :smile: Sample file attached; to be clear, this is a modded file where I was just too lazy to put the full path, but I think that's a legitimate use case. You could also consider this a more general issue with illegal characters in binder paths, but that seems like more of a PEBKAC thing.

m00_00_00_00.talkesdbnd.dcx.zip

-----------------
WitchyBND 2.6.2.1
-----------------
Configuration
-------------
                   Selected mode: Parse
        Specialized BND handling: False
          DCX decompression only: False
Store PARAM field default values: True
     Recursive binder processing: False
             Parallel processing: True
-------------

Decompressing DCX: m00_00_00_00.talkesdbnd.dcx...
Unpacking BND4: m00_00_00_00.talkesdbnd.dcx...
D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00.talkesdbnd.dcx: Unhandled exception:
System.AggregateException: One or more errors occurred. (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00') (The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00')
 ---> System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.TaskReplicator.Run[[TState]](ReplicatableUserAction`1, ParallelOptions, Boolean)
   at System.Threading.Tasks.Parallel.ForWorker[[TLocal,TInt]](TInt, TInt, ParallelOptions, Action`1, Action`2, Func`4, Func`1, Action`1)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection, CancellationToken, Exception)
   at System.Threading.Tasks.Parallel.ForWorker[[TLocal,TInt]](TInt, TInt, ParallelOptions, Action`1, Action`2, Func`4, Func`1, Action`1)
   at System.Threading.Tasks.Parallel.ForEachWorker[[TSource,TLocal]](IEnumerable`1, ParallelOptions, Action`1, Action`2, Action`3, Func`4, Func`5, Func`1, Action`1)
   at System.Threading.Tasks.Parallel.ForEach[[TSource]](IEnumerable`1, Action`3)
   at WitchyBND.Parsers.WBinderParser.WriteBinderFiles(IBinder bnd, String destDirPath, String root) in ./WitchyBND/Parsers/WBinderParser.cs:line 84
   at WitchyBND.Parsers.WBND4.Unpack(String srcPath, ISoulsFile file, Nullable`1 game) in ./WitchyBND/Parsers/Binder/WBND4.cs:line 39
   at WitchyBND.Parsers.WBND4.Unpack(String srcPath, ISoulsFile file) in ./WitchyBND/Parsers/Binder/WBND4.cs:line 22
   at WitchyBND.CliModes.ParseMode.Unpack(String path, ISoulsFile file, Type compression, WFileParser parser, Boolean recursive) in ./WitchyBND/CliModes/ParseMode.cs:line 210
   at WitchyBND.CliModes.ParseMode.<>c__DisplayClass5_3.<ParseFiles>b__2() in ./WitchyBND/CliModes/ParseMode.cs:line 10
   at WitchyBND.Services.ErrorService.Catch(Func`1 callback, Boolean& error, String source) in ./WitchyBND/Services/ErrorService.cs:line 133
 ---> (Inner Exception #1) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #2) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #3) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #4) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #5) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #6) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #7) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #8) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #9) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #10) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #11) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #12) System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00-talkesdbnd-dcx\W:\FNR\data\Target\INTERROOT_win64\script\talk\m00_00_00_00'
   at System.IO.FileSystem.CreateDirectory(String, Byte[[]] )
   at System.IO.Directory.CreateDirectory(String)
   at WitchyBND.Parsers.WBinderParser.<>c__DisplayClass0_0.<WriteBinderFiles>g__Callback|1(BinderFile file, Int64 i) in ./WitchyBND/Parsers/WBinderParser.cs:line 76
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

Unpacking DCX: m00_00_00_00.talkesdbnd.dcx...
Successfully parsed m00_00_00_00.talkesdbnd.dcx.

------------------------------------------
Operation completed on 1 item in 00:00:00.

Press any key to continue...
JKAnderson commented 6 months ago

Bonus issue: With parallel processing off, it for some reason tries to both unpack and decompress it so this happens:

-----------------
WitchyBND 2.6.2.1
-----------------
Configuration
-------------
                   Selected mode: Parse
        Specialized BND handling: False
          DCX decompression only: False
Store PARAM field default values: True
     Recursive binder processing: False
             Parallel processing: False
-------------

Decompressing DCX: m00_00_00_00.talkesdbnd.dcx...
Unpacking BND4: m00_00_00_00.talkesdbnd.dcx...
D:\Games\FromSoftware\Mod Engine\mod\ac6\ac6\script\talk\m00_00_00_00.talkesdbnd.dcx: WitchyBND could not operate on the file as it was being used by another process.
Unpacking DCX: m00_00_00_00.talkesdbnd.dcx...

------------------------------------------
Operation completed on 1 item in 00:00:00.

Press any key to continue...