Jump to content

Extracting text from .bin files


Recommended Posts

So I and a couple of friends are thinking in translate 7scarlet to our mother language (Spanish) and need a little help extracting the text files.
The files are in .bin format but encrypting, Garbro didn't work so we don't know what to do (we have already checked the data extraction tread, but nothing there work).
These are the files we think that contain the scrip and the UI text (we are not sure):

https://www.mediafire.com/file/14loyp4f8be53sc/ext2.bin/file (Text?)

https://www.mediafire.com/file/w0lk1pdm0lonx4e/texts.bin/file (Text?)

https://www.mediafire.com/file/irlzuvofqplklre/ui.bin/file (UI)


If anyone can help and tell us how to extract (and maybe insert again) them, we'll be very grateful.
Thanks for your attention ;)

 

Link to comment
Share on other sites

Okay, I looked into the files and could not find any extractors so I decided to write them myself.

Here is the GitHub repo I created: https://github.com/Anonym271/7scarlet-tools
And the binares: x86 | x64

For now, it only extracts the files (and I haven't tested it much for now), but I will continue investigating them to understand the different file formats. I will keep you updated as soon as I got something new working.

Have fun for now!

Link to comment
Share on other sites

New version is out.

First of all, the old one didn't extract correctly because I was stupid (didn't open the output file stream in binary mode). This is fixed now.
Second: you can now repack archives (without compression though) and the game seems to accept them so far. Tell me if you encounter any strange behaviour.

You can find the new version again in the repo (also with binary releases).

Next I'm trying to convert the .tbg files to PNGs. Back-conversion might not even be necessary as the game seems to accept PNGs, too - as far as I could see for now.

Edit:
Back-conversion is necessary but I made a simple TGB/PNG converter, you can download it here (source is also in the repo). You can just drag and drop png/tgb file(s) on it to convert them vice versa. It's rather slow and crappy coded and I am going to improve it, but I guess you can already do much with these two tools.

Scripts will be a bit tricky though since they seem to be compiled in some way.

Edited by Anonym271
Updated link for image tool
Link to comment
Share on other sites

4 hours ago, Anonym271 said:

New version is out.

First of all, the old one didn't extract correctly because I was stupid (didn't open the output file stream in binary mode). This is fixed now.
Second: you can now repack archives (without compression though) and the game seems to accept them so far. Tell me if you encounter any strange behaviour.

You can find the new version again in the repo (also with binary releases).

Next I'm trying to convert the .tbg files to PNGs. Back-conversion might not even be necessary as the game seems to accept PNGs, too - as far as I could see for now.

Seriously thank you so much for doing this! Just one thing, could you tell me how to use it correctly? (I don't know much about C++)

Link to comment
Share on other sites

Okay, sure. You don't need to know anything about C++, that's why I deliver the binaries. They are regular .exe files, you can just download and execute them.

They are command line tools, so you need to use them in the command line (no shit). I suppose you are using Windows, so here is a short introduction:

The easiest option to open the command line at a desired location is probably the following: open the file explorer, navigate into the folder where the .exe file (and the target .bin files) are located and then just type "cmd.exe" in the address field. This will open you a command prompt at the current folder. Then you are ready to use the tools. Command line tools always work in the following manner: enter the name of the executable (e.g. "7scarlet_win64.exe") and after that the options you want to give to the program (separated by spaces). Options are usually indicated by a minus and then the name / character that describes the option. If an option requires additional information (e.g. a file name) these are submitted right after that (again, space separated). The both tools I have created so far have the following usage manners:

The archive tool:

Has options to pack (`-p`) and extract (`-e`) archives so far. So extracting an archive would look like this:

7scarlet_win64.exe -e my_archive.bin my\extraction\folder

The first option "-e" tells the program that you want to extract something, then the archive you want to extract ("my_archive.bin") and finally the folder you want it to be extracted to. If you omit the destination folder it will just create a folder named like your input archive ("my_archive" in this case).

Repacking works in the same manner:

7scarlet_win64.exe -p my_folder dest_archive.bin

This will pack all contents of the directory "my_folder" into the archive "dest_archive.bin"

Additionally: if you don't specify a mode (extraction or repacking) the program will choose extraction. So if you input just one argument (e.g. "7scarlet_win64.exe my_archive.bin") without any additional information it will extract the specified archive to the respective folder.

The image tool:

The image tool works very simple. Every argument you give it will be treated as a file input and it will convert each file into the other format (png to tbg and vice versa). So converting some tgb images into png would look like:

tbg.exe image1.tbg image2.tbg image3.tbg

Drag and Drop:

If you just drag and drop files on an program, Windows will start this program with the files as arguments. So dropping the three image files above on the "tbg.exe" executable will internally produce exactly this command. This means:

  • You can drop a .bin archive onto the extractor executable to extract it to a folder named like the archive file
  • You can drop as many png / tbg image files onto the image tool's .exe to convert them between the two image formats.

One last tip: most command line tools display a help or usage message if you start them without arguments (or often with the argument "-h" for help). This message usually describes how the program should be used. But keep in mind that the also just print it to the command line, so you have to execute them in an open command line. If you just double click a command line tool you will only see the command prompt popping up for half a second and closing again before you can read the text.

Link to comment
Share on other sites

13 hours ago, Anonym271 said:

Okay, sure. You don't need to know anything about C++, that's why I deliver the binaries. They are regular .exe files, you can just download and execute them.

They are command line tools, so you need to use them in the command line (no shit). I suppose you are using Windows, so here is a short introduction:

The easiest option to open the command line at a desired location is probably the following: open the file explorer, navigate into the folder where the .exe file (and the target .bin files) are located and then just type "cmd.exe" in the address field. This will open you a command prompt at the current folder. Then you are ready to use the tools. Command line tools always work in the following manner: enter the name of the executable (e.g. "7scarlet_win64.exe") and after that the options you want to give to the program (separated by spaces). Options are usually indicated by a minus and then the name / character that describes the option. If an option requires additional information (e.g. a file name) these are submitted right after that (again, space separated). The both tools I have created so far have the following usage manners:

The archive tool:

Has options to pack (`-p`) and extract (`-e`) archives so far. So extracting an archive would look like this:


7scarlet_win64.exe -e my_archive.bin my\extraction\folder

The first option "-e" tells the program that you want to extract something, then the archive you want to extract ("my_archive.bin") and finally the folder you want it to be extracted to. If you omit the destination folder it will just create a folder named like your input archive ("my_archive" in this case).

Repacking works in the same manner:


7scarlet_win64.exe -p my_folder dest_archive.bin

This will pack all contents of the directory "my_folder" into the archive "dest_archive.bin"

Additionally: if you don't specify a mode (extraction or repacking) the program will choose extraction. So if you input just one argument (e.g. "7scarlet_win64.exe my_archive.bin") without any additional information it will extract the specified archive to the respective folder.

The image tool:

The image tool works very simple. Every argument you give it will be treated as a file input and it will convert each file into the other format (png to tbg and vice versa). So converting some tgb images into png would look like:


tbg.exe image1.tbg image2.tbg image3.tbg

Drag and Drop:

If you just drag and drop files on an program, Windows will start this program with the files as arguments. So dropping the three image files above on the "tbg.exe" executable will internally produce exactly this command. This means:

  • You can drop a .bin archive onto the extractor executable to extract it to a folder named like the archive file
  • You can drop as many png / tbg image files onto the image tool's .exe to convert them between the two image formats.

One last tip: most command line tools display a help or usage message if you start them without arguments (or often with the argument "-h" for help). This message usually describes how the program should be used. But keep in mind that the also just print it to the command line, so you have to execute them in an open command line. If you just double click a command line tool you will only see the command prompt popping up for half a second and closing again before you can read the text.

Thank you! thank you! thank you! It works perfectly, thank you so much!
You really help us, thanks for your work!

Link to comment
Share on other sites

Just a quick update: you might have noticed that there are some ".tbx" files in the archives. These are just simple "bundles" of TBG images and the tbg tool now supports extracting them. Repacking will follow today.

From now on you can just always find the newest binary releases under the release section of the repository ("farc" is the archive tool, "tbg" the one for tbg + tbx). I will post a note here everytime something important changes, though.

I hope to make progress with the scripts today, too, but I can't promise anything.

Link to comment
Share on other sites

Repacking works now but I have one problem: Kaspersky is convinced that I have developed super-malicious ransomware and to be honest: looking at this crappy code it probably cannot imagine that a person wrote this with something good in mind :D

Anyway, I am not going to publish a binary release as long as the code is "malicious"...

Link to comment
Share on other sites

20 minutes ago, Anonym271 said:

Repacking works now but I have one problem: Kaspersky is convinced that I have developed super-malicious ransomware and to be honest: looking at this crappy code it probably cannot imagine that a person wrote this with something good in mind :D

Anyway, I am not going to publish a binary release as long as the code is "malicious"...

Hehe I don't know much about programming, so I think it's great that you have been able to develop something like that even though it's not complete yet, but don't worry and take your time 😉

Anyway thanks for worrying about security :D

Link to comment
Share on other sites

3 minutes ago, Cibermoon said:

Hehe I don't know much about programming, so I think it's great that you have been able to develop something like that even though it's not complete yet, but don't worry and take your time 😉

Anyway thanks for worrying about security :D

Well, to be honest:  this is less about security (I know that I did not code a virus) than about my coding honor :D

Link to comment
Share on other sites

I decided that the TBX archives are better to manage using a GUI so I created a TBX Editor using .NET Framework. You can download it here (it should be running natively. If not, tell me!). It should be relatively self explanatory:

  • Use "Open" to open a TBX file
  • Use "Save" to save it
  • Use "New" to clear the window
  • Use "Import" / "Export" to add / remove images
  • Use "Move Up" / "Move Down" to move the images in the archive (the order matters!)
  • You can also drag images into the image list on the left to import them / drag them out into your explorer to export them.

The tool for the scripts will probably also be a GUI tool since this would mean that I don't have to write a complete script compiler. This also means that you would have to edit the scripts directly in the program (or at least copy them into it after translating). Maybe I decide otherwise when it comes to it, but that just as information :)

Link to comment
Share on other sites

Finally: first version of a tool that lets you edit the scripts. As always, you can find the release here. It is designed to doing a little bit more than just editing dialog texts in the future (maybe...), but for now the thing you want to do is:

  • Open the .scn file you want to edit (they contain the texts and are stored under dat/<your-language>/ui/scn/)
  • Click on "Dialogs" > "Export..." to export them into a JSON file.
  • Edit them to you desire
  • Open the same .scn file in the SceneEditor again (if you closed it meanwhile)
  • Click "Dialogs" > "Import" and select your edited JSON file
  • Click "File" > "Save" (or "Save as")

In theory, you could also edit the texts directly in the program (I recommend to enable "View" > "Hide Unknown Instructions" for this), but I guess having everything in one text file might be a little bit more comfortable.

When you edit the JSONs you should remember to escape your quotation marks (") with a backslash (\") so that they don't destroy the JSON document. And of course: make backups of everything before overwriting the game files, stuff might not work correctly :D

If you encounter any problems or find dialog parts that are not present in the exported files (some of them might be using different instructions that I didn't see yet), just tell me and I will try to fix it.

Also, tell me if the JSON format is too uncomfortable to edit. It was just the easiest to export and import for me, so I chose this format.

Link to comment
Share on other sites

On 4/30/2021 at 8:25 PM, Anonym271 said:

Finally: first version of a tool that lets you edit the scripts. As always, you can find the release here. It is designed to doing a little bit more than just editing dialog texts in the future (maybe...), but for now the thing you want to do is:

  • Open the .scn file you want to edit (they contain the texts and are stored under dat/<your-language>/ui/scn/)
  • Click on "Dialogs" > "Export..." to export them into a JSON file.
  • Edit them to you desire
  • Open the same .scn file in the SceneEditor again (if you closed it meanwhile)
  • Click "Dialogs" > "Import" and select your edited JSON file
  • Click "File" > "Save" (or "Save as")

In theory, you could also edit the texts directly in the program (I recommend to enable "View" > "Hide Unknown Instructions" for this), but I guess having everything in one text file might be a little bit more comfortable.

When you edit the JSONs you should remember to escape your quotation marks (") with a backslash (\") so that they don't destroy the JSON document. And of course: make backups of everything before overwriting the game files, stuff might not work correctly :D

If you encounter any problems or find dialog parts that are not present in the exported files (some of them might be using different instructions that I didn't see yet), just tell me and I will try to fix it.

Also, tell me if the JSON format is too uncomfortable to edit. It was just the easiest to export and import for me, so I chose this format.

Sorry for not reply soon! The tool works great and we were able to get most of the dialogues and tips. Seriously, Thank you so much!

PS: The JSON format is fine and it is very easy for us to edit, thank you for choosing it!

Edited by Cibermoon
Link to comment
Share on other sites

  • 4 weeks later...
On 4/30/2021 at 6:25 PM, Anonym271 said:

Finally: first version of a tool that lets you edit the scripts. As always, you can find the release here. It is designed to doing a little bit more than just editing dialog texts in the future (maybe...), but for now the thing you want to do is:

  • Open the .scn file you want to edit (they contain the texts and are stored under dat/<your-language>/ui/scn/)
  • Click on "Dialogs" > "Export..." to export them into a JSON file.
  • Edit them to you desire
  • Open the same .scn file in the SceneEditor again (if you closed it meanwhile)
  • Click "Dialogs" > "Import" and select your edited JSON file
  • Click "File" > "Save" (or "Save as")

In theory, you could also edit the texts directly in the program (I recommend to enable "View" > "Hide Unknown Instructions" for this), but I guess having everything in one text file might be a little bit more comfortable.

When you edit the JSONs you should remember to escape your quotation marks (") with a backslash (\") so that they don't destroy the JSON document. And of course: make backups of everything before overwriting the game files, stuff might not work correctly :D

If you encounter any problems or find dialog parts that are not present in the exported files (some of them might be using different instructions that I didn't see yet), just tell me and I will try to fix it.

Also, tell me if the JSON format is too uncomfortable to edit. It was just the easiest to export and import for me, so I chose this format.

Question: I came across these tools when trying to do another translation for 7’scarlet and I’m having trouble with the dialogue editor. It won’t let me open/edit hino.scn for some reason? And the other dialogue scenario files don’t seem to recognize the... dialogue? Like, it says they’re just binary instruction files instead of dialogue text. Pretty difficult to decode any of it since the binary instruction won’t export :( Any help would be appreciated!

Also: would using the extraction binaries allow for sound file extraction? I tried it initially and every single .ogg got corrupted and impossible to open (then again, there was like 10 thousand files so no shocker but. Yeah lol). 

Link to comment
Share on other sites

12 hours ago, willow1sp said:

Question: I came across these tools when trying to do another translation for 7’scarlet and I’m having trouble with the dialogue editor. It won’t let me open/edit hino.scn for some reason? And the other dialogue scenario files don’t seem to recognize the... dialogue? Like, it says they’re just binary instruction files instead of dialogue text. Pretty difficult to decode any of it since the binary instruction won’t export :( Any help would be appreciated!

Also: would using the extraction binaries allow for sound file extraction? I tried it initially and every single .ogg got corrupted and impossible to open (then again, there was like 10 thousand files so no shocker but. Yeah lol). 

Hi, thank you for the feedback. I tried a little bit around and indeed the tool fails to open the Japanese (original) files. If you own the steam version you might just use the english archive files (found in dat/eng/...) for now as they should work; but I will nevertheless try to support the original archives, too.

Edit: the sound archives do work for me - could it be that you are not using the steam version or something? @Cibermoon Do the sound archives work for you? And yes, there actually are more than 10,000 voice files in the voice.bin file :D

Edited by Anonym271
Link to comment
Share on other sites

Okay, after Discord contact with @willow1sp we found out that they just used an old version of the extractor. So if anyone else wants to use the tools, here a summary on how to find the correct versions of the correct tools:

  • To extract and repack the .bin files use "farc_win64" (or win32 in case you use a 32 bit system)
  • To convert .tbg images use "tbg_win64" (or win32)
  • To modify .tbx files use "TbxEditor"
  • To edit .scn files (Dialogue Texts) use "SceneEditor"

You can find them here in the different releases, always under "Assets". Just always use the most recent version that occurs.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...