satan53x / SExtractor

从GalGame脚本提取和导入文本
GNU General Public License v3.0
239 stars 15 forks source link

Nexas support #120

Closed Cosetto closed 4 days ago

Cosetto commented 6 days ago

This issue is somewhat related to issue #117 I found this script disassemble/assemble codes, which supports the Switch version's script format (binu8/utf8). I tried modifying Script_disassembler.py to handle PC's script.

I changed line 175 to cp932 but encounters this

D:\s>scr a
00共通01
437
String size check failed! Expected: 2412088575, got 13
Offset: 0x1f8ec
奄ノ戻りました

If I delete lines 220–224, it somewhat works, but the script ends up being truncated, as shown in this image: image For reference, here’s how it looks like binu8 format image You can also see how the names are parsed in the asm file. So, is it possible to modify the codes to support pc script format? I'll attach the scripts here scr.zip

satan53x commented 5 days ago

Script_assembler_re.zip Edit to support cp932, the Pc_script dir above can be disassembled/assembled, and bytes not changed. The dat file replaces the functionality of the patcher script.

Need to download vips-dev dll to support assembler:

os.environ['PATH'] = 'vips-dev-8.16/bin' + ';' + os.environ['PATH']
satan53x commented 5 days ago

But some other game's bins cannot be disassembled, print error Some string were not pulled. It seems that some strings are not called. Not sure if some key code in the command area do not support when parse, or the string is indeed not used.

Here's the test game pac マテリアルブレイブ イグニッション Script.zip

Cosetto commented 5 days ago

@satan53x Thanks again.

As for the script you gave me. It seems like the disassembler can't handle split messages. You can just comment the sys.exit to ignore the error, so far there're only 4 files(only 2 are scripts) have that error

Cosetto commented 5 days ago

Btw, can you also add regex support in SExtractor for the asm files?

Cosetto commented 4 days ago

I managed to handle the asm files. Thanks anyway

satan53x commented 4 days ago

Added. Because some games cannot convert parameter values ​​to parameter names such as PUSH_MESSAGE. So I finally checked the previous and next lines of name to determine whether it is a name. And the default regex is for processing Japanese original text. If it is English original text, may need to delete 15_search. Not tested.

satan53x commented 4 days ago

But some other game's bins cannot be disassembled, print error Some string were not pulled. It seems that some strings are not called. Not sure if some key code in the command area do not support when parse, or the string is indeed not used.

Some games has unassociated strings, but they cannot be abandoned, so I use the json to keep them. No json file will be output if there is no unassociated string. tools/Nexas