Jump to content

Repack SFS file.


Pikor

Recommended Posts

Hi,

I have file with SFS expansion. I used QuickBMS to export from this file. It contain TXT files.
 

idstring "SFS1"
get FILES short
for i = 1 <= FILES
	get NAMEL short
	getDstring NAME NAMEL
	get OFFSET long
	savepos MYOFF
	goto OFFSET
	get SIZE long
	math OFFSET += 4
	goto MYOFF
	log NAME OFFSET SIZE
next i




So... QB work great when we replace file with the same or less size. Have you any idea where I find any "repacker" or how pack this file with different size of replace files?

PS. Forcing in the QB corrupts the file.

Subtitle.zip

Link to comment
Share on other sites

5 hours ago, Pikor said:

Hi,

[...]

So... QB work great when we replace file with the same or less size. Have you any idea where I find any "repacker" or how pack this file with different size of replace files?

PS. Forcing in the QB corrupts the file.

Hi, there may be game-specific repackers but quickbms is the only "universal" repacker I know of.

The problem with oversized repacked files is like so: say the white rectangle is a replacement file with bigger size. So it will damage the beginning of file 2 on repacking.

symbolic picture of packed archive

So you need to cut all 4 files from the archive and concatenate them (binary) again with file 1 replaced.

But there might be offsets in the archive header which need to be corrected then.

Generally it's not that simple. So you urgently need to understand the structure of the archive for such.

(Just a wild guess, maybe someone knows better?)

Edited by shak-otay
Link to comment
Share on other sites

5 minutes ago, EmptyMan said:

So, it's Culpa Innata, right? I can probably make text tool.

Yep 🙂 You probably know is an another file (CutScene.sfs) keeping cutscenes subtitle but not only txt (nif, KF, dat). I will be VERY thankfull if you try make a tool.

 

3 hours ago, shak-otay said:

Hi, there may be game-specific repackers but quickbms is the only "universal" repacker I know of.

The problem with oversized repacked files is like so: say the white rectangle is a replacement file with bigger size. So it will damage the beginning of file 2 on repacking.

symbolic picture of packed archive

So you need to cut all 4 files from the archive and concatenate them (binary) again with file 1 replaced.

But there might be offsets in the archive header which need to be corrected then.

Generally it's not that simple. So you urgently need to understand the structure of the archive for such.

(Just a wild guess, maybe someone knows better?)

Thanks for explanation. I trying the same method with another game file and there everything worked fine. Probably engine can handle that "messy" file 😛

Link to comment
Share on other sites

Works perfectly 😉 I'm uploading all of them if you'd need any of them.
https://gofile.me/7i7Sv/6RqswHVvw

Meanwhile I check how to edit nif files (texure for fonts, pa and main menu). NifSkope can export to dds (from NiPixelData) but not import, I looking something else.

Edit ---------------------

Ok, I figured out. NifSkope 1.3 (in 2.0 not work, error) can insert dds in nif. Ofc I cropped dds because for a test I used QuickBMS to pack the file (smaller size).


For others if they want do something with this game.

Load original nif file.

obraz.png.f03a4b81a8ea9d2e85513c86cf223bc5.png

Insert block NiSourceTexture. Load dds texture to it.

obraz.png.9efdd2eb6f6a09a97f403c214dce3309.png

Embedding texture.

obraz.png.0683dd9d03e8b5968340fb8236a183d8.png

We got the same block like in original.


obraz.png.0371495e82096ca1eb3ff7e5917d4a2a.png

Now we can compare old and new data.

obraz.png.0311582adb68c6ff9697ca1e26ac8dc6.png

Remove old NiPixelData and NiSourceTexture. Stay only new one NiPixelData. Save file.

Edited by Pikor
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...