最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。
- @* M8 K4 L! c& ?* L现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。
# g h3 M8 J! O4 K+ u& V2 Q% A" M" }& [7 f3 I
----------------------------
: c& `: t0 V% W2 }# D% C7 V工具更新1 2 G- T2 M% z0 a/ _( G& P
----------------------------
, N/ \6 N6 s. |& M5 ]" hwell I have some good news.
1 w* ?: F" _* L3 N9 hyesterday and today I have worked on the script parser and the results are so good that my beta version already works.
1 Y) C) M" s0 _: M) J8 X1 v* B2 P; ~8 t* ?5 g+ h6 `6 ?6 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.
" c0 J+ k0 v* l: O i7 U/ Mobviously 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.
2 `/ u$ i; r w; sthen the input BMS script no longer needs the semicolon ';' and the file number which are now optional. 9 } ^: M% u& u; r
1 [4 s7 A4 A) W% h* knote 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.
: n) ^7 w, @2 S X* ?5 K) g
; l. I/ n. C% d; qabout 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):
0 q* F Z6 ~+ \9 k3 y/ h
; W* l* Y2 Y& Z& x' RCode:
' E- ^% q. b( G/ L, Oidstring SBPK
7 J( ?* B% U" ~! H2 s. zget FILES long / |& c8 g3 {1 N/ V, j7 L
: d9 V! n0 w; T0 k% i( s% Lsavepos NAMES_OFFSET
3 d. F; L2 I6 k) P4 }& Sfor i = 1 to FILES
6 M; D# n4 o5 J% B$ i. A7 xget FNAMESZ long ' w0 l- |9 d" f) s, S- ~ H' |+ C
getdstring FNAME FNAMESZ + a: l' S( y" W" R
get OFFSET long
& I5 h3 e9 S. {4 Wget SIZE long / ?: f/ `+ {( }9 y: Q5 l
next i 0 K" `$ Q x6 ~( F" P
6 u5 g) \$ g# lsavepos FILES_OFFSET / J+ q2 ]1 A2 @; [+ V6 O% ]
goto NAMES_OFFSET & {0 P) y. \% h: U8 f+ S
for i = 1 to FILES ! _, h8 m3 @, C+ a! t, b
get FNAMESZ long
3 {1 j6 Q1 P+ C e1 }! K3 Kgetdstring FNAME FNAMESZ
; A6 }$ x, w& W0 N. B! Q9 o8 @% qget OFFSET long 5 Q* u; a% i' l3 u
get SIZE long 0 X* F/ S+ F: E& g, M
math OFFSET += FILES_OFFSET
7 d9 R7 U* F6 L: I
" I8 {) [# \* x$ g X0 {$ ffilexor 0xcc
& p- a2 v" t, O7 G2 A1 a' B, klog FNAME OFFSET SIZE 0 0
2 A) N& i9 Y" S' hfilexor 0 $ ~* M, x0 ]! E: p# E" ~
next i
. \& I, t1 p4 e' P, c1 Q% h' H8 G2 mas visible it's files are XORed with the byte 0xcc.
2 q# \1 T) k& v8 I, k* J- d7 D- x/ V2 p7 U
now the link to the beta version: ) U# O, F$ a5 @. ^0 M' G' [( J. N
, m; Z3 L, e" J0 l/ T" x
http://aluigi.org/papers/quickbms.zip
0 b$ h0 S# ~! B% W2 \& {( ?0 y& [6 G) Z0 c
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.
" X. N. l$ G5 ^" K0 ? ` M; h# {$ [( R
P.S.: the usage is very simple and the following are some examples: 9 d/ K% Z( Z, a; {$ e
listing the files in the archive common.spk of outcry: 5 Q8 m$ c/ J" o% f
Code: ' m8 z& h/ I# N$ s
quickbms -l outcry.bms c:\common.spk .
0 m- Z5 y/ s1 Y5 Z1 C( Y2 l1 {$ e/ {( X6 c# c( n* Z
extracting the files in c:\folder:
' w0 g; l1 M4 @0 Y9 Y% [Code: & w2 M6 S/ H6 N/ X+ B0 t
quickbms outcry.bms c:\common.spk c:\folder
. v# |% w( r% t4 f
0 z1 ?4 z$ j* l' F0 o0 R, Dextracing or listing only the dds files:
7 R; K! ?" P5 q$ u8 W2 yCode: 2 W4 E. ?* r6 V4 I+ P, i: c1 s- L
quickbms -f "*.dds" outcry.bms c:\common.spk c:\folder
# G1 S ~8 Q. [
+ r8 n- ~' i3 j0 N5 D# Q/ ~---------------------------- # P% \' Q$ K5 [( X; V) l
工具更新2 8 Q" d2 i3 t* D
----------------------------
/ p& F; {' k+ }& F8 lif 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 E- t* Z! H+ `! S& U
3 l/ }0 k- f2 G2 F) U6 G. FCode:get OFFSET asize , O' Q" M) V5 a2 W
math OFFSET -= 4 1 H+ ?8 K- e& B1 n7 M3 E' P6 l
goto OFFSET
p; I+ l# f- d: y8 Oget OFFSET long
* c$ C" H/ O8 h4 V( kgoto OFFSET / Z$ }. x; I, L6 w+ M
..."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. $ W/ h* t* N: V3 [- a; ]
anyway 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.
9 M. b) u4 V. c! T. A1 z' g# z
* D/ p; p/ N' uoh and about the "repacking" question, no it will be not supported
$ o: J1 V: n9 v' v' I# d5 h! G2 j( W. r1 W( l# G7 M& Z. _
*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) - w. n( p' P0 `# W$ a3 P) J
* c' h# r6 `, U/ `* i- E4 j----------------------------------------------------- 0 A" Z3 y3 x* ^* l' O6 B2 T6 K5 Z
2009.4.17 更新 * N% V6 ]! v+ a, }: y$ d- _4 X
老外发布了最新的0.1.2 版。 - B; h, T4 D. n+ u! v7 [0 E5 T
-----------------------------------------------------
: d( {- O/ e* L/ d+ m& U; Z2009.4.18 更新
: n7 L1 l2 z. P* y$ u/ Q老外发布了最新的0.1.2a 版。- U! c! N6 A% k: k3 P4 ~1 m
-----------------------------------------------------
6 X% R8 v8 l2 d! u K# j2009.5.10 更新 * |% l. ~ I) y0 t5 X) g
老外发布了最新的0.2.0 版。6 T# v9 S: r9 Z8 O
-----------------------------------------------------
# p: c0 r/ _4 b' Z2009.5.10 更新
# y0 o% `" x- G0 i' \老外发布了最新的0.2.3a版。/ a% k: p, e8 b \8 q
6 Z- `' }. S" B) T$ l
6 Z4 L0 M6 E' d- a" `; f
说明:ND20在老版本打不开。 |