Re: NfS Shift .BFF files
Posted: Sun Sep 20, 2009 7:32 pm
could anyone upload the new quickbms please as the current link doesnt seem to be working and cant find it anywhere else.
Thanks.
Thanks.
Bugtest, can you explain more about the two CRC (CRC32 ?) values for each file inside BFF files?Bugtest wrote:I make only the extractors.
if someone wants to write a quick rebuilder I suggest to use X12d equal to 0 (no encryption) and ever type 0 for each file so that it's not needed to use the compression.
the crc calculated on the files is just the simple classic one:Code: Select all
unsigned int crtable[...0x77073096 polynomial...]; unsigned int crc = 0xffffffff; for(i = 0; i < len; i++) { crc = crctable[(data[i] ^ crc) & 0xff] ^ (crc >> 8); } return(crc);
Code: Select all
BFF header:
bytes description
4 " KAP" ("PAK " in big endian)
4 0x03004010
4 files
4 alignment
4 zero
4 0x800
0x100 name of the archive
4 X118, size of the information table
4 zero
4 X120, size of the name table + 0x308
4 DHSA field offset
4 DHSA field size
1 zero
1 X12d, set it to 0
1 zero
1 zero
X118 information table
4 "TXEP"
4 not verified
0x100 Gecko.xml or GeckoDemo.xml
0x100 C:\DEV\Gecko\ or C:\DEV\GeckoDemo\
0x100 PC
X120 name table
Code: Select all
information table:
4 unused (set it as you want, the game works in any case)
4 unused (set it as you want, the game works in any case)
4 absolute offset of the file
4 ever zero
4 size of the file in the archive (for example its compressed size)
4 size of the extracted file
4 zero
4 zero
4 type, set it to 0 (2 is meant for compressed files)
4 zero
4 CRC of the file as is in the archive
4 extension (example: fxo)
Code: Select all
name table:
4 absolute offset where is located the name string
4 zero
4 not verified, tell me if there are problems
4 not verified, seems only a date timestamp
Thanks for the file structure, you're right about the CRC field being immediately before extension field, but the fields you called initially CRC1 and CRC2 cannot be of any value, the game crashes if I try different values than the original ones. Fortunately those fields don't need to be recalculated if the contents are changed.Bugtest wrote:I have just updated a small but important detail.
the first 2 fields of the information table are NOT the crc of the file but something else (probably a 64bit timestamp or similar) that can be set to any value.
while the CRC of the file as is stored in the archive is the one immediately before the extension field.
sorry for the mistake.
Code: Select all
// Vehicle movement affects driver's head physics, but head does NOT
// influence vehicle dynamics. This violates Newton's 3rd law, but
// allows user to configure head physics without "cheating".
HeadMass=6.0 // Head and helmet
HeadInertia=(0.032,0.028,0.029) // Head and helmet
MinPos=(-0.03,-0.08,-0.050) // Minimum extents of position (should be negative)
MaxPos=( 0.03, 0.08, 0.015) // Maximum extents of position (should be positive)
MinOri=(-7.0,-7.0,-7.0) // Minimum degrees of pitch, yaw, roll (should be negative)
MaxOri=( 7.0, 7.0, 7.0) // Maximum degrees of pitch, yaw, roll (should be positive)
// There are three types of springs to control head movement:
//
// Sliding = spring/damper force maintains given direction relative to vehicle
// Normal = spring/damper force in direction between connection points
// FreeDamping = spring is normal, but damper resist velocity in any direction
//
// Parameters for springs are:
//
// SpringDir = direction of spring/damper forces (automatically normalized, not valid for Normal springs)
// SpringHead = connection to driver head (relative to head center)
// SpringBody = connection to vehicle body (relative to head center)
// SpringCollLen = if more than zero, spring doesn't take effect until minimum length has been reached
// SpringParams = spring rate and damper rate
Spring=Sliding
SpringDir=(0.0,1.0,-0.0) // up/down
SpringHead=(0.0,-0.05,0.01)
SpringBody=(0.0,-0.05,0.01)
SpringParams=(1000.0,225.0)
Spring=Sliding
SpringDir=(0.0,-0.0,-1.0) // forward/back
SpringHead=(0.0,-0.05,0.01)
SpringBody=(0.0,-0.05,0.01)
SpringParams=(1700.0,382.0)
Spring=Sliding
SpringDir=(1.0,0.0,0.0) // lateral
SpringHead=(0.0,-0.05,0.01)
SpringBody=(0.0,-0.05,0.01)
SpringParams=(8500.0,351.0)
Spring=FreeDamping // resists yawing and rolling
SpringHead=(2.0,0.0,0.0)
SpringBody=(2.0,0.0,0.0)
SpringParams=(63.9,1.31)
Spring=FreeDamping // resists yawing and pitching
SpringHead=(0.0,0.0,2.0)
SpringBody=(0.0,0.0,2.0)
SpringParams=(63.9,1.31)
But do you see anything useful? I don't know how the strings are indexed, changing the length of a couple strings on the beginning it's sufficient to mess the entire game.Bugtest wrote:I see no offset or size values in these files