最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。 9 ` H, E2 C ^& q) X7 `
现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。 ) X6 n$ [7 J& d! \( M* ?
8 l8 K( K8 {3 y& v2 A4 a" W----------------------------
) s+ L% f. S$ V: M* q: `& i工具更新1 9 Y* [0 J6 m4 t$ g i
---------------------------- : f% V3 g6 `; V* H
well I have some good news.
6 c! f0 J0 O& T2 N7 t( Q2 C4 e5 fyesterday and today I have worked on the script parser and the results are so good that my beta version already works.
2 d$ H& j8 _; J, o0 s- F
, U( F0 A4 O* r+ J& F0 ~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& Y- P' e+ }! `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.
) V" S" Z+ W; ^* b& athen the input BMS script no longer needs the semicolon ';' and the file number which are now optional.
- a5 V) }! c! z" v5 t9 D) E, t+ C; z5 ?6 n" Z& k! _1 E3 d! Q* L
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. 4 D' b) }1 v8 E" h9 z
3 T" t5 k6 a; T5 ]9 F9 Y4 {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): # H, u# w4 b5 q5 J
; f" U( P4 `$ T! HCode: , H ?1 V$ \1 x8 u7 b
idstring SBPK ' g- P$ w# _" i
get FILES long
9 ^& G! X, t& a+ s
( G1 D ]' x; |3 h+ r! dsavepos NAMES_OFFSET " r6 J4 j7 P) W0 ~: d) ~4 M, r0 K
for i = 1 to FILES 1 M) C% b. ^) Y2 g$ v/ ]
get FNAMESZ long : T C" m. r1 @5 u* C: d/ N8 \
getdstring FNAME FNAMESZ
- ?' M: E: t6 H: h! \get OFFSET long 3 ?5 m/ R- w- r, _$ x# X6 ?% J& D
get SIZE long $ L, y! x* J& k( V$ ?* r7 [$ O4 ^! y8 |
next i ; z/ ^3 d9 w4 O1 F
4 k( f, q- m) msavepos FILES_OFFSET ; g) L" T7 d& w# Z) v
goto NAMES_OFFSET 0 V3 n6 ^+ w6 R. o
for i = 1 to FILES
f K3 m: b2 D; ~get FNAMESZ long % i1 U" _- M* s
getdstring FNAME FNAMESZ ( d" ]0 a5 x. Q
get OFFSET long 4 C( ~* V9 n" {/ V: R
get SIZE long ' _/ z1 K# p! h8 k o
math OFFSET += FILES_OFFSET
: y* R8 K, C/ L$ n3 @# G9 D
/ U- M2 M6 T% H" [! f3 p5 N! zfilexor 0xcc
$ s0 Z4 A0 ~3 _9 i! A Wlog FNAME OFFSET SIZE 0 0 7 R" q8 W- Y: t/ q
filexor 0 * H1 G3 @! g& ^- m) e1 N7 m
next i
% D- u, G0 |- G) ?as visible it's files are XORed with the byte 0xcc.
, j$ {/ V: x% c9 n( B. Y& S) B0 ~, A0 i2 D; L P; D
now the link to the beta version: . @9 ?. t( B! F5 u p
; _) Z1 O; k- h1 U+ J7 {/ Ghttp://aluigi.org/papers/quickbms.zip - o1 j+ n6 D7 f
' f. ~% H% _* b$ ^; d+ _2 q7 B
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.
0 ^; T Y' O; R4 H- g/ s
4 Y6 n8 `* c7 i M ]P.S.: the usage is very simple and the following are some examples: 7 S f9 J# J; L% h, |+ q
listing the files in the archive common.spk of outcry: 7 l2 _7 Q+ D ?1 V: [+ P! U# M; ]
Code: & b' ^6 X" T! V
quickbms -l outcry.bms c:\common.spk . 3 R1 M l3 P( y0 x6 L0 Z
% ?" K ?$ o" j# ^extracting the files in c:\folder: 9 Z% H# M4 z! O. l2 u/ B
Code:
9 q# w+ m+ x4 B" E8 t9 dquickbms outcry.bms c:\common.spk c:\folder 1 g5 n3 Q+ }( t4 P7 f* W
! ]9 y: _& e/ B1 t0 A4 \
extracing or listing only the dds files: ; K1 Q# g& f8 b+ s8 o* T
Code: # v$ W' [1 f0 g: W8 s* K9 ~
quickbms -f "*.dds" outcry.bms c:\common.spk c:\folder 4 }, G- y- v3 x) v# Q% _
- j* r2 @+ t5 b$ _4 [* Z----------------------------
- y1 U, `" Z+ o* u. K8 Q% i: L工具更新2 1 k- Y1 X: [7 G! f& E
----------------------------
* [; V( P% X' k, G1 C8 G# Cif 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: & t# q3 b% f5 ~ l5 j. r. o4 t: M1 Z
3 ?+ H4 _; I- QCode:get OFFSET asize
) f: D: g% y% q, T; O* E- ?math OFFSET -= 4 " y1 a$ D& @( L: Z3 v4 Z
goto OFFSET
3 c, y7 M& c0 ], e4 Iget OFFSET long
9 m$ c0 F- Z; w2 pgoto OFFSET
6 W# S8 l# i1 k3 k0 a1 @/ o..."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.
2 Y9 J8 o* | g/ d3 Aanyway 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.
- I5 u3 i9 i) k6 }9 e6 B/ v% H J4 t) Q# C8 C" h
oh and about the "repacking" question, no it will be not supported & ]5 {5 a2 I8 z
1 z) [/ X5 u/ V# e3 w& {*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 Z Q+ p6 H/ e& `: z
* p( m. L) `$ \: f----------------------------------------------------- 4 ]1 I* b, y) b+ N- f7 w1 i K( V7 e6 y
2009.4.17 更新 # ]9 g; D! N# ]# {; f" m- k
老外发布了最新的0.1.2 版。
; [% c" H/ f9 J) B-----------------------------------------------------
" l2 B0 Q. H5 N9 H6 a/ y. v$ \ U! g9 D9 N2009.4.18 更新 ` L$ W% _! B1 f D
老外发布了最新的0.1.2a 版。
$ r( B2 n8 m; f( L0 n; \8 ]-----------------------------------------------------
1 u7 f; [; {& N n2009.5.10 更新 8 `; Y# ?% }$ a3 Z
老外发布了最新的0.2.0 版。
5 {* [" t9 p+ i. V$ i1 W0 Z-----------------------------------------------------
! I' @2 ~* R& D- X2009.5.10 更新 " g+ d! G9 V- t) `) a( e
老外发布了最新的0.2.3a版。
0 n, W8 L O9 U) H/ t7 h9 P8 q) `1 v
; g8 m/ t6 {. m" T3 J! D, A X5 f( Y说明:ND20在老版本打不开。 |