最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。
. h+ ~- j9 w, r# k现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。
7 f' D( \; y9 m0 b* @- g1 G* _/ k3 j/ {+ l
----------------------------
+ f9 z0 m( i7 L/ g" @工具更新1
0 S$ s1 e. y1 x----------------------------
& r; S5 N0 p# c& ~* l* [well I have some good news.
8 o- `8 _$ M0 P% N/ {yesterday and today I have worked on the script parser and the results are so good that my beta version already works. 7 \9 Q' M! M$ S" {8 p" j8 R
: F9 ~& ?* w; D
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. 6 J) ?3 j: l! _9 `
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. ; i. t( p$ N' `1 h
then the input BMS script no longer needs the semicolon ';' and the file number which are now optional. I9 S: i' H3 g
% I. B$ A6 b8 q2 c) k) k3 `) h1 M
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. - A+ ] ?1 v' n' J' _
8 c7 g( t+ g) U8 [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):
2 N. B, i: X+ f9 @. L8 y/ z& @
9 r! e+ _8 O, `Code: l a% Q; Q4 j: O) R0 h
idstring SBPK V) j5 P. V4 P; R; @% y3 N9 h" W
get FILES long : m, A; R$ O) ^; j; R! k7 U. }
! `+ M/ x; a5 @& k, V zsavepos NAMES_OFFSET
) S$ F k) S1 ?8 d) Y5 ffor i = 1 to FILES * H* T7 o0 y. J- r
get FNAMESZ long ) J" z' l7 `4 U( f
getdstring FNAME FNAMESZ 1 d$ N* O, s+ F
get OFFSET long
" \% T; ^, T! ^" h' q) {' Bget SIZE long 2 k! V6 ^7 ~' \5 d# o1 ^
next i * @6 Y4 H) x% f1 {. L! N
+ C$ K; v) O% N0 L9 X+ v
savepos FILES_OFFSET
2 n8 n+ t+ c: g% p( Y. j0 k7 c# _goto NAMES_OFFSET
) X% N" x. H" `. a3 qfor i = 1 to FILES
+ ^3 g2 V5 \9 G$ r: yget FNAMESZ long ! }7 q L ^' ~" ]% d
getdstring FNAME FNAMESZ
( m4 {8 ^: r" A7 W' W$ R0 iget OFFSET long
. q" U/ K9 b( Wget SIZE long ( h7 V. E" G- g+ z
math OFFSET += FILES_OFFSET
5 ]$ a8 q4 u3 o7 h+ K
) s6 p4 u# U8 K7 m* U+ c& wfilexor 0xcc
% U! S1 A0 A2 |; L/ {7 \# o% l' ylog FNAME OFFSET SIZE 0 0
: {' i$ \; r1 ]% X& Nfilexor 0
. ~9 G& z! a8 s K9 J. Q: `+ \next i ' Y) W- u ]2 M4 n
as visible it's files are XORed with the byte 0xcc. 0 [/ X2 C8 N- {& j) @
5 L" K2 g2 }1 U: y" W) b/ anow the link to the beta version:
m( A2 V4 x3 C3 Z5 l& _, E4 i% c }, w8 i" _+ ?
http://aluigi.org/papers/quickbms.zip
* h( c- T# t$ ]& y* J; E6 o
0 \1 @/ A9 X6 h; \2 R1 U9 V' n% M0 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. . j V% w8 y) b9 E
# I2 ~" [; A% {$ z$ U8 |
P.S.: the usage is very simple and the following are some examples: 1 L7 h6 ^5 t5 `3 W' b1 b
listing the files in the archive common.spk of outcry: 0 h" C( m5 p- P) t
Code: - V3 E4 o* j' E P
quickbms -l outcry.bms c:\common.spk . 7 M1 ~; {' q9 D( L
+ ]/ W- P5 |- y$ F7 @: u0 n! K
extracting the files in c:\folder:
1 b Y2 m( h9 O8 d- @Code:
0 m: o w3 D% B( q8 Nquickbms outcry.bms c:\common.spk c:\folder
' O2 M }4 x; S, I6 O* u; i
% A& F& y, Z2 u: `$ W6 X2 sextracing or listing only the dds files: 4 l6 |* y/ u" y7 T- F
Code: ; B0 E" ]7 ?; n" b! Z
quickbms -f "*.dds" outcry.bms c:\common.spk c:\folder ' z$ x9 O( x! _9 ?6 @- F8 `6 a* q
! r9 V9 w: M# o6 I7 Q1 p----------------------------
/ J; R' F- M* o$ {工具更新2
3 |/ H( z2 I& @- V---------------------------- 6 e& j6 j6 a7 d7 V% `
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:
9 |& M% T& j, `* D+ D3 N: Z5 _. ^& [3 @: Z) @; w4 `
Code:get OFFSET asize . V! c. C7 T" ?4 c
math OFFSET -= 4 1 m7 B9 S+ N: y6 I
goto OFFSET 3 D: r) z& H$ p6 u- B- b Q( R- M
get OFFSET long 1 \+ r+ v5 O3 c! _( D( p
goto OFFSET
; S$ d r* E" x5 ]; {" a..."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 T: D9 k- t. I; P) Sanyway 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 C+ ]1 C& }/ F" x: V& Z% P# _5 V Q! ?- O& X o# C G
oh and about the "repacking" question, no it will be not supported ; k6 _1 D6 u8 L6 r: k1 G0 t
$ X9 ?: y3 P b& o*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)
. V1 i) a! e# ^5 [6 [/ W7 o( ]( V! L7 D6 M, t, n
-----------------------------------------------------
- i" |6 |' j# Z" V7 S2009.4.17 更新
5 q) F# b! p% f9 Y. w+ Q+ @1 L1 Y老外发布了最新的0.1.2 版。 5 X, l3 B/ j9 R5 `# r
-----------------------------------------------------
" E C( n3 a) v7 T2009.4.18 更新
7 n' N& @. h& S# u. P老外发布了最新的0.1.2a 版。; r' y! }6 s2 A
-----------------------------------------------------
' X$ L' {' T, E1 [2009.5.10 更新 % N' l7 ~6 r E- L( x" d! b
老外发布了最新的0.2.0 版。
' }9 ^' @4 _ t* z( X----------------------------------------------------- 2 X/ t7 Y$ M, Z4 m1 V. @9 \
2009.5.10 更新 ' `" f" z- S" f3 o9 X4 ]) n
老外发布了最新的0.2.3a版。! v2 X8 K6 {( P* w& y K6 W
: p8 t9 ?; o8 h
8 {/ M% T/ E1 O! F; P) j, i3 h
说明:ND20在老版本打不开。 |