最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。
+ \2 `- \- e, P7 }现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。
' \4 _# p; F1 {' p( @ a0 ~: F; w/ F" R$ h
----------------------------
6 I. b# }! `3 f% z* }工具更新1 2 P" j2 O( A& \: ?$ G# W9 f) X
----------------------------
# h+ \4 D" Z. s8 ^2 M( |well I have some good news. ' w* M5 o" V& L& F
yesterday and today I have worked on the script parser and the results are so good that my beta version already works. 4 ~- X# H F! A3 d
1 ] A) F- e4 y! ]8 MI 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.
2 K @ f8 E) N& O6 _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.
6 C# H2 C- e* J5 D/ _then the input BMS script no longer needs the semicolon ';' and the file number which are now optional.
: q/ N, L+ ^2 R1 q. X% O, D9 @7 N# w
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.
+ {/ T f& w5 k9 Z6 d! j8 Z; I
" x5 O1 ?! Z( c* [# k1 g. mabout 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):
* ]( ~) ?6 o6 a- G, d* E# \" b
8 O- b7 d; R8 {- l: uCode:
, `( A D( R4 \' {idstring SBPK
) M D7 @7 v& E% K0 P5 g0 l& l' O" Eget FILES long
, T" T( A, K% _3 }5 W5 a" g& {' x/ [: s3 d. G$ \8 I
savepos NAMES_OFFSET 9 H! A9 V6 _ t8 r
for i = 1 to FILES 7 R5 }2 i i f* h6 M& \/ C8 f1 m
get FNAMESZ long
( ~3 L! d; j _ Y* e& lgetdstring FNAME FNAMESZ , \% m: k% Y d) ~& u3 h5 A+ V
get OFFSET long
( Y; M" R6 I& G/ e+ |" Nget SIZE long
& D' S. H! b V! \2 gnext i
& _$ ~6 Z6 h+ s! J: k8 B7 k A7 H7 c' w% k
savepos FILES_OFFSET 5 e- h; W. _' U0 Z5 m v
goto NAMES_OFFSET # u( Y4 R8 }8 G; @1 n5 E( s
for i = 1 to FILES 0 ^3 `7 N. B v. }
get FNAMESZ long 5 ?' K% r$ o" J% [- V. v
getdstring FNAME FNAMESZ
0 J5 F' x/ ~7 {7 r3 mget OFFSET long 1 z( e. x t o8 X" {
get SIZE long
: _9 q7 w6 x6 M& ]math OFFSET += FILES_OFFSET
& M! e# i/ [" |$ _- v
. S. w3 p: ~5 e. mfilexor 0xcc ' k ]% Q1 v [# d
log FNAME OFFSET SIZE 0 0 ; V+ X1 `' Q8 z1 Z/ V7 _
filexor 0
; u( M5 f; g6 s% L% `next i 5 Q, j- t5 D$ V7 S# G/ U
as visible it's files are XORed with the byte 0xcc. + H4 p" I% ]. T- g+ z* p
, L/ M4 U1 K; N, X
now the link to the beta version: ; m2 X7 e4 X. o/ ]4 Y, D4 O
# {: F6 P8 U; L! g) [3 \, Ahttp://aluigi.org/papers/quickbms.zip ) q5 Y: r6 s. B9 [2 V+ K r
; X. T) @% G# ^5 g. e! J: ?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. ! V/ u6 A0 H* L$ {1 h2 G9 C2 q
2 ?8 ^. @; K' N; C' Q. LP.S.: the usage is very simple and the following are some examples:
+ E7 d% R& d& e2 |3 Ylisting the files in the archive common.spk of outcry: ) V) c% Y- _/ |( T* k- w" V- \; J
Code: 6 n2 @8 i" C5 D1 m1 L7 h
quickbms -l outcry.bms c:\common.spk . $ ] W# [' z+ z' m$ P2 q) g
* s" V7 f* [ M" x5 b" X' B
extracting the files in c:\folder:
% v2 c% n) c/ m& m8 `- j8 K9 }Code: 6 d9 |. D+ V, O- x0 r9 W% d% ^
quickbms outcry.bms c:\common.spk c:\folder ' _( y7 Y, |; Z; Y8 A
z3 t9 o) {# w$ Y
extracing or listing only the dds files: - W6 K6 e# v y9 {, z7 G
Code: ! H; k; Q' S$ T R8 m) }
quickbms -f "*.dds" outcry.bms c:\common.spk c:\folder
* E% G5 w) g+ I2 }
2 z0 {' F9 [. s7 q2 l9 ?5 u---------------------------- ~: _" }3 U; D* [. `$ [* |6 a+ N
工具更新2 ' V8 l+ d s |* I; U% @3 D3 J
---------------------------- ; v5 d: B( F& V1 @6 j: 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: . m6 Z0 i( S+ j5 g' V0 t; g
" B O/ g k, e; g; b; A
Code:get OFFSET asize $ `$ T- C1 t# g9 c0 \0 p
math OFFSET -= 4
3 s) n0 D4 N9 Ygoto OFFSET
' h0 W. p( i* v- y Hget OFFSET long / F1 E# ?5 ]+ i1 F( ~1 P$ K( \0 p0 N
goto OFFSET 4 x7 d7 y$ m' f7 h: M+ }1 a/ R
..."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. f/ g) w( X0 p2 t/ u/ x# j
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. $ l4 [/ a% u5 I2 {$ {: Y
; t2 e3 w$ e; ^/ @- o
oh and about the "repacking" question, no it will be not supported
0 ~: e, K! M9 V" }
7 n& b! G" `3 h+ c: S: f; s*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)
0 G3 v, [2 D e# Q2 G! w! z7 ^) ^; \ i2 F
----------------------------------------------------- ! N; g& i! @5 k( i/ w
2009.4.17 更新
, j8 [% f2 d3 l+ i% H: a老外发布了最新的0.1.2 版。 6 I h1 F: ?' ~) E* }
-----------------------------------------------------
6 F2 y: o8 t0 m. ~2 m2 b2009.4.18 更新
4 o# |5 T- H# I1 t老外发布了最新的0.1.2a 版。8 a& M$ j# b+ P( N+ n9 |
-----------------------------------------------------
- ~& s4 _# ]* ~- {2 O' `& m8 Q2009.5.10 更新 6 H8 R# M' u( s& E" l% Z
老外发布了最新的0.2.0 版。
( _5 o4 \" X s: E----------------------------------------------------- ' [* A4 T7 D2 o& `
2009.5.10 更新 * L$ e X, m. V/ m: T' S0 s8 y
老外发布了最新的0.2.3a版。1 Y) }6 L6 n5 E4 N7 S
1 V7 F; _8 a; \4 H
: F3 B& p3 h* h6 f$ k) a说明:ND20在老版本打不开。 |