这个解包和打包工具是用quickbms的脚本写的,需要把quickbms.exe放在同一个目录里才能运行。
9 `5 g4 c I& q I6 O解包器还需要一个english.bin文件,打包器需要string.txt文件。
8 a; F( B5 }8 S# a3 J打包器会把string.txt的每条字幕的第3行打包回去。
- Z- q0 Y& [- i1 D执行test_export.bat生成的string.txt的每条字幕的第3行和原文一样,略作修改即可测试。
2 l, s7 p ~5 L) |执行export.bat生成的string.txt的每条字幕的第3行是个空行,正式翻译的时候使用。
, |1 Z' ^* h- C/ x: [7 a0 G1 K" ]下载见附件
1 Q( e D% G) P t/ M) r7 U5 H
) R$ S6 l! C9 F7 l/ L" f% m& Y @解包器 -
- goto -1
- SavePos OFFSET_TAIL
- goto 4
- append
- set MEMORY_FILE binary "\xff\xfe"
- set MEMORY_FILE2 binary "\x0d\x00\x0a\x00"
- set CNT LONG 0
- log test_string.txt 0 2 MEMORY_FILE
- Do
- SavePos OFFSET
- Math OFFSET += 4
- get SIZE long
- Math SIZE *= 2
- log test_string.txt OFFSET SIZE
- log test_string.txt 0 2 MEMORY_FILE2
- if CNT == 1 then
- log test_string.txt OFFSET SIZE
- log test_string.txt 0 2 MEMORY_FILE2
- log test_string.txt 0 2 MEMORY_FILE2
- set CNT LONG 0
- else
- set CNT LONG 1
- endif
- Math OFFSET += SIZE
- goto OFFSET
- While OFFSET < OFFSET_TAIL
复制代码
8 g, M/ W, d) E- N- Z; h
, E( b2 G" i3 Y& Z9 O打包器 -
- goto -1
- SavePos OFFSET_TAIL
- goto 2
- SavePos OFFSET_SUB_START
- Open "." chinese.bin 1
- Open "." string.txt 2
- Open "." TMP_OFFSET 3
- Open "." TMP_ID 4
- Set CNT long 0
- Set IDX_OFFSET long 0
- Set ID String "bcol"
- append
- # Write Magic Number
- Put ID String 4
- LOG chinese.bin 0 4 4
- Do
- FindLoc OFFSET_SUB_END STRING "\r\0"
- Math SUB_SIZE = OFFSET_SUB_END
- Math SUB_SIZE -= OFFSET_SUB_START
- Math SUB_SIZE /= 2
- if SUB_SIZE > 0 then
- Math SUB_SIZE2 = SUB_SIZE
- Math SUB_SIZE2 *= 2
- if CNT == 0 then
- Put SUB_SIZE LONG 3
- LOG chinese.bin IDX_OFFSET 4 3
- Math IDX_OFFSET += 4
- LOG chinese.bin OFFSET_SUB_START SUB_SIZE2 2
- endif
- if CNT == 2 then
- Put SUB_SIZE LONG 3
- LOG chinese.bin IDX_OFFSET 4 3
- Math IDX_OFFSET += 4
- LOG chinese.bin OFFSET_SUB_START SUB_SIZE2 2
- endif
- endif
- Math OFFSET_SUB_START = OFFSET_SUB_END
- Math OFFSET_SUB_START += 2
- goto OFFSET_SUB_START
-
- if CNT == 0 then
- Set CNT LONG 1
- elseif CNT == 1 then
- Set CNT LONG 2
- elseif CNT == 2 then
- Set CNT LONG 3
- elseif CNT == 3 then
- Set CNT LONG 0
- endif
- While OFFSET_SUB_START < OFFSET_TAIL
复制代码 |