最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。 . m) f- D2 Y# r; Z, L
现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。 # } m+ ?. n2 C7 P; ^' [' `
' N; P1 z) D: @4 ?# C4 V
---------------------------- o% ?7 K8 h5 i; Y( t0 f
工具更新1
% o( d; H$ ~8 Z---------------------------- 5 S9 ~: k8 s+ X6 w5 q
well I have some good news.
. R/ l7 M8 H6 t7 L" W7 U1 yyesterday and today I have worked on the script parser and the results are so good that my beta version already works. ( l$ I. v- E! a2 n$ j# F
5 }: `3 B( o/ p; e
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. / }. J! c+ J7 Z9 y1 R5 _
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. & P! V9 M, x1 x; z
then the input BMS script no longer needs the semicolon ';' and the file number which are now optional. . c0 F- d# A }: R5 @' ?
, t n2 N, |+ O% x6 @' ?+ Pnote 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.
- p5 d G6 q6 \- C4 p' `$ q
h: L4 S3 B3 G" S. ?* u0 Pabout 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): & b5 L" K# F9 m* y
' t. J7 ~1 m, V* o! T- v7 f. U/ KCode:
3 G* i K4 {' {4 didstring SBPK . M& v! M" q) M$ R0 K6 B
get FILES long - r6 s! S; d3 w" \2 D7 r6 Q! @
9 L5 l+ w/ f& U8 h' {. asavepos NAMES_OFFSET 9 C# |% A% |7 @( E
for i = 1 to FILES
% E7 Q2 Z' n3 Y; _get FNAMESZ long % K {; I$ E. o, F/ ? ~
getdstring FNAME FNAMESZ # P$ F# N1 L; Z7 k3 y$ c# `3 L
get OFFSET long 1 }1 G, z! I6 e7 u3 s- Y; u
get SIZE long
: N4 S6 L6 Z: Z, C" p( y; Inext i + z& y6 M7 c( @# Z. K7 K
6 ?6 f6 a6 \1 l: O
savepos FILES_OFFSET
) q3 j* W0 y4 i" S" t4 ?goto NAMES_OFFSET , m8 r3 p/ R/ B. ?! J
for i = 1 to FILES
$ e. p" J! O6 r* j9 U, h! Lget FNAMESZ long + w/ u) U2 V T
getdstring FNAME FNAMESZ 5 W, E0 N7 v, s+ o; z8 i- [
get OFFSET long 4 e; P9 L0 y* q; P0 n
get SIZE long
! L. y. K' M+ Z2 O& }math OFFSET += FILES_OFFSET 5 Z$ d0 u( u! f/ }
3 k& _9 }5 r! `8 T B5 M
filexor 0xcc ! u% I$ M, R3 [& h
log FNAME OFFSET SIZE 0 0 0 ^6 `# v7 l5 m$ Z9 }' J0 ?" f; r
filexor 0 / z6 X+ `9 O" U0 z
next i
; M& x1 @5 d" s% A8 Y. has visible it's files are XORed with the byte 0xcc. & d$ ~1 R& k; @# t6 z" A+ ^
* i# z, H2 V6 X% Y
now the link to the beta version:
" L9 h: i$ c: Y4 V
0 v7 X2 J+ |" uhttp://aluigi.org/papers/quickbms.zip
% f W, E a5 m" [
3 r0 d7 A5 v8 L7 T E" V- Bobviously 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.
6 W, u3 M( Z! a. |& D6 m a6 x6 o5 p w Z$ i7 y) r, i' O
P.S.: the usage is very simple and the following are some examples: 7 K8 r5 |( b4 Q7 p7 Q
listing the files in the archive common.spk of outcry: 7 u) B# [( w2 Y' i1 V" E
Code: ! y: h* l$ q1 z5 y4 c6 ?" k( M
quickbms -l outcry.bms c:\common.spk . 3 Z: x1 {' r- s N. s
# f6 P# M6 s; y2 } Fextracting the files in c:\folder:
* O# X2 B; Z, |Code:
/ K7 `! I/ `% V% P5 Oquickbms outcry.bms c:\common.spk c:\folder
[6 A S3 |* [) [0 D! f: y9 e k6 @) n6 I/ ~
extracing or listing only the dds files: ! w I* R4 A$ X' u" Z
Code:
8 Q& {0 A: T/ \3 S( E5 o" Lquickbms -f "*.dds" outcry.bms c:\common.spk c:\folder
5 z4 s0 X6 S4 |. [; ^7 s# k- {9 j1 }0 U# N" [% M5 a/ T0 ]0 ^
----------------------------
I# w* S) W2 x0 \3 P工具更新2
: t+ @" f/ D( H0 f: g$ Z9 a---------------------------- & ]3 f x. l: J, w8 A* \$ j
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: % g! E( \4 S) r1 [& s5 q( q
% E8 z8 Y+ l4 K6 k: U( ?2 J
Code:get OFFSET asize ( `: S3 R8 R& ]+ x( X
math OFFSET -= 4 2 `4 Q4 Z. e& ]9 Z8 V8 k2 z) V
goto OFFSET 7 h( p" u' U2 n1 `
get OFFSET long
. F. U: s* j! S. L0 l/ e+ D8 i$ Mgoto OFFSET
# e* h! e& s+ _3 c. T& v' i..."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. $ l. p( r" [# [. Z' {# R( v
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.
5 L4 ~/ A9 w. t. s" A5 R9 \
e; @* M ^ N" {% b3 q: `, s: hoh and about the "repacking" question, no it will be not supported
) d0 G4 J: ]1 ]! [ ^" w. [" H7 V, T/ f1 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) % m" T' C0 u# K/ e9 T
6 F% v1 P" S6 O4 I, r+ P0 x
-----------------------------------------------------
5 R, x" R4 b0 p1 |) a$ k2009.4.17 更新 & |) t' ]8 h/ q8 I9 `. x
老外发布了最新的0.1.2 版。
. F, g1 s1 i" \* X-----------------------------------------------------
. m' j4 U% m$ R2 C6 m, B2009.4.18 更新
4 C, V4 v o7 \2 f4 H8 M! M老外发布了最新的0.1.2a 版。3 Z. U2 e; r# I5 U0 Q
-----------------------------------------------------
/ {' ]6 r5 p' B) }2009.5.10 更新 : ^2 u% i$ C. \: |, n c x
老外发布了最新的0.2.0 版。
, F* [" P+ V" c8 Z3 f, Q-----------------------------------------------------
* o! t1 j. b1 @3 @2009.5.10 更新 : x1 V" m; i* c
老外发布了最新的0.2.3a版。! \8 T8 z" C! E2 @5 l' D+ g \
) t6 h/ R$ q/ E& O2 N) r8 I* C& I" v( U& F
说明:ND20在老版本打不开。 |