最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。
H1 ~: G! K+ V0 M现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。 " _* A Q$ n8 V! M* c* X
- ]- G9 c! c( `1 P) @---------------------------- ) |9 `' u1 d* {2 m8 Y; z) q- M
工具更新1
D7 t( g4 s8 ]$ G j9 ]----------------------------
, y9 F d, Y4 n1 H9 O' B) [well I have some good news.
" p* L4 s# i4 i7 J: ?* g9 xyesterday and today I have worked on the script parser and the results are so good that my beta version already works. 6 s5 c: n1 T/ \1 O% [0 o
; T2 D' U' Q1 gI 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. " y1 M* [% y; M+ R" ~
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.
) `9 T, N, X7 S/ [9 r N7 r' {then the input BMS script no longer needs the semicolon ';' and the file number which are now optional. / _/ D6 r( I, k+ U0 \! F& t0 x) ?! G
) u9 @+ a- q7 k8 K, J$ J
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. ! x; C1 P" C; a2 I4 ^9 o" d* X- g" N L" K1 g
0 t# i6 i& @5 v# H) J- }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): ( i& v( G5 @- @1 p2 I' p$ H
9 M I: Y1 _5 K& n8 |* Y
Code: ' H, q+ y. n& `$ _6 \" D2 ]
idstring SBPK
' H3 h" p& O9 j) e" yget FILES long
: ~4 i) ~" H+ Q3 n% l% E0 @; k; X& u% l& m: M+ l9 b; R, F" N
savepos NAMES_OFFSET
( L* _# G5 H) ?+ h4 L% ` Sfor i = 1 to FILES
+ a; c5 d: }, v; o* p: l5 uget FNAMESZ long
6 {3 [) i; u7 w, n& D( H4 }7 Igetdstring FNAME FNAMESZ 4 A" [8 F& a8 |9 |% G S/ W. ~" \
get OFFSET long
: @. Y Q8 Q Vget SIZE long ]5 J o# m. Z: M; {
next i
! |7 T$ E; _$ H0 p, }4 o2 s
7 M- z: ^; g1 F3 n! Wsavepos FILES_OFFSET X. }0 {: b; D, |2 _
goto NAMES_OFFSET 6 P2 h8 n& |0 E2 }, k1 D
for i = 1 to FILES + i) `" B' \7 f* k+ l
get FNAMESZ long
. ^7 n$ d5 l5 a3 g3 s9 Ugetdstring FNAME FNAMESZ , [4 x( @, p$ P2 l J
get OFFSET long 9 E7 f( I# q7 C# @$ r" P/ P
get SIZE long
* H% y2 S0 u0 i( v8 g% {& X! ^math OFFSET += FILES_OFFSET
8 u: T1 X6 {/ x; j: J7 Q; Q& l; n- f @
filexor 0xcc
' }' X% \- ~1 dlog FNAME OFFSET SIZE 0 0
/ m' j, I j2 _2 ?' _filexor 0
) y& b5 g& g3 i2 R. Q( d. Rnext i
4 w5 g" m* M7 m; R& e- uas visible it's files are XORed with the byte 0xcc.
9 K, ]% H3 b3 [7 ^3 b' u; E9 y; _ R3 ]. p5 u# V4 H: q: v
now the link to the beta version: + i7 g) P8 N4 V) R5 b
+ ~$ q. P/ F" M. c' Q
http://aluigi.org/papers/quickbms.zip 5 @8 o1 a* B# e
( g# k% J8 L% z! x/ T& M
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. - m8 Y) J; f" R& Q
$ c5 J5 R; M- z/ M& |& W. Y) Y
P.S.: the usage is very simple and the following are some examples: / ~7 Y8 F$ r+ b' S0 @
listing the files in the archive common.spk of outcry: / d2 e0 W v. X; _" o
Code: # ]' U8 F, G8 f. g4 `+ _
quickbms -l outcry.bms c:\common.spk . - h) D8 b% x! M2 ]( c
" g( U' O% u t5 E9 Mextracting the files in c:\folder:
, E$ H# y: Q4 PCode:
- v2 {1 \5 g! }quickbms outcry.bms c:\common.spk c:\folder
4 Q7 b( w- |* ~0 ~/ a: m; R( q# \; D! Z8 z; k
extracing or listing only the dds files:
. {3 d$ ^, @$ F& d: B0 _% O9 z. kCode: ! k+ R6 q- L' W' N8 K. A" g7 R
quickbms -f "*.dds" outcry.bms c:\common.spk c:\folder 5 H* ^% D, I- O5 b) N8 ^
% L5 S- G$ J2 d! U- E
---------------------------- ( G6 j8 g+ y" }- F( I9 F
工具更新2 ' h' D5 _9 M+ n: _) p D7 _( T0 @; v! h
---------------------------- " p: R$ _! N( |0 L
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: 3 G8 O6 C) O4 c- T0 c
% U7 y, z5 e* E9 h' I
Code:get OFFSET asize
1 P! ~! T$ h0 p4 ~0 V6 _0 O( hmath OFFSET -= 4
3 J8 Y* v: q6 l* k# ngoto OFFSET
: \7 j8 a( v6 V/ |get OFFSET long & }- ? u/ b3 V, Q( d$ A; @
goto OFFSET * |. R% t4 X2 i2 d9 {
..."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.
: O1 Z1 G7 V) Eanyway 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.
8 D1 f7 C; ]' }5 ?1 K, U% [
' B& A# r) J) z; xoh and about the "repacking" question, no it will be not supported
) O8 n8 q7 c' t% V9 q# o$ q# Q5 D: Z8 I7 m
*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) + {+ }' I: [ j
" S- A9 A/ j) h& P9 ~
-----------------------------------------------------
" v# k+ T$ M2 u3 H2009.4.17 更新 9 K0 A9 Z: j, q% W5 @5 @! w% ^* Z
老外发布了最新的0.1.2 版。 % [7 \ s9 q: ^; g& b j
-----------------------------------------------------
% _* T! y$ g/ w. _1 e2009.4.18 更新
! D3 q' @$ J' s; x老外发布了最新的0.1.2a 版。
. w- _2 [" C+ R6 X# C/ M-----------------------------------------------------
9 A0 H( p3 a) |2009.5.10 更新
% f" g/ i6 O) I- T0 y2 l& y7 f- F老外发布了最新的0.2.0 版。
/ V# B; Q3 k* v2 D-----------------------------------------------------
% O7 w5 u5 @/ d2009.5.10 更新
) O, p9 B; z; Q6 k3 B老外发布了最新的0.2.3a版。6 J! G* }" i' z( `0 S6 ?6 X; ~2 e
4 K E4 L4 G0 c" r5 ?8 v7 B% K, O! i3 ?8 l6 T2 n1 P& B- O6 M
说明:ND20在老版本打不开。 |