ZenHAX
https://zenhax.com/

[HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization
https://zenhax.com/viewtopic.php?f=12&t=6893
Page 1 of 1

Author:  haku0011 [ Fri Nov 03, 2017 11:31 am ]
Post subject:  [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

Game: http://store.steampowered.com/app/607890/Sword_Art_Online_Hollow_Realization_Deluxe_Edition/

Attachments:
File comment: OFS3 Header Localization
localize_msg.dat [2.35 MiB]
Downloaded 128 times

Author:  makc_ar [ Fri Nov 03, 2017 11:43 am ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

Try this https://github.com/Liquid-S/OFS3-TOOL Not sure

Author:  haku0011 [ Fri Nov 03, 2017 1:57 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

Image

Somehow it works, but it's still has an encrypt.

Attachments:
File comment: Add txt to send a file
(50005).txt [24 Bytes]
Downloaded 102 times

Author:  aluigi [ Fri Nov 03, 2017 3:17 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

Alternatively you can use this script for generating a txt file to use for translation (with size limits obviously):
Code:
get NAME basename
string NAME + ".txt"
idstring "OFS3"
get BASE_OFF long
get DUMMY long
get DATA_SIZE long
get STRINGS long
for i = 0 < STRINGS
    get OFFSET long
    get DUMMY long
    math OFFSET + BASE_OFF
    slog NAME OFFSET -1
next i

Author:  haku0011 [ Fri Nov 03, 2017 5:21 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

it works, tks aluigi!!!!

Author:  aluigi [ Fri Nov 03, 2017 7:29 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

If you want to reimport the edited txt back in the original file you must use the reimport feature of quickbms, read section 3 of http://aluigi.org/papers/quickbms.txt for info.
Just remember that your strings must have the same length or shorter than the original ones.

Author:  Wind_Blade [ Tue Nov 07, 2017 12:11 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

It is possible to extract the images from the game? to see to change them? I try to extract all the resources but they are encrypt and the images in .file that are not recognized

Author:  makc_ar [ Tue Jan 30, 2018 2:11 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

How to edit this files?

Image

Attachments:
files.rar [717.55 KiB]
Downloaded 59 times

Author:  Nameless32 [ Tue Jan 30, 2018 7:43 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

makc_ar wrote:
How to edit this files?

Image


U can Edit it manually

with this info.


offset where the text start.
Image


Go to offset.
Image


Copy or edit the text.
Image


Exemple:
Image


this " NUL " value is the end of the phrase " 0x00 ".
the lenght off all text must be " mod 4 = 0 ".

Author:  makc_ar [ Tue Jan 30, 2018 11:38 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

@Nameless32
Thanks a lot! You can write a tool export\import for these files?

Author:  Nameless32 [ Wed Jan 31, 2018 7:29 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

Here.

Thanks to swuforce and yours sources, i've learned how to make my own tools.

Attachments:
SAO_HR_Tools.zip [980.05 KiB]
Downloaded 213 times

Author:  makc_ar [ Wed Jan 31, 2018 9:24 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

@Nameless32
Thanks a lot! How about unpacking all files in folder?
Example:
Code:
$Dir = FileSelectFolder("Select the folder...", "", "", @ScriptDir)


Attachments:
File comment: Only .txt
SAO_HR_EN.rar [1.16 MiB]
Downloaded 3066 times

Author:  Rewinged [ Mon Sep 09, 2019 2:51 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

I know this is a bit of a necro, but thought it'd be best ot post here than start a new thread.

I was wondering if anyone found a good workflow for changing text in the end? I'm probably messing up something simple. Here's the steps I'm following:

I unpack usa.cpk
I delete all folders except msg (contains the text I want to edit)
I either edit localize_msg.dat in notepad++ directly or I unpack the file using the script above to make a neat loc file for editing.
I edit even just a single word (overwriting the word with another of the same length ie 'hello' with 'heya')
I try to repack the file but it says the file size is different now (compressed file size that is, uncompressed is the same since it's the same amount of characters)

No matter how small the edit I find it odd that the file always ends up a few bytes larger. I've managed to get it to work on a few occasions by editing text elsewhere in the file by replacing it all with spaces which reduces the file size. Most the time the game will load with no text present anywhere, but occasionally it'll load correctly with the edited text.

I'm a 3D artist so a lot of the terminoligy here goes over my head but I'd love to learn, there's quite a lot of dialoge I'd like to change to be less repetitive and more engaging. I'm guessing some letters are larger than others? Maybe notepad++ is doing something weird to increase file size slightly? I'll have to try with changing just a single letter next time to see if it still happens.

Any help would be appreciated!

Here's a screenshot if it helps in any way... I simply changed the word 'Slay' into 'Prod' in this example
Image

Author:  Rewinged [ Tue Sep 10, 2019 7:29 am ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

After spending several more hours trying to work it out, still running into the problem of the text simply not appearing in-game 90% of the time. If I make small edits like just changing a single word it works, but only after replacing other text somewhere with a bunch of spaces or whatever. If I change a whole sentence it works occasionally. If I change several sentences it never works. There's a post above explaining how to edit it mentioning offsets and such but the images don't work. They also linked a tool they made but unfortunately it does nothing for me except create a blank text file when using it on the localisation or any other file.

Just to be clear I'm definitely only replacing the text, I'm not erasing, deleting or adding characters, just changing them. The results are the same if I edit in notepad++, if I extract the text files using the above script and edit that way, or if I edit directly in a hex editor. It's why I'm so lost as to why changing a couple of letters would make the file a few bytes larger and thus unable to repack, or why no text at all appears in game if I edit more than a few words. Any help would be appreciated!

On a good note I've been making progress on changing out images in Hollow Fragment and Hollow Realization. The colours aren't quite right, seems like some channels are correct while others have the hue offset by a bunch, but I'll keep working on it. If I get too stuck I'll make another post in the the relevant channel for that :)

Author:  Delutto [ Wed Sep 11, 2019 4:47 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

Rewinged wrote:
I try to repack the file but it says the file size is different now (compressed file size that is, uncompressed is the same since it's the same amount of characters)
Don't use the BMS script to repack cpk files, use some proper tool like YACpkTool.

Author:  Rewinged [ Wed Sep 11, 2019 8:01 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

Delutto wrote:
Rewinged wrote:
I try to repack the file but it says the file size is different now (compressed file size that is, uncompressed is the same since it's the same amount of characters)
Don't use the BMS script to repack cpk files, use some proper tool like YACpkTool.


Ahh thanks, I'll check that out as soon as possible for sure. I figured it was something simple like that. Hopefully that'll fix this problem for me cheers

Author:  Rewinged [ Thu Sep 12, 2019 2:29 pm ]
Post subject:  Re: [HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

That did the trick, thanks so much Delutto! Even works for custom images too, they were showing up black before. Just as a heads up in case anyone happens to have this problem in the future, here's how I did the images.

Use rawtex to convert the file to .dds with these settings - offset to 9df , width and height to 1920 x 1080 , image type to r8g8b8a8_unom
Notice the DDS will be flipped upside-down but colors are correct.
Flip the image vertically and do your normal edits.
Before saving it out, swap the red and blue channels (no need to flip the image back vertically)
Save as .tga 32bit with alphas
Open the image as well as the original archived version in a hex editor
Replace blocks 0-11 of the TGA with blocks 0-9DE of the original file (the Phyre header stuff)
Image
Delete the last 20 blocks from the TGA (Truevision-xfile stuff)
Image
Save and it's done. Rename the TGA and replace the original archived version, then repack the .cpk with YACpkTool

It's super basic stuff and I'm just a beginner to this but hopefully it helps someone... There's probably much cleaner/easier ways of doing this but it's pretty fast and it works.
I don't get why the red and blue channels need to be flipped though to be honest. It's weird that in rawtex the images appear upside down with correct colours... If you reimport an image the right way up with normal colours it will show up right way up with red and blue channels swapped. It's only if you save right way up with red and blue swapped that suddenly the image will flip upside down and be correct in game. I'm sure others will the know the answer to this of course haha.

Transparency works fine too, here's a super quick test, replacing a tutorial message with a random monkey image
Image

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/