Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- objStartFile = "Data1.bdt" 'File to unpack, same folder
- objStartFolder = "D:\Games\DarkSoulsIII\Game\Data1" 'export folder
- binderToolPath = "bindertool.exe" 'same folder
- texConvPath = "texconv.exe" 'same folder
- '******** Define stuff
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set oShell = CreateObject ("WScript.Shell")
- If Not objFSO.FolderExists(objStartFolder) Then
- Set objFolder = objFSO.CreateFolder(objStartFolder)
- End If
- Set objFolder = objFSO.GetFolder(objStartFolder)
- Set objSuperFolder = objFSO.GetFolder(objStartFolder)
- '******** Start bindertool to extract first BND, comment/remove line if you don't want it
- Call ExtractStartBND (objStartFile)
- '******** Start bindertool to extract all BND, comment/remove line if you don't want it
- Call ExtractBND (objSuperFolder)
- '******** Start bindertool to extract all TPF, comment/remove line if you don't want it
- Call ExtractTPF (objSuperFolder)
- '******** Start texconv to convert DDS to PNG, comment/remove line if you don't want it
- Call ConvertDDS (objSuperFolder)
- Sub ExtractStartBND(fFile)
- runline = "cmd.exe /c " & binderToolPath & " " & fFile
- 'wscript.echo "Running " & binderToolPath & " " & fFile
- oShell.run runline,1,True
- End Sub
- Sub ExtractBND(fFolder)
- Set objFolder = objFSO.GetFolder(fFolder.Path)
- Set colFiles = objFolder.Files
- For Each objFile in colFiles
- If UCase(objFSO.GetExtensionName(objFile.Name)) = "TEXBND" Or UCase(objFSO.GetExtensionName(objFile.Name)) ="ANIBND" Or UCase(objFSO.GetExtensionName(objFile.Name)) = "BEHBND" Or UCase(objFSO.GetExtensionName(objFile.Name)) = "CHRBND" Or UCase(objFSO.GetExtensionName(objFile.Name)) = "OBJBND" Or UCase(objFSO.GetExtensionName(objFile.Name)) = "PARTSBND" Then
- runline = "cmd.exe /c " & binderToolPath & " " & objFile.Path
- 'wscript.echo "Running " & binderToolPath & " " & objFile.Path
- oShell.run runline,1,True
- End if
- Next
- For Each Subfolder in fFolder.SubFolders
- ExtractBND(Subfolder)
- Next
- End Sub
- Sub ExtractTPF(fFolder)
- Set objFolder = objFSO.GetFolder(fFolder.Path)
- Set colFiles = objFolder.Files
- For Each objFile in colFiles
- If UCase(objFSO.GetExtensionName(objFile.Name)) = "TPF" Then
- runline = "cmd.exe /c " & binderToolPath & " " & objFile.Path
- 'wscript.echo "Running " & binderToolPath & " " & objFile.Path
- oShell.run runline,1,True
- End if
- Next
- For Each Subfolder in fFolder.SubFolders
- ExtractTPF(Subfolder)
- Next
- End Sub
- Sub ConvertDDS(fFolder)
- Set objFolder = objFSO.GetFolder(fFolder.Path)
- Set colFiles = objFolder.Files
- For Each objFile in colFiles
- If UCase(objFSO.GetExtensionName(objFile.Name)) = "DDS" Then
- runline = "cmd.exe /c " & texConvPath & " -ft PNG " & objFile.Path & " -o " & objFile.ParentFolder
- 'wscript.echo "Running " & texConvPath & " -ft PNG " & objFile.Path & " -o " & objFile.ParentFolder
- oShell.run runline,1,True
- End if
- Next
- For Each Subfolder in fFolder.SubFolders
- ConvertDDS(Subfolder)
- Next
- End Sub
Add Comment
Please, Sign In to add comment