最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。 ) H1 x; d8 K! s; Y
现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。 3 L/ V/ M. h3 f+ \2 W6 ~$ X! h
/ V7 m. L9 G$ I, F7 I- X4 ?
---------------------------- 3 M) V1 R* I& [4 v" F
工具更新1 2 g$ U' q* } b) ^- K# [5 Z
---------------------------- 4 k/ l/ Y: x6 F H& d- t
well I have some good news.
/ G3 l/ W: Q( F' \$ z* ]. b/ w. yyesterday and today I have worked on the script parser and the results are so good that my beta version already works.
) ^& L3 W- z0 I7 W3 a$ j
. J8 N$ v, b3 `6 c1 ]2 _, p3 x; KI have made it compatible with the BMS scripting language so people don't need to learn 1000 languages and then it's a good language.
! Z; T- U+ O- X% A6 u* Zobviously the BMS support has been enhanced so it's possible to use XOR, rot13, zlib/deflate, lzo, lzss plus various new operator in the "math" command (and, or, xor, complement, not, shift and modulus) and some other things like choosing the desired endianness.
( k9 x! g e4 K. }+ X% s7 Z+ dthen the input BMS script no longer needs the semicolon ';' and the file number which are now optional.
8 `# k2 M* K1 w: m
5 e# V% M; v; x2 {9 N$ @note that the BMS guide available on http://wiki.xentax.com/index.php/BMS doesn't report some additional fields which instead already exists like the GetCT, ComType and ReverseLong or some internals variables like EXTRCNT so I have tried to find and add also these ones. 9 F( E% ]2 t1 i% }
4 V! n8 T! X- r$ W: d
about the new commands, the following is an example of BMS script for the game Outcry (you can call it outcry.bms or outcry.txt or as you want):
3 ~: c: Y. W- _" v' U! y+ i( ^4 ]5 K# Z( y+ {% I
Code:
8 _; w% ?& D" t: Q: d" T: {idstring SBPK
; ]8 s) W' \, O/ y- O& uget FILES long l' P! k8 _7 w' S
; l a8 m/ M' R) I3 gsavepos NAMES_OFFSET
/ r/ ]. k* P" `2 Q4 m# tfor i = 1 to FILES 7 q, p/ Z/ Y% ]' w% p, P( y
get FNAMESZ long
8 B: D; k1 Q+ I% @! \getdstring FNAME FNAMESZ
/ S- I/ v" H) c. H/ B) Fget OFFSET long $ w9 s1 Y" g5 G8 L9 Q3 H
get SIZE long 7 P: A: n* Z: c3 K) q' v& ? H2 j8 w
next i
' ~: Y; U( w+ s2 I" t
/ b" W$ c, T- T& R4 tsavepos FILES_OFFSET
9 M( r5 G" f8 t% m0 X5 @+ q/ Q8 cgoto NAMES_OFFSET
: A' ]( T" v8 b B4 j2 Afor i = 1 to FILES 9 q8 S$ w. a, G; J i- T6 F
get FNAMESZ long
7 ^, d9 Y1 X# [5 _getdstring FNAME FNAMESZ , \& q( N$ ]* d' K2 ^4 t# |
get OFFSET long
! N2 G+ z/ n6 a* f" }: yget SIZE long
, M; g- S4 c7 @. E1 t- gmath OFFSET += FILES_OFFSET 5 |/ Y O" L0 X. o) X; y# u- W
1 }2 S% N' m E5 Y4 n/ \2 d/ }8 @
filexor 0xcc
0 f+ C; `+ @& ?' x! i% [, a, k9 {log FNAME OFFSET SIZE 0 0 ! b0 u% S/ X. y& c/ K* A6 F
filexor 0
) G* ^* l* d; ]0 N6 j! c! H/ D# Knext i
' b# H+ E) R; h+ @ `' aas visible it's files are XORed with the byte 0xcc.
4 ]! v) }! ?: d2 ?4 W3 G& _2 ?9 I9 N2 t* d8 R E, P9 }
now the link to the beta version: ) v$ H3 N; c. [8 M( l
4 @4 f$ v" s0 W3 D6 I) h
http://aluigi.org/papers/quickbms.zip
9 ?1 i$ i! C* q! O: n
* f" R' n9 }) @1 V8 qobviously it needs to be tested more because 2 days are not enough for a project like this which is not so basic so anyone is invited to test it and suggest new features.
- Y+ P5 e2 |4 H' A% q( \# b9 k Q1 H! n: x, G! Z
P.S.: the usage is very simple and the following are some examples: " f1 n3 G6 q0 x4 r
listing the files in the archive common.spk of outcry: + ]" K M) y8 d0 T, ?% _
Code:
4 Q+ l' j4 |. w' zquickbms -l outcry.bms c:\common.spk . 3 F6 N4 |9 B) m: v* F4 a
/ a! _; t* g' X- O2 e% G$ ?extracting the files in c:\folder: ' g# f8 y( S$ E. s" h A+ ?
Code:
# ]$ [' k: E) u; p* pquickbms outcry.bms c:\common.spk c:\folder 7 {8 ?) I* v2 h) ^! Z
. W% V& V: ?& q+ q
extracing or listing only the dds files:
2 d$ e; D/ o6 X/ r: s" GCode:
( Q0 z- A7 Q1 b; Nquickbms -f "*.dds" outcry.bms c:\common.spk c:\folder
! C" d# e a; K2 e: g6 z) \2 @/ I8 q, f0 s7 [
---------------------------- " s8 Y9 `! n% G! }* x
工具更新2
1 a% P& W+ c3 j0 r4 |----------------------------
; e9 P/ [$ W3 A. E' uif you know the size of the structure or where is located the particular value you are searching (for example some file formats have a 32bit number in the last 4 bytes which has the offset where are located the other file structures) you could use something like the following:
9 a3 } J- r' e) X( T& K! p! l+ |& l9 f+ p, ]7 B3 P2 }. m
Code:get OFFSET asize 4 U; n; q! u. `
math OFFSET -= 4
- p, r: s% y* W9 x7 @ R9 jgoto OFFSET - _6 x3 n A4 m- B; F4 F
get OFFSET long . S# E8 V; k o/ W `$ N1 X
goto OFFSET
- \% U Y3 H& t; m..."asize" is not available in the BMS guide but is supported by both multiex and my tool, it contains the total size of the file.
# m4 ^8 A0 E& l" X9 |7 o4 i6 ganyway tell me a file format which has the file name table at the end, it's good to make various exercises for testing the BMS language and where is possible to enhance it. 1 p# K6 V1 \- X2 c6 u
4 c ?! v2 C+ X8 a. n* Y4 |1 j
oh and about the "repacking" question, no it will be not supported
( p; T2 `3 l( [/ f2 B/ p' e) A$ z- E! |* j8 q" L
*EDIT*: updated version to 0.1.1 and attached 3 examples of BMS files which show different operations or different types for doing the same thing (7x7m.bms and 7x7m_special.bms)
7 i6 c4 {! ?$ k( F+ a7 \/ ?8 j
/ G, y! [9 T, i9 z-----------------------------------------------------
3 H0 G8 B& U' X/ I" K2 V5 H2009.4.17 更新 5 d% s6 ]+ E& {8 H$ n" B& z
老外发布了最新的0.1.2 版。 $ u& s, `7 S; q7 @8 Y6 v# C
----------------------------------------------------- 6 s; C6 ?) e. W1 t' R) G
2009.4.18 更新 0 N; i2 ^8 J! P+ `
老外发布了最新的0.1.2a 版。
" c# L6 k& _0 d8 E# M5 i-----------------------------------------------------
: E ^% B; m* `% n, F R' U" R0 z2009.5.10 更新 2 |9 M/ ]$ t- e$ C
老外发布了最新的0.2.0 版。3 x) T! g8 P# g0 K. X5 u9 o2 K& n+ S
-----------------------------------------------------
$ ^' ~ Z9 M+ q. F2009.5.10 更新
! z9 S% J. R9 T老外发布了最新的0.2.3a版。 g: H n0 s) \0 z3 N! D d
7 P! b9 i! j" B1 B$ w3 ? w; F& ^- h; I6 j
说明:ND20在老版本打不开。 |