最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。
: `! i3 R9 C- J' G现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。 ; m! B3 k8 Q9 U; V1 V4 }
2 X( j& {' s% Z) E- F---------------------------- 5 _# f5 F9 f2 `
工具更新1 8 F" I. K/ j% o1 I
---------------------------- % }- y% c7 A# r1 v0 G, I. U* O
well I have some good news.
8 x* n- k3 f/ Syesterday and today I have worked on the script parser and the results are so good that my beta version already works. 7 x& j9 S( H5 l
, v- N1 f3 M" Y
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.
, s8 d* C2 ?/ ?$ R/ Qobviously 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.
5 E' ?+ r7 S( I5 N0 k' E* Mthen the input BMS script no longer needs the semicolon ';' and the file number which are now optional. " g# V& t+ c- @2 w. d
7 D5 C t" C+ d# J Ynote 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. ) B' b( E" i3 j6 m9 D
. {/ j9 E* |. C4 ]: Cabout 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):
# g7 m- e8 {8 ^# _
; w. M9 {8 ?7 ?# ]' [" nCode: ) m$ v( Z% a3 w7 z9 I5 j: Y+ \
idstring SBPK $ X! l. @: R m: S
get FILES long
9 r( p% e5 C; b4 b- Z1 G7 M. B) H( r, }; m' o" M( {( k/ M
savepos NAMES_OFFSET ! x* i9 g( E7 q/ ^( `8 q# a
for i = 1 to FILES
6 d- X, J7 T) L- F3 \1 ]" [9 ]6 e) G/ lget FNAMESZ long & z4 P& _3 D( D/ ~8 I
getdstring FNAME FNAMESZ : E6 W0 g9 [; v7 g( g3 H
get OFFSET long $ W* D0 i& p( V5 A! R( s$ ~
get SIZE long % a9 I! _9 y+ t7 Z( E
next i % t+ g# u. r( {- W: w
9 C3 T; _+ N4 j" X. w6 j1 B" g
savepos FILES_OFFSET 7 |, o3 ?2 ]& R& |
goto NAMES_OFFSET
1 [# ^% @0 q$ Tfor i = 1 to FILES " {( A, w. _4 p. N6 M! o
get FNAMESZ long
6 X, B# t* L+ U6 r6 Y3 k' o$ E' [getdstring FNAME FNAMESZ " T% z- V4 N5 d0 {1 A4 o- f
get OFFSET long 8 e$ x9 y! i8 R- g
get SIZE long ) K0 X5 \4 e2 M, e! V7 e6 I4 U, R* s
math OFFSET += FILES_OFFSET
0 W' E/ U& R) b3 o8 A7 Q! U$ D/ `) d( E6 W4 P
filexor 0xcc
+ M5 H5 Q+ ]7 b& p6 `log FNAME OFFSET SIZE 0 0 ! i% T4 q* V* H# I) {" B) F' I" h: T
filexor 0
3 Y2 ]8 @! S1 H: _next i
2 p. b) T2 Q7 }as visible it's files are XORed with the byte 0xcc. % Z( v( v3 ]* a, W; T8 y
) L+ _) a4 D! k) Z
now the link to the beta version: 3 Q. D5 A9 L0 a
6 Z: ^/ n2 {- E
http://aluigi.org/papers/quickbms.zip
4 v# Z* ^5 g7 G c0 m4 }8 l* m0 g& e3 O$ b( P
obviously 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.
/ S! d* [ b* {
4 S3 \4 N3 F0 R# z( g* P* I4 pP.S.: the usage is very simple and the following are some examples:
( l& }$ ?( H1 Mlisting the files in the archive common.spk of outcry: 2 e, g, V: ~7 S0 ?6 g T& o' M
Code:
5 [$ |+ U t6 f, c# ~* [quickbms -l outcry.bms c:\common.spk . ; [5 S0 I* m1 |- Z! o
8 i) X" }( j( v& A
extracting the files in c:\folder:
5 v0 U/ E$ @1 ?' xCode: * }. F# N+ _/ C! s& c2 N" @; S
quickbms outcry.bms c:\common.spk c:\folder + {" A3 \, {& e% X
5 B! N' G$ J; `- v- ~! b: k, t
extracing or listing only the dds files:
9 D$ r: v' N8 C- k" D5 }3 r0 wCode: 1 ?3 f: ^4 d: Q# G% o
quickbms -f "*.dds" outcry.bms c:\common.spk c:\folder " L/ S. x$ _( e
. Z( Q% e( h0 g; I3 f---------------------------- 2 _4 S* `8 u$ C! W5 O4 B) ]
工具更新2 5 j" l) l/ b5 ]) |
---------------------------- ) Z0 L# L& Y" C( I
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: # J- T0 G- r9 h
3 O' q7 H+ R ?- }% _- ?Code:get OFFSET asize ( i9 o1 d( i3 A' {) l( r, M1 w
math OFFSET -= 4
% v* f3 k* s: l1 pgoto OFFSET _, \' Q% \! `0 S
get OFFSET long % g& Q& u# P& c
goto OFFSET
* x H/ y0 c. I/ U..."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.
3 V7 |/ b, M+ E3 L; fanyway 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. $ x/ v* J6 w. l: g3 x- Y
* V( i) C" C, r" x1 D% y6 V2 ~8 E
oh and about the "repacking" question, no it will be not supported
# u$ F$ k. J$ w# u) X' A( o# h6 k( y+ }
*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 `+ S! ?* u. M8 A- _5 B1 i0 J0 ~) n# F8 h( P2 _2 R
----------------------------------------------------- * |5 g% M, ~3 U7 Z+ i; C
2009.4.17 更新
+ v" f$ Q3 Y' ?1 P O. j老外发布了最新的0.1.2 版。
' J" l% u% e" M2 ?-----------------------------------------------------
6 h7 O( {, @; k' c2009.4.18 更新 2 o' Z( H6 Z/ ~. f" ]
老外发布了最新的0.1.2a 版。, j9 G: Y3 q L+ d
-----------------------------------------------------
p! `& a u S! C" C5 J2009.5.10 更新 & o- @ S2 Q# H6 p" D6 ?( M
老外发布了最新的0.2.0 版。
* _1 ~* \# P* L* ^( Z2 U----------------------------------------------------- ! E! F8 @7 J) U! R: {( B- O7 s
2009.5.10 更新
6 z1 F6 @5 T- S# U0 i/ @老外发布了最新的0.2.3a版。& @/ P7 ^9 |! ^1 @
& ?1 ?8 n0 D" T% @' u2 n* P
1 t1 k$ S" I4 N% ^# L* \说明:ND20在老版本打不开。 |