Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

[HELP] Unpack/Repack OFS3 Header Sword Art Online Hollow Realization

Featured Replies

  • Author
  • Localization

haku0011, posted Fri Nov 03, 2017 1:57 pm (29692)


Image

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

aluigi, posted Fri Nov 03, 2017 3:17 pm (29696)


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
  • Localization

haku0011, posted Fri Nov 03, 2017 5:21 pm (29701)


it works, tks aluigi!!!!
  • Author
  • Localization

aluigi, posted Fri Nov 03, 2017 7:29 pm (29705)


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
  • Localization

Wind_Blade, posted Tue Nov 07, 2017 12:11 pm (29839)


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
  • Localization

makc_ar, posted Tue Jan 30, 2018 2:11 pm (32044)


How to edit this files?

Image
  • Author
  • Localization

Nameless32, posted Tue Jan 30, 2018 7:43 pm (32052)


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
  • Localization

makc_ar, posted Tue Jan 30, 2018 11:38 pm (32061)


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

Nameless32, posted Wed Jan 31, 2018 7:29 pm (32081)


Here.

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

SAO_HR_Tools.zip

  • Author
  • Localization

makc_ar, posted Wed Jan 31, 2018 9:24 pm (32083)


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

Rewinged, posted Mon Sep 09, 2019 2:51 pm (50652)


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
  • Localization

Rewinged, posted Tue Sep 10, 2019 7:29 am (50661)


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
  • Localization

Delutto, posted Wed Sep 11, 2019 4:47 pm (50671)


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
  • Localization

Rewinged, posted Wed Sep 11, 2019 8:01 pm (50672)


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
  • Localization

Rewinged, posted Thu Sep 12, 2019 2:29 pm (50681)


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
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.