这个解包和打包工具是用quickbms的脚本写的,需要把quickbms.exe放在同一个目录里才能运行。 : K6 `6 O, P4 e6 _8 L
解包器还需要一个english.bin文件,打包器需要string.txt文件。 ! @( c8 U! Y) b
打包器会把string.txt的每条字幕的第3行打包回去。
- a3 A! v% g* }4 D7 \执行test_export.bat生成的string.txt的每条字幕的第3行和原文一样,略作修改即可测试。 & n, F. s" N6 c+ x: [1 A
执行export.bat生成的string.txt的每条字幕的第3行是个空行,正式翻译的时候使用。 ; \9 @! {/ }! ^( U% U" g9 ]$ Q
下载见附件 ( s. u% R6 q. g/ n7 |/ Q( w% x
, ?- x% P9 J; }
解包器 -
- 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
复制代码 $ `( `# s- H1 f- S2 |9 w0 R
1 i% g5 N) H4 p
打包器 -
- 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
复制代码 |