最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。
0 z2 C4 j8 e0 ^0 C/ I$ o; \, n现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。
1 w( k' m. ~* L
; q- N! i4 d% X& e* ^; [% c---------------------------- # |; Y g- h8 G. T5 z
工具更新1
, q0 N# C1 a W9 r---------------------------- ) R; o; ?4 L$ W8 X( l
well I have some good news.
2 E3 G. [! K l$ j0 U; g7 |) |yesterday and today I have worked on the script parser and the results are so good that my beta version already works.
2 Z9 U; L' E3 Y* \! `& U8 ~3 [* d- q
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.
2 ]7 n: p) ?( Y; uobviously 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.
4 u5 g) T# `$ U* |, M- Sthen the input BMS script no longer needs the semicolon ';' and the file number which are now optional. ' Q" o: ] _" |5 G+ Z
: z. s7 v3 @/ h' f0 S: ~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. ' X, R. }0 J0 D$ [! A) W9 m
: i3 n9 N$ B/ U I) E' ~# S' B" l
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):
' ]+ X7 }4 P: o% W% c6 ~2 o
N! T' p+ C- w) X; P# Y- `Code:
% O# Y# k G6 i. R9 x; b! z. `# didstring SBPK 8 J4 P8 E3 b% l1 Z
get FILES long / J7 a' m" ^, H( R- ~
: p" F5 U" _& z3 \& Q; q ?/ K
savepos NAMES_OFFSET - K, |6 x0 l: T9 T6 s t b
for i = 1 to FILES 1 z, q4 G$ u8 F& b: L: [. g. o
get FNAMESZ long " J9 g7 ~. F% ~, k
getdstring FNAME FNAMESZ
- E. D. H' p6 z& {% U1 u1 e* `6 g4 h% aget OFFSET long % s8 i* U5 a# x- ?, L/ R1 p
get SIZE long 5 {6 m" u' u; t) V
next i
: \! _( ?9 S: E( S( y1 t) { j% D, F5 v, Q7 r- i1 ^
savepos FILES_OFFSET
9 @* V$ P* z: O& L. b$ M2 W, h$ Zgoto NAMES_OFFSET / N3 m" M8 z2 {# Y o" j& L
for i = 1 to FILES U' {5 R- W* h. m# W
get FNAMESZ long
! s: B! e x' k/ W6 egetdstring FNAME FNAMESZ 5 Q. U( _0 t- c, Y1 p% ^
get OFFSET long
6 M) v% s6 x( u' X/ I: P1 \get SIZE long 1 W1 J0 `3 j1 T( I8 D, b
math OFFSET += FILES_OFFSET 6 H* l0 ]4 c, C) G5 F# o
3 z$ d8 ~2 p8 G; R( u
filexor 0xcc & r+ q! Y- g7 H, I3 t+ P
log FNAME OFFSET SIZE 0 0 # l) D$ T$ ]" R Y4 [$ }% q
filexor 0 0 s X! k9 g x5 y! G
next i k' s+ t2 ?/ q. }
as visible it's files are XORed with the byte 0xcc.
: Z) U K4 \" B1 |) V1 c
& J( R( e1 y7 V" B \, Snow the link to the beta version: # p! ~9 J& T3 H. Y- G; A% s1 \
+ r1 @9 C) ` e+ ^; C" G* ihttp://aluigi.org/papers/quickbms.zip
2 H$ w2 h+ Y0 P6 }4 z' n0 O. }& I6 T; u, d5 O: Y
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. ) n1 ] A' t8 h( l5 l8 j
2 R7 j' e" k1 V# S1 IP.S.: the usage is very simple and the following are some examples: W6 m8 a3 ]8 l u( ^
listing the files in the archive common.spk of outcry:
5 D4 t4 o" I6 N, H8 Q2 CCode:
7 }% Q' |( y4 f; Dquickbms -l outcry.bms c:\common.spk .
) m6 L3 f$ \( @0 S. U" A/ y) W' R; R4 r
extracting the files in c:\folder: 7 p. l$ S6 p% y5 ~
Code:
1 x+ x/ L$ }) I9 L, Aquickbms outcry.bms c:\common.spk c:\folder $ Z! m% ?2 J i
4 b* b# ^5 U( P. nextracing or listing only the dds files: 9 E* j8 Y: D% {& J
Code: # b0 F8 b0 p* h% R+ a+ c
quickbms -f "*.dds" outcry.bms c:\common.spk c:\folder
! y5 N! R, i0 U: ]/ `' `* k
% ?2 c5 U T0 x1 B% j1 c; \---------------------------- ?1 \% f/ V% B* {
工具更新2
& t4 b* e' \- s& }: A d----------------------------
4 ^: o9 a# [; P: q$ w! {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:
( l3 J& w* H4 G4 f7 ]- N k& J2 e1 T+ d% B7 r
Code:get OFFSET asize - U n. v) T+ w- S3 Z0 P6 C. z
math OFFSET -= 4
2 C% ~, z: u+ G3 w/ D/ ~9 N" wgoto OFFSET
4 d& h5 f8 Q8 D4 U4 w7 @get OFFSET long
. U8 q, o/ G9 {& f6 }0 S" Dgoto OFFSET ) s- c# ?# J5 \; O: ]
..."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. w5 t! n4 J0 ~2 w3 r
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. ! y: ^, o% E! c& C
8 |( i" c3 o% ^: W. {' I7 Voh and about the "repacking" question, no it will be not supported w% ]1 L( j# w) O: @8 x- K( i
3 P3 L' M9 r* T+ L- 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) - d/ x) h3 {5 t. T' D. f- T
3 f) ?/ X' {" Z9 a0 Y, b+ h8 v6 \
-----------------------------------------------------
C2 N9 ^. v( W( g6 |4 e8 B2009.4.17 更新 & b2 D; U: o* y( {' v3 C& |
老外发布了最新的0.1.2 版。
7 u _1 g ^* o% k----------------------------------------------------- + `# L/ ~+ ?9 @* t0 w
2009.4.18 更新
8 P& K. K. G8 f" S1 @老外发布了最新的0.1.2a 版。
3 O9 @4 k% ` t8 e-----------------------------------------------------
* w2 L9 u5 y( o" E' ?; o1 {8 H2009.5.10 更新 & t: f7 L, W7 m* n5 r# t
老外发布了最新的0.2.0 版。3 D. x# z# l) p9 z) w7 F' j7 ^
----------------------------------------------------- # E' l4 q9 N0 ?: U
2009.5.10 更新 . h6 G2 C* E5 z3 T& o% N% Z
老外发布了最新的0.2.3a版。
/ Z" `) a' s" B* ]; T
* C# E, V+ V: w0 J5 K8 ^
2 _" h8 L+ o0 U" k/ W+ o8 U/ L说明:ND20在老版本打不开。 |