Tool How to translate visual novel .pac files

hypno128

New Member
Feb 11, 2020
9
9
I've written a tool for extracting and creating visual novel .pac files. For example, these are used in games.

The code for it is available on GitHub for anyone that wants to use or modify it.


And the exe is available here:


When it's run, it extracts all the data from the .pac file into a folder (similar to extracting a zip). This will include a number of what I'm calling .srp and .var files. From there, the files can be edited, then the program can be run again to create a new .pac file for the game. All of the files that are extracted are written in Shift-JIS encoding, so you'll need a program like Notepad++ to read them.

The .srp files are all the files for what happens in the individual scenes in the visual novel. There will be a lot of hexadecimal gibberish, which is used to determine what art is drawn, music played, etc in the scene. The rest is readable japanese text, which can be be translated and replaced in the file.

The .var files are various settings for the game. This includes things like titles, default names, screen size, etc.

It's far from perfect right now. It currently isn't extracting the text for the the different options players get when the have to make choices, and there's a fair amount of other little things to be improved. I'll probably work to improve it some when I have time.
 
Last edited:

hypno128

New Member
Feb 11, 2020
9
9
At the moment you can only run it through console commands. There are some details about it on the GitHub. The short version is:
Put the PacManager.exe file in the same folder as the .pac file.
Open a console and navigate to the folder.
run "PacManager.exe -u [.pac file]" without the brackets to open the file.
run "PacManager.exe -p [folder]" without the brackets to package all contents in the folder into a .pac.

When I have some time to work on it again I'll look into adding some drag and drop to it. I've seen people do something similar with other programs like this.
 
  • Like
Reactions: carmennnoiu

YunFD

New Member
Feb 13, 2021
3
1
At the moment you can only run it through console commands. There are some details about it on the GitHub. The short version is:
Put the PacManager.exe file in the same folder as the .pac file.
Open a console and navigate to the folder.
run "PacManager.exe -u [.pac file]" without the brackets to open the file.
run "PacManager.exe -p [folder]" without the brackets to package all contents in the folder into a .pac.

When I have some time to work on it again I'll look into adding some drag and drop to it. I've seen people do something similar with other programs like this.
Sorry, I can't find any exe file :(
 

test-mkn

New Member
Apr 25, 2021
1
0
I've been trying to use this to extract the data from a game by Lune-soft (vndb v21183), it's all in .pac files but all the files extracted are illegible.

Edit: I got the .txt for the scenes, is there a way to get the files for the menu and popup windows?
 
Last edited:

hypno128

New Member
Feb 11, 2020
9
9
I've been trying to use this to extract the data from a game by Lune-soft (vndb v21183), it's all in .pac files but all the files extracted are illegible.

Edit: I got the .txt for the scenes, is there a way to get the files for the menu and popup windows?
I don't have that specific game, so I can't look to say for certain.

Of the games I have looked at, most have an _system file in one of the .pac files where they set several variables. I've had mixed results trying to change these values so far. Sometimes it works, sometimes it doesn't.

Unfortunately, some menus do seem to use pictures rather than text, so that might be the case here too.
 

KingFisher

New Member
Dec 6, 2018
1
0
So I got the script to run and i'm looking at the script. I do have one major issue. I'm trying to fix character sprite images in lune games. I want to see the full bodies so I need to change some number locations. your extraction tool gives garbled hex data compared to reading the the .srp file files directly. Example is I'm comparing 09_11.txt and 09_11.srp. The 09_11.srp file was extracted from the srp.pac file using GarBro. However GarBro extracts a lot of mess and doesn't line the code nicely. Also GarBro doesn't have an option to use .pac format when you want to use the build in archive creation tool.

However PacManager.exe has a huge flaw showing file data as hex rather than actual file name. Even though it lines up code nicely it won't show a directory tree of files. Just the Japanese lines. The only thing nice about PacManager.exe is it's decryption and re-encryption ability when decompiling and compiling files.
Anyways this flaw is fatal to me beacause I'm needing to change sprite image size that loads in game. Lune games take full body Charcter sprites that are intially too large to view in the game area and load them via x, y and then size coordinates(or z coordinate which is most familiar notation used in 3D). At least that's what I'm hypothesizing from the fm_C04a_05_0_0_0_02/-254/0.42/0.42B. The fm_C04a_05_0_0_0_02 is reference to the character sprite that's kept in the Bgrd.pac archive. I made some more guessing and i'm thinking -254/0.42/.042B are image coordinates lined like this "sprite image size/x coordinate/y cordinate". The B after this stands for probably reference to body. as there is as file that. I'm not talking about $β because I think that's something different. The only problem with opening up .srp files in notepad++ is the fact that the file is still encrypted somewhat.

I'd like to use the .txt file but some of the important stuff is in hex and I have no desire to learn hexadecimal language system.
 

Natsume12346

New Member
Jul 7, 2021
2
0
how to use it?, I still don't understand, every time I open the exe it only opens for a while, then closes again.


I use the command prompt , and it says missing parameters
 
Last edited:

hypno128

New Member
Feb 11, 2020
9
9
how to use it?, I still don't understand, every time I open the exe it only opens for a while, then closes again.


I use the command prompt , and it says missing parameters
The command prompt is the right approach. For the parameters use "PacManager.exe -u [filename]" to unpack a pac file. All the contents will be extracted into a folder with the same name.

After you've made changes use "PacManager.exe -p [folder]" to pack it back up.
 

hypno128

New Member
Feb 11, 2020
9
9
So I got the script to run and i'm looking at the script. I do have one major issue. I'm trying to fix character sprite images in lune games. I want to see the full bodies so I need to change some number locations. your extraction tool gives garbled hex data compared to reading the the .srp file files directly. Example is I'm comparing 09_11.txt and 09_11.srp. The 09_11.srp file was extracted from the srp.pac file using GarBro. However GarBro extracts a lot of mess and doesn't line the code nicely. Also GarBro doesn't have an option to use .pac format when you want to use the build in archive creation tool.

However PacManager.exe has a huge flaw showing file data as hex rather than actual file name. Even though it lines up code nicely it won't show a directory tree of files. Just the Japanese lines. The only thing nice about PacManager.exe is it's decryption and re-encryption ability when decompiling and compiling files.
Anyways this flaw is fatal to me beacause I'm needing to change sprite image size that loads in game. Lune games take full body Charcter sprites that are intially too large to view in the game area and load them via x, y and then size coordinates(or z coordinate which is most familiar notation used in 3D). At least that's what I'm hypothesizing from the fm_C04a_05_0_0_0_02/-254/0.42/0.42B. The fm_C04a_05_0_0_0_02 is reference to the character sprite that's kept in the Bgrd.pac archive. I made some more guessing and i'm thinking -254/0.42/.042B are image coordinates lined like this "sprite image size/x coordinate/y cordinate". The B after this stands for probably reference to body. as there is as file that. I'm not talking about $β because I think that's something different. The only problem with opening up .srp files in notepad++ is the fact that the file is still encrypted somewhat.

I'd like to use the .txt file but some of the important stuff is in hex and I have no desire to learn hexadecimal language system.
Sorry it isn't working for you. My only focus was really getting the text files to sort out to be translated. Yeah, I wouldn't recommend trying to read hexadecimal.

That's actually a really interesting point you make with the x and y coordinates. I've had to guess what the a lot of the data in the file is through trial and error. You might be right on that. Most of the parts of the .srp file that are "encrypted" are just data that I couldn't figure out. In my experience changing them without knowing what they do often just resulted in errors when I tried running the game.
 

JMARENAS

New Member
Dec 31, 2020
8
1
Anyone can also guide me to repacking AOS files. GarBRO sucessfully extracts the scr files but I just can't find out how it repacks it. There is some sort of encrytion and compression going on.
 

hypno128

New Member
Feb 11, 2020
9
9
Anyone can also guide me to repacking AOS files. GarBRO sucessfully extracts the scr files but I just can't find out how it repacks it. There is some sort of encrytion and compression going on.
I can't say I know anything about the file format. If you don't have any luck, there is one thing you could try...

If GarBRO is working, and you have some coding experience, you could try looking through the GarBRO code. It's all up on Github:



Somewhere in that is the code that unpacks the AOS file, and if you can find it you can try just doing the opposite to repack the file. It can be a real pain to dig through though, since the code for reading a large number of different file formats is all all together in one project.
 

Yggdragsill

Member
Jul 18, 2019
159
68
hey hypno123 can you take a look at this tool. I wonder if this tool actually work for .srp files
EDIT: I just tested it and it can dump .srp files but it can't repack into .srp again
 
Last edited:

EraAran

New Member
May 17, 2019
7
1
Hey, I was wondering if you are able to find a way for files to be put back into the "grd" format that they are in some Lune games. I am able to extract these image files as png using GarBro, but I'm unsure as to how I could put them back into grd. Your tool extracts grd as basic files and not as png or bmp or anything else.

This is so that UI elements such as the Settings page can be translated in-game.

Edit: GarBro is also able to read a grd file. I did some testing where I extracted a grd as a png using GarBro, and then I renamed the png to "grd" using 7zip, and within GarBro it's still able to see the image properly. The problem now is that I have no way to put these images back into the right .pac
 
Last edited:

Yggdragsill

Member
Jul 18, 2019
159
68
Hey, I was wondering if you are able to find a way for files to be put back into the "grd" format that they are in some Lune games. I am able to extract these image files as png using GarBro, but I'm unsure as to how I could put them back into grd. Your tool extracts grd as basic files and not as png or bmp or anything else.

This is so that UI elements such as the Settings page can be translated in-game.

Edit: GarBro is also able to read a grd file. I did some testing where I extracted a grd as a png using GarBro, and then I renamed the png to "grd" using 7zip, and within GarBro it's still able to see the image properly. The problem now is that I have no way to put these images back into the right .pac
I have an idea which he makes his tool separate the function extract/repack .pac and export/import other files
 

hypno128

New Member
Feb 11, 2020
9
9
Hey, I was wondering if you are able to find a way for files to be put back into the "grd" format that they are in some Lune games. I am able to extract these image files as png using GarBro, but I'm unsure as to how I could put them back into grd. Your tool extracts grd as basic files and not as png or bmp or anything else.

This is so that UI elements such as the Settings page can be translated in-game.

Edit: GarBro is also able to read a grd file. I did some testing where I extracted a grd as a png using GarBro, and then I renamed the png to "grd" using 7zip, and within GarBro it's still able to see the image properly. The problem now is that I have no way to put these images back into the right .pac
I haven't had a chance to get back into looking at this project in the past several months.

I can't say I did anything with the grd files (I'm not actually familiar with the file format). When the extractor sees files it doesn't recognize, it just leaves them as is, so they can be repackaged later and hopefully not cause any bugs.

If life slows down and I have some time I might take a look at it. No idea when that will be though.
 

EraAran

New Member
May 17, 2019
7
1
I haven't had a chance to get back into looking at this project in the past several months.

I can't say I did anything with the grd files (I'm not actually familiar with the file format). When the extractor sees files it doesn't recognize, it just leaves them as is, so they can be repackaged later and hopefully not cause any bugs.

If life slows down and I have some time I might take a look at it. No idea when that will be though.
Thanks, I would greatly appreciate it if GRD files would be able to be extracted as PNG/BMP and then be able to be repackaged back into GRD. Take your time.