最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。 8 s t; B' @" ~1 y1 I
现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。
2 _& }& |* E+ V0 a# l) k7 u; B/ K
: @- D/ |0 K) T----------------------------
7 _0 x! Q9 b- N( X工具更新1
1 \ ^* }) I; q$ k8 B+ C---------------------------- " X# X# M4 ]& \0 w( M8 O) ?& k
well I have some good news.
]( o% R9 @7 s$ o/ Wyesterday and today I have worked on the script parser and the results are so good that my beta version already works. ( G: v \8 _# `
4 w- _) A% y$ g- H0 n" f
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. # }: v( r* o0 b0 d& e: a! ?! s
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.
+ V6 N s- h+ t& Wthen the input BMS script no longer needs the semicolon ';' and the file number which are now optional.
; [9 e0 y3 ^+ B; S6 a$ F& u; B( u) E$ h! Q+ P1 m0 i7 P
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.
1 d& f+ x0 e9 [* N- N
( L7 V" w3 A; P6 tabout 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):
, c4 ~. }0 C5 b) x7 S- y T+ {# u8 ?/ }. A" U/ W
Code: * A9 D4 V, }) B' Q
idstring SBPK 7 R/ s) d( ~- ~1 c: X; I6 T/ n) }
get FILES long
9 Y% ~- L2 O0 Z. O* h9 _) v8 Z4 `% n0 A% I( j( z) `) A! n
savepos NAMES_OFFSET 3 ]& G4 }+ @, e9 ^( a) P; ], t
for i = 1 to FILES 0 Z* h e; [) ?8 A( j
get FNAMESZ long
2 a: d$ J$ H% ?$ \' f# a, sgetdstring FNAME FNAMESZ
! ~+ N9 q+ v* X- C8 @% eget OFFSET long
5 }1 V; {. t. v, J% Uget SIZE long
; i2 U( K3 K0 f# Q6 _1 H2 q" Lnext i
1 i) q2 q, U& `# z4 {5 m6 c4 [ _: F
savepos FILES_OFFSET
! s: Q1 W8 P ^goto NAMES_OFFSET
+ S, Y3 K( G/ }0 u' Lfor i = 1 to FILES 0 P/ \; V! F n" Z* t$ @& z' d! z) }
get FNAMESZ long
' L- P0 ~8 P0 s* x! D# @5 D8 F& }getdstring FNAME FNAMESZ
: d. H, J1 h1 Z4 Lget OFFSET long
$ D* C% w' t+ ^* ]' Z% N+ {0 tget SIZE long
! d1 M4 g# g0 [math OFFSET += FILES_OFFSET
# `. X/ r5 j: I" E( }+ N' F. s# D3 s) b8 X! m
filexor 0xcc
' G9 B; F* Y7 j. y2 Ulog FNAME OFFSET SIZE 0 0
; i+ q+ M& |7 w5 j) c4 y5 pfilexor 0 . E. ~6 L7 j9 z0 y: ~/ w7 v
next i
: b1 z2 U6 f2 M& Z4 O! s! W+ U3 las visible it's files are XORed with the byte 0xcc. ( S0 H$ O( ?. E1 F% r# M7 ~8 O
) j# P2 }) I9 A# a+ _
now the link to the beta version: * P5 Z/ C2 j# f" w$ p# U
- H0 V% @: \9 U) v1 _ ~5 Ehttp://aluigi.org/papers/quickbms.zip ) W; y9 _# d9 s( J3 d3 D
6 y/ E: Q3 f8 f' k" }0 o( ?
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. 1 u" B' L' ?5 h, [) t* }' _
8 z# C! R- t4 K5 [' |- ZP.S.: the usage is very simple and the following are some examples: ' y5 x$ J# P0 d. i
listing the files in the archive common.spk of outcry:
: M( L1 @: [3 c, ]' D- s5 ]' _Code: , d2 A; w3 [' B% b% X, V
quickbms -l outcry.bms c:\common.spk . ( w! v; r; l4 V& Y8 c, A4 V
/ _ Q; F( {) p
extracting the files in c:\folder:
" ~/ Q6 {( V m- L- M9 B5 DCode: # `7 M* e. E2 ]. D
quickbms outcry.bms c:\common.spk c:\folder 0 T) U2 C o- J$ j1 u
* w# ?5 v0 T9 N! N) h A
extracing or listing only the dds files:
! K$ f" m/ r; r* y$ \! l0 s WCode:
2 Q6 q9 J$ b9 q7 w1 Q7 Equickbms -f "*.dds" outcry.bms c:\common.spk c:\folder
4 x3 L$ s k H+ {1 V, Q4 h3 g$ g, h/ V1 G5 V* r Q L
----------------------------
8 w; ^/ ^: G( c2 w" T- s/ d工具更新2
- b' f( f! o2 J$ i7 K9 @7 R---------------------------- . n& w1 E# [$ E
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:
% m% Q- b0 Z( i6 }, D' T
, X; e6 [$ U9 Q9 uCode:get OFFSET asize % Q' H- ?* y$ o% U- R
math OFFSET -= 4
: D2 A9 n a5 ^goto OFFSET 3 g! Y6 `/ d5 J5 ?/ k: `! D
get OFFSET long
: ~. E+ X' |9 S3 l5 Mgoto OFFSET
6 f5 E: q j, S k8 f..."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. ' |& {, a" @7 o; [
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. . h1 y! V/ k3 c1 q) a
# _4 X, P" _. M3 L& k* Poh and about the "repacking" question, no it will be not supported
, w9 u; Y' S F' L$ E) L
e3 s. w! {/ ]: j*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)
/ E! F6 y7 q: t7 c2 Z9 F3 D1 X
8 L8 T2 I3 y6 K0 v' v0 \-----------------------------------------------------
( `' O1 Z6 m( r! a; E2009.4.17 更新
5 Z0 u7 e" h h. V老外发布了最新的0.1.2 版。
9 m# V3 J& }2 H: q7 a! N& @- w) T- }----------------------------------------------------- # _' f' a3 Z& h, S
2009.4.18 更新 . L8 ^1 T! h6 D
老外发布了最新的0.1.2a 版。+ Y: Z4 x, i6 z$ r* w
-----------------------------------------------------
1 J5 ^0 |, c; \2009.5.10 更新 6 A1 W# F* ]' f- p
老外发布了最新的0.2.0 版。
# D" }' @3 n: Y6 J1 ~----------------------------------------------------- ; w( d! w6 M- x2 B, l
2009.5.10 更新
/ [, ^' |/ J% D k老外发布了最新的0.2.3a版。
+ B7 T: l, H) r$ T7 I1 U. g; v/ c* i e- l6 {! X$ T* ~: ^
; n. h( J& Z! V3 p9 ?, }' b
说明:ND20在老版本打不开。 |