最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。 & |# T& H) s$ u6 B
现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。 " ~9 X1 n0 w1 x7 W" n# m
7 c. {) E) p+ f- @9 Y6 B; g9 u
----------------------------
+ }, F/ R0 F+ W. \# V! h0 ]工具更新1
! G+ @ K5 V6 w----------------------------
! X- ], v$ Y- g2 M7 H1 @4 \ ~* Ywell I have some good news. * H5 A$ M0 E* ~$ W" O" c7 X/ R; s( Z
yesterday and today I have worked on the script parser and the results are so good that my beta version already works. 5 ~" F2 H) z7 a# k" ]: e
. [' C x& A3 G5 c
I 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% l5 p* Y8 g) C
obviously 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.
* a- @* B$ g6 _8 ?then the input BMS script no longer needs the semicolon ';' and the file number which are now optional.
W. D1 k' W" ]. Q$ O; m1 X' [, r) @3 e# ^8 \
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.
2 ~$ I2 {/ y8 y; t a9 e8 Y6 O4 f. ]
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):
) l" c, I; E- j3 ?. N, I
, Q+ d: w2 m' u. K. j0 L; V2 R7 xCode:
, C+ b7 I( M0 X% g6 D) Widstring SBPK
0 z/ b7 b4 U! ^% e3 Gget FILES long / ]& l% D* R8 @# m" V g* H( n
/ e/ d/ F' _" k7 F: W fsavepos NAMES_OFFSET 5 r G u" m- j: g- n
for i = 1 to FILES
1 d) M8 e6 k8 s( P* V# t; |. cget FNAMESZ long $ N0 B1 n& W+ @% _
getdstring FNAME FNAMESZ
2 f+ a; y9 x. E; h+ sget OFFSET long - j; ]; A8 Q4 b7 J$ W
get SIZE long
7 y. H: I2 k% _0 S6 x0 G' gnext i : j) o% d$ H; k8 h# R$ }$ ]2 W
# {1 N- V* }5 x S3 P. {8 Hsavepos FILES_OFFSET
% R. ~; k O+ `+ Z! Vgoto NAMES_OFFSET % G9 R9 o J3 [: E. c& t
for i = 1 to FILES
8 p! e% H- W8 T$ |" U( @: l4 Oget FNAMESZ long _4 L" \' k5 K2 _: _; g% c; }
getdstring FNAME FNAMESZ ' e% \7 W- l- c; H# J" w. g
get OFFSET long
! M: J9 N# r8 p7 fget SIZE long W f1 b" C( c$ D4 m
math OFFSET += FILES_OFFSET
# t2 k$ g1 P, E, |5 X3 S- {9 M0 h
filexor 0xcc
: P8 H0 i$ O& A8 n, s3 J: zlog FNAME OFFSET SIZE 0 0 ' j, Q: [3 y: \8 Q1 d2 Z l' c+ F
filexor 0 2 _4 l1 n P4 S0 V8 A
next i
: o) J1 @3 W' }$ ?9 l% m( `4 qas visible it's files are XORed with the byte 0xcc. 4 X9 j; [( J- g) Y9 y
j( E- l! ~* D! o5 e: H3 know the link to the beta version:
3 ? [2 b, x: d! K
; ~) S+ U/ M6 }1 Q" ]http://aluigi.org/papers/quickbms.zip + ?2 ?0 B0 P5 S5 _" M
3 a- Z, E( a. o+ e( H, |8 Robviously 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.
' h/ c' k2 M f; U
; b( z2 |& s2 L, H% h4 e" H5 qP.S.: the usage is very simple and the following are some examples: * V6 |/ p8 d1 j# ~8 h9 v# I
listing the files in the archive common.spk of outcry: 7 d) a9 {" ], c# \2 C) S0 o+ H% o
Code: 5 p% g" n) G- M( R/ L3 `# Z8 r
quickbms -l outcry.bms c:\common.spk . a5 C5 S( ~' Y" r- d
9 j: c7 q# `4 I2 bextracting the files in c:\folder: 2 a; ?9 z- [; E% T6 `1 K
Code:
8 N, I9 s- w' l2 Aquickbms outcry.bms c:\common.spk c:\folder 2 t% }. d4 L7 M: j5 j3 x/ P/ ]
6 g1 V- R4 J" e, l7 R! o; {/ s( k
extracing or listing only the dds files: . j4 p9 {( Z' p) _; T4 P
Code:
) X( L3 ~6 t6 Z/ K V _quickbms -f "*.dds" outcry.bms c:\common.spk c:\folder $ P5 C4 ~% Y' f
# W3 L- U5 L! h5 y----------------------------
6 c: e" z; R7 {4 P" L3 p) {工具更新2
% [" b1 y; L7 d$ V$ z---------------------------- , Z2 ?' n. e' E$ R( _. C
if 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:
% ~5 K8 w4 `* B. D$ V3 G. P" \' v3 g2 K. A1 \9 m7 l6 A
Code:get OFFSET asize
8 Q! W% } z- f* Y5 Wmath OFFSET -= 4 1 a6 G. f' A) i6 `$ z& O: B x. q: ^
goto OFFSET
5 F+ l: P( R# v( `! Fget OFFSET long
+ f% X# y+ o; ^goto OFFSET
`$ u( |1 f7 n- s" y! R i..."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.
9 w0 t1 P: s. z" u% W) Danyway 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. # P) P* c# ?5 w4 S: G
7 M% G( J! O/ N" D& q( V
oh and about the "repacking" question, no it will be not supported 6 @$ C$ C) W! _
% K* k5 `/ T$ Q# N; U2 ~
*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) ) u5 g4 y4 e% H) F$ c s
% ~! W. S3 m8 d3 _5 |" ~/ v9 C$ Y
-----------------------------------------------------
* T3 _8 I( R* U- c" E. M2009.4.17 更新 ' V" P1 `5 V* v
老外发布了最新的0.1.2 版。 . v7 S/ a0 c6 K" U. H. e: J
----------------------------------------------------- 5 `* ?; M, T$ p5 J2 V9 e
2009.4.18 更新 + \ w1 p- \ K! l% |/ y _
老外发布了最新的0.1.2a 版。2 Y6 X7 p( d* u
-----------------------------------------------------
# y9 Z r8 O( S) l" |2009.5.10 更新 & i& H$ ~8 K* i4 c
老外发布了最新的0.2.0 版。
9 J- O* r* }" g% j----------------------------------------------------- 8 c0 O$ R- ~9 e" `1 }# D0 a0 y
2009.5.10 更新 / U; i- K5 h* S- F7 \
老外发布了最新的0.2.3a版。
5 Z6 j. x/ U3 `4 u3 L+ h g" ?3 ]: g& P2 H& B; h
2 N" t. v2 N6 p- }4 k$ ~
说明:ND20在老版本打不开。 |