satan53x / SExtractor

从GalGame脚本提取和导入文本(大部分需要明文)
GNU General Public License v3.0
210 stars 14 forks source link

Failed to extract Artemis's script #3

Closed Cosetto closed 1 year ago

Cosetto commented 1 year ago

The tool stops at 01_共通07.ast script.zip

satan53x commented 1 year ago

It used to check items and exclude those with only a name and no message. I just made a change. Now it only print warnings instead of throwing exceptions.

Cosetto commented 1 year ago

Is it possible to break the .ast script into new line via SExtrator? image image And clearing the unused line image image

satan53x commented 1 year ago

Most engines do not support adding or removing lines because the design is based on replacement. Extra lines are discarded, and missing lines are filled with spaces.

TXT mode reads text line by line, while BIN mode allows for handling across lines. If you want to add or remove lines, you'll need to use BIN mode and write regular expressions to process them yourself. There are no preset options for that.

Because Japanese to Chinese translation typically does not involve adding lines, in order to preserve the original structure, it's usually done through replacement rather than adding or removing lines.

satan53x commented 1 year ago

Is it possible to break the .ast script into new line via SExtrator?

1 Indeed, it's possible to add line breaks, but it's not an automatic process. You can add line breaks in the translation by inserting \",\n{\"rt2\"},\n\" into the text, and this will create line breaks in the output.

2 Perhaps you can make it an automated operation by modifying helper_text.py. You could concatenate translations by the string mentioned above to the listMsgTrans[lenOrig-1] for the part where len(listMsgTrans) exceeds len(listMsgOrig).

Cosetto commented 1 year ago

Thank you again.

Cosetto commented 1 year ago

EAGLS.zip @satan53x Tool for EAGLS if you need

Cosetto commented 10 months ago

@satan53x Unity's script tool Guide: video The hardest step is finding where's the script, but should be able to find it with "MonoBehavior" filter You can export the script to .csv, and use Emeditor or Libre Office to edit it Uabea here If the tool tells you "File size limit", increase the FileSize like this image

satan53x commented 10 months ago

Unity's script tool

@Cosetto Thx bro. By the way, can the sentences be filtered before exporting to CSV, or are all the sentences exported and then filtered separately?

Cosetto commented 10 months ago

@Cosetto Thx bro. By the way, can the sentences be filtered before exporting to CSV, or are all the sentences exported and then filtered separately?

image This one I think, I'm not sure how this works though.

You can export csv out and filter the text separately, as long as you don't mess up the script format.

Cosetto commented 10 months ago

If you choose to export to csv, hit "csv" when you need to import back. And you don't need the original .dat script image I also have UnityEx 2021 version here if you need UnityEX.zip

Cosetto commented 9 months ago

@satan53x Kuro Ai here is Kuro Ai from Clockup right? If yes, I have the unpack/pack tools here. The engine is called Pix studio PIX.zip

satan53x commented 9 months ago

@satan53x Kuro Ai here is Kuro Ai from Clockup right? If yes, I have the unpack/pack tools here. The engine is called Pix studio PIX.zip

Thx, it's effective. So, maybe all the games from Pix studio used the same key.

Cosetto commented 9 months ago

I haven't tested pack tool yet, but the engine itself read from "data" folder right?

So, maybe all the games from Pix studio used the same key.

I think so, the unpack also worked with this

satan53x commented 9 months ago

Yes, it will prioritize reading from the bin file; deleting the bin file will allow it to read from the data folder. However, the name of data folder is configured in the pix.xml file. In this game:

<datafolder>KuroaiHD_dl</datafolder>

Maybe the default name is data if there's no config.

Cosetto commented 8 months ago

@satan53x The command to pack AST with arc_conv: arc_conv.exe --pack arc12 <1 or 2>

Cosetto commented 8 months ago

@satan53x maybe this can help with malie packer https://github.com/Dir-A/MalieTools/blob/main/MalieTools/Modules/MalieTools/MalieDecryption_Key.h

satan53x commented 8 months ago

@satan53x maybe this can help with malie packer https://github.com/Dir-A/MalieTools/blob/main/MalieTools/Modules/MalieTools/MalieDecryption_Key.h

Thanks, bro. I'm aware of this, and it's similar to garbro. They all involve only unpacking without alignment padding in the generation process. For now, the only option is to temporarily fill with '00'. (Perhaps the padding doesn't affect the operation)

My 'pack.py' is for packing data.dat,not exec.dat

Cosetto commented 8 months ago

Bro, how can I pack the games that has "Key" only? image It keeps throwing this error image

satan53x commented 8 months ago

Yes, you can set ExpectHeader to the first 4 bytes of you orignal archive, it will try to find the right key just like Garbro. GameType is not the key, it's the game's name in the database_malie.json .

satan53x commented 8 months ago

Oh, I see. If your game only has 'Key' in database that means it's the cameliia encryption, now the script is not supported. Maybe I will add it lator. Malie has encryption cfi and cameliia, so the script's name is cfi_pack

satan53x commented 8 months ago

@Cosetto I added the cameliia encryption. But didn't test the padding that will effect the other bytes of 0x10 block in cameliia.
Certainly, this is just a possibility. There is no impact if the game doesn't check the padding.

satan53x commented 8 months ago

Btw, because cameliia encryption will effect the other bytes of 0x10 block. The ExpectHeader is not the initial 4 bytes anymore, and it's now the 0x10~0x17 bytes because of the plaintext is all 00 in these position.

Cosetto commented 8 months ago

Edit: nvm, I got it now

Cosetto commented 8 months ago

Okay, so it doesn't work. data6.dat is the new created archive image GARbro can't recognize the .svg file anymore, it returns blank file. Exec.dat can't be extracted too. image image

satan53x commented 8 months ago

Can you upload this original archive? Just need a small one.

Cosetto commented 8 months ago

Here https://drive.google.com/file/d/1kRvS8PsS0DDv1_Thg2YbwblFAH5oLyw9/view?usp=sharing It's the smallest one

satan53x commented 8 months ago

I find the problem, it's not the encryption error. I didn't dump the DataAlign from garbro to database, and the games may have diffrent align.

satan53x commented 8 months ago

You can update , I change it with the temporary alignment adjustment. I will dump the database again later and add Align.

Cosetto commented 8 months ago

Thanks, it works now

satan53x commented 8 months ago

Database updated.

Cosetto commented 8 months ago

Btw, if the Cli_encryption's Key is the same, then these should be the RotateKeys for missing games link We just need to convert from Hexadecimal to Decimal to match your database_malie.json Align could be same too

satan53x commented 8 months ago

Yes, actually the Key of cfi games from garbro seems to be all the same. Only need RotateKeys: four int32 integers.

Json only allow decimal integers, maybe I should transform the json to py for allowing hex?

Cosetto commented 8 months ago

Works, Silverio Ragnarok image

  "Silverio Ragnarok": {
    "Key": "pKemoaCjoqyvrqmoq6q0t7axsLOyvL++ubi7uqGpsbk=",
    "RotateKey": [
      1886727479,
      1246915416,
      2017543546,
      1732338005
    ],
    "Align": 1024
  },

Btw, can you add them to GARbro's database?

satan53x commented 8 months ago

I don't know how to add to garbro's formarts file. I dump it by breakpoint debugging.

Cosetto commented 8 months ago

I see. Anyway, here's the conversed key:

  "Silverio Trinity -Beyond the Horizon-": {
    "Key": "pKemoaCjoqyvrqmoq6q0t7axsLOyvL++ubi7uqGpsbk=",
    "RotateKey": [
      925709928,
      862675508,
      1714775595,
      2020751465
    ],
    "Align": 1024
  },
  "Silverio Vendetta -Verse of Orpheus-": {
    "Key": "pKemoaCjoqyvrqmoq6q0t7axsLOyvL++ubi7uqGpsbk=",
    "RotateKey": [
      1648782659,
      724859493,
      1950704249,
      1833335407
    ],
    "Align": 1024
  },
  "Silverio Ragnarok": {
    "Key": "pKemoaCjoqyvrqmoq6q0t7axsLOyvL++ubi7uqGpsbk=",
    "RotateKey": [
      1886727479,
      1246915416,
      2017543546,
      1732338005
    ],
    "Align": 1024
  },
satan53x commented 8 months ago

I find Garbro has SchemeTool project, I try to add them to Formats file. Doesn't test, you can try it. Formats.zip

Cosetto commented 8 months ago

Btw, can you tell how did Dir-A find the RotateKeys in this post There's a game I wanna add the keys

satan53x commented 8 months ago

I just used the key without trying to find it, not very sure. What's your game's name?

Cosetto commented 8 months ago

Nvm, I found it by blindly follow "cmp edx, 10" instruction It is for the English version of this game. I just pulled request. Can you add it to GARbro too?

satan53x commented 8 months ago

Formats.zip release And I update the code of SchemeTool project in garbro solution.

{
    uint[] rot_key = { 0x3C787768, 0x466E2D69, 0x35726440, 0x612B6743 };
    var crypt = new GameRes.Formats.Malie.LibCfiScheme(0x400, key, rot_key);
    string name = "Dies irae Interview with Kaziklu Bey [ENG]";
    if (!scheme.KnownSchemes.ContainsKey(name)) scheme.KnownSchemes.Add(name, crypt);
}

Only need to rebuild the SchemeTool project and run, it will output file to bin\Debug\GameData.

satan53x commented 8 months ago

Wait, I write the wrong Align... Fixed.

Cosetto commented 6 months ago

@satan53x You can add https://www.bilibili.com/read/cv27648507/ to regular expression list. The engine is RPM. The code to find the key is in the post. And to repack: arc_conv --pack ciel msg msg.arc {0|1|2|3|4|5} (key), eg: arc_conv --pack ciel msg msg.arc 4 faulta Game in example: link

Cosetto commented 4 months ago

Seen.zip Bro can find the xor key of this game? I can't find any truncated line to perform xor. image @satan53x

satan53x commented 4 months ago

I don’t have the text displayed in the game, so only tried similar bytes comparisons. Maybe the key is:

67 1C 21 BE 6F EF B5 16 4A 82 39 2B AD 3A 71 3F
satan53x commented 4 months ago

Actually, if no text is found in the encrypted area, there is no need to perform secondary encryption and decryption. Extract/Import can proceed normally without seen_fix.py.

Cosetto commented 4 months ago

67 1C 21 BE 6F EF B5 16 4A 82 39 2B AD 3A 71 3F

Thanks bro, seems like it's also Kud Wafter's key

satan53x commented 4 months ago

Thanks bro, seems like it's also Kud Wafter's key

Is it the case that VNT cannot be extracted without performing a secondary decryption? And what's the name of the first game?

Cosetto commented 4 months ago

And what's the name of the first game?

https://vndb.org/v3079

Is it the case that VNT cannot be extracted without performing a secondary decryption?

I'm using text_conv because VNT might not work. Also, the names mess up, maybe because of this: image image From what I see, Kud Wafter is the same type as these, so rldev might work better.

Cosetto commented 4 months ago

I had it worked for Oni-uta and Kud Wafter with rldev compiler. Too bad rldev is outdated for Hadashi's games image image For Chinese, I think you should append "-e cp936" to the command line. Also, you can use "\n" for line breaker with this.

Cosetto commented 3 months ago

@satan53x Bro, do you know how to fix the error in this tool when using pack_resource: image pack_script is fine though.