Jump to content

Finding UI elements in a Kirikiri game


Recommended Posts

I've recently started translating a visual novel from dlsite. I was able to identify that it was Kirikiri game based on the Xp3 archive files in the folder. Using translator++, I was able to parse and translate the scenario files. With GARbro, I extracted the ui elements and images from all the xp3 files that I could find in pimg, tlg, png, and jpg format. I modified them and was able to repack all that into a patch which works perfectly.

However, there are still parts of UI elements that I can't find in the xp3 files or least not in any of the formats I know. For example, this settings menu:

sdfsf.png

The background, frame, lines and bars are all images that I can see. However, the Japanese text itself is not in any ks files nor any images. I'm guessing that the text has be in some tjs compiled tjs files, but I'm unsure how I would go about de compiling them.

I have also found no psb files with GARbro

Link to comment
Share on other sites

10 minutes ago, Zakamutt said:

Try to text search the ks and tjs scripts for the words in question. though I guess if they're obfuscated or encrypted I can't help... idk

Oh, I didn't realize that tjs files are supposed to be readable normally. I guess they've been encrypted. That's annoying.

Link to comment
Share on other sites

On 9/19/2024 at 4:41 AM, Nakkubu said:

Oh, I didn't realize that tjs files are supposed to be readable normally. I guess they've been encrypted. That's annoying.

They are not encrypted. They are just in byte code. This documentation explains it. https://krkrz.github.io/documents/core/anti_cracking.html

バイトコード化


TJS2スクリプトがそのままの状態で格納されていると解析が容易なので、スクリプトをバイトコード化する。
バイトコード化はScripts.compileStorageによって可能。
アーカイブが暗号化されていても、そこを突破されることはあるので、スクリプトの解析を困難にしておく意味はある。
また、バイトコードの方がスクリプトよりも高速に読み込める(スクリプトのコンパイルが事前に行われているので)。
Byte-code
Since it is easy to analyze the TJS2 script when it is stored as it is, the script is bytecoded.
Bytecoding is possible with Scripts.compileStorage.
Even if the archive is encrypted, it can still be breached, so it makes sense to make it difficult to parse the script.
Also, bytecode can be loaded faster than scripts (since the scripts are pre-compiled).

TJS2 scripts are scripts meaning they need to be fed into an interpreter before being compiled into native machine code. Some implementations of languages use bytecode as an intermediary before eventually turning that bytecode into machine code at runtime. Think of it like having to be compiled twice.

.tjs + Scripts.compileStorage = byte-code. byte-code + .tjs interpreter => machine code.

All of that together makes it  very unlikely there is any encryption going on with the tjs2 scripts files.

For translation, the important part is that tjs2 in byte code format cannot get rid of the original strings that we need to translate because it still needs them to display them eventually, like the game's title. Therefore, it should still be possible to extract and translate them if you can decipher the tjs2 byte code intermediary language or find a program that can work with tjs2 byte code.

Link to comment
Share on other sites

  • 3 weeks later...

Update! I found a program that can work with tjs2 bytecode by marcussacana called https://github.com/marcussacana/SacanaWrapper . The actual program is a .dll in one of their Github repositories which SacandaWrapper uses meaning that SacandaWrapper is just a proxy for that .dll. The SacanaWrapper releases page has a tool, StringTool.exe, that works like this.

>StringTool.exe --help
	Usage:
StringTool -Dump {InputScript} [OutputText]
StringTool -Insert {InputScript} [InputText] [OutputScript]
StringTool -Wordwrap {InputScript} [InputText] [OutputScript]

So like...
 

tools\SacanaWrapper_2.1.5\tjs>StringTool.exe -Dump initialize.tjs initialize.tjs.txt
tools\SacanaWrapper_2.1.5\tjs>StringTool.exe -Insert initialize.tjs initialize.tjs.txt output\initialize.tjs

Dependencies
- The tool itself requires .Net Console Runtime 8.0+ and Windows. I tested it with runtime 8.0.8 and Windows x64.
- It is probably better to download the release from Github and update the plugins yourself ...probably, but here is an offline version that has all the plugins already.

Name:     SacanaWrapper_2.1.5_with_plugins.7z
Size:     8413407 bytes (8.02 MiB)
CRC32:    28FB26AB
CRC64:    807872665305C687
MD5:      192cabadbfec2861ba8269e33fe3158f
SHA1:     cd7af8123de94394cd7805cf750cb886927af58c
Edited by Entai2965
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...