Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Dark Souls - BND Import [XBOX360]

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
AniFox
ultra-n00b
Posts: 4
Joined: Sun Oct 05, 2014 4:43 am

Dark Souls - BND Import [XBOX360]

Post by AniFox »

Please help me with importing the files back to the BND. Found this script, but it is only for the PC version. The only difference between the PC and XBOX, it's endiand. In the XBOX 360 uses a large endiand. Please, help me with convert this script under XBOX 360.

Sorry for my bad English.

Code: Select all

$bndpath = FileOpenDialog("Select the BND file", @ScriptDir, "bnd files (*.bnd)", 1)
If @error = 1 Then Exit
$bndfile = FileOpen($bndpath, 16)
$dir = FileSelectFolder("Select the folder...", "", "", @ScriptDir)
If $dir = "" Then
	Exit
EndIf
Dim $names, $pos = 33
_filereadtoarray($dir & "\" & "names.txt", $names)
FileSetPos($bndfile, 20, 0)
$baseoffset = _binarytoint32(FileRead($bndfile, 4))
$basepad = 16 - Mod($baseoffset, 16)
If $basepad < 16 Then
	$baseoffset += $basepad
EndIf
FileSetPos($bndfile, 0, 0)
$newfilehead = FileRead($bndfile, $baseoffset)
$newfiletext = Binary("0x00")
For $i = 1 To $names[0]
	$file = FileOpen($dir & "\" & $names[$i], 0 + 16)
	$size = FileGetSize($dir & "\" & $names[$i])
	$padding = 16 - Mod($size, 16)
	If $padding < 16 Then
		$newfiletext &= FileRead($file) & _binaryrandom($padding, 0, 0)
	Else
		$newfiletext &= FileRead($file)
	EndIf
	$newfilehead = _binarypoke($newfilehead, $pos + 4, $size, "dword")
	$newfilehead = _binarypoke($newfilehead, $pos + 8, $baseoffset, "dword")
	$newfilehead = _binarypoke($newfilehead, $pos + 20, $size, "dword")
	$pos += 24
	If $padding < 16 Then
		$baseoffset += $size + $padding
	Else
		$baseoffset += $size
	EndIf
	FileClose($file)
Next
$hnewfile = FileOpen(compgetfilename($bndpath), 2 + 16)
FileWrite($hnewfile, $newfilehead & BinaryMid($newfiletext, 2))
FileClose($hnewfile)
TrayTip("Importer", "Finish!", 3)

Func compgetfilename($path)
	If StringLen($path) < 4 Then Return -1
	$ret = StringSplit($path, "\", 2)
	If IsArray($ret) Then
		Return $ret[UBound($ret) - 1]
	EndIf
	If @error Then Return -1
EndFunc
You do not have the required permissions to view the files attached to this post.
AniFox
ultra-n00b
Posts: 4
Joined: Sun Oct 05, 2014 4:43 am

Re: Dark Souls - BND Import [XBOX360]

Post by AniFox »

An additional attach BND example of a PC.
You do not have the required permissions to view the files attached to this post.
swuforce
veteran
Posts: 121
Joined: Thu Nov 05, 2009 8:46 pm
Has thanked: 14 times
Been thanked: 106 times

Re: Dark Souls - BND Import [XBOX360]

Post by swuforce »

AniFox wrote:Please help me with importing the files back to the BND. Found this script, but it is only for the PC version. The only difference between the PC and XBOX, it's endiand. In the XBOX 360 uses a large endiand. Please, help me with convert this script under XBOX 360.
Tell me the site name, where you found this script, please.
AniFox
ultra-n00b
Posts: 4
Joined: Sun Oct 05, 2014 4:43 am

Re: Dark Souls - BND Import [XBOX360]

Post by AniFox »

swuforce wrote:
AniFox wrote:Please help me with importing the files back to the BND. Found this script, but it is only for the PC version. The only difference between the PC and XBOX, it's endiand. In the XBOX 360 uses a large endiand. Please, help me with convert this script under XBOX 360.
Tell me the site name, where you found this script, please.
From your post on Xentax. From this link: https://www.sendspace.com/file/cbhe3v

In this link you give autoit3 exe. A code autoit is not encrypted. I'm got a source code using a decompiler. I guess I had to ask permission. I need to remove the code?
TON
ultra-n00b
Posts: 3
Joined: Wed Aug 13, 2014 2:47 pm

Re: Dark Souls - BND Import [XBOX360]

Post by TON »

Agree. An unpack/repack script for Dark Souls Xbox360 version would be awesome.
User avatar
RangerRus
beginner
Posts: 21
Joined: Mon Apr 18, 2011 6:17 pm
Been thanked: 9 times

Re: Dark Souls - BND Import [XBOX360]

Post by RangerRus »

Dark Souls BND files is the same as in Demon's Souls (PS3), as I remember since I had work on translation PS3 version DS to Russian.
Try to search public tools for Demon's Souls.
Post Reply