最近老外开发了一个很不错的通用命令行解包器,以后制作解包器只要简单的写几句脚本就行了。
/ n5 E+ U) f( [6 j: B- r现在老外还在不断完善之中,有兴趣的朋友来测试一下吧。 5 \4 S9 S8 q2 I- b, A
0 Z: a& ^" R3 c! K# h----------------------------
4 {- I3 M8 _* \( y3 m工具更新1 0 R( \, u# ^; Q G+ y9 Y/ \; M* r4 }
---------------------------- " v2 W0 A; f. g& f ]& @6 G
well I have some good news.
, N' O4 x9 P! H4 G! f) Syesterday and today I have worked on the script parser and the results are so good that my beta version already works. 9 O9 N. }9 I( U0 e; j
: B$ A8 l: g6 L' E* {5 r" lI 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. ' S! z' [2 K4 _( j) _( x
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. ( Z# t4 @1 y3 c. w
then the input BMS script no longer needs the semicolon ';' and the file number which are now optional.
" p) T, a- M; c& J7 k
) M. }' Z: l. ^- Snote 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.
/ k9 p4 R2 b+ u/ a) Q- V/ O1 q( h. j# |+ K
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):
% m- w" G6 w* B6 T- D7 H7 }* N& o, |# M1 D5 R5 V2 y
Code: 1 I) b" L J( v( R) `; n8 P9 S
idstring SBPK 8 J0 { J+ X6 V7 I" s
get FILES long
5 N8 C9 w* c7 Z' \/ F' C4 W, s( i/ L3 v% \
savepos NAMES_OFFSET 0 y: s; _5 a( L# l
for i = 1 to FILES $ S7 L t0 T& @. _% m$ X& ^- y
get FNAMESZ long 9 {1 x# u t' b+ ?
getdstring FNAME FNAMESZ
r# e c" B9 ?$ Q, z h' |get OFFSET long
& |2 y; |% y2 G2 @+ d) y) nget SIZE long # l! i" \' E( H2 j8 f; f9 P0 b
next i ; N7 i' Y5 C+ y: Z
5 Y( O5 D+ Y# ~3 i6 X: A
savepos FILES_OFFSET
/ j- s6 t1 V @6 dgoto NAMES_OFFSET
" ?; Y4 {2 J9 V+ e+ vfor i = 1 to FILES
5 C7 O4 M4 O7 j1 iget FNAMESZ long 0 i; H- T0 g* n. [/ ^
getdstring FNAME FNAMESZ
. F( e# F+ Z& V; D1 @get OFFSET long
f3 E, g5 ]0 W; G' gget SIZE long 4 P6 p$ u1 i3 v( g; g, b
math OFFSET += FILES_OFFSET
/ X* ~' o# [* P" V$ p7 z1 {# Q& A' @) R9 D8 I" `3 @# g
filexor 0xcc 2 a8 B d; j, r' U4 w4 U9 _
log FNAME OFFSET SIZE 0 0
& T+ @8 _& b0 z! q5 afilexor 0 2 k w2 ~) h' H+ i6 b) w+ `
next i
, K# t4 u: M; U' f) c; }as visible it's files are XORed with the byte 0xcc. - f1 q4 |& H) E p6 @6 u$ E9 [
4 K& z8 ~: u- _2 i [! Gnow the link to the beta version:
- R0 }. ~3 `% v% V# Y4 S7 C! L* l% }3 B% c* p* y- D5 J
http://aluigi.org/papers/quickbms.zip " i) [4 S% b' L3 F% ^. z& Q
' C( z! p1 ]6 Z& x5 l% k* [* _& Q! a
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.
/ m: ^/ t% T1 s5 }
4 K, J, o+ _4 E8 A' d \" S9 A* dP.S.: the usage is very simple and the following are some examples:
: a* s3 G- p3 R) ~9 l& C9 ]listing the files in the archive common.spk of outcry: ( _7 M8 w9 ^, r! ~1 O Z$ f7 }2 u
Code:
$ f0 W3 q! }3 {; I/ Z! U1 Vquickbms -l outcry.bms c:\common.spk . * `* V. f2 \- {' ~5 ?1 V2 N6 F# q
. x3 d. K! G0 G' {* fextracting the files in c:\folder: $ z% v: x& x/ Q+ K
Code: - m2 v4 J7 |& t7 r7 i
quickbms outcry.bms c:\common.spk c:\folder
# u2 h3 s9 ?" S. q9 _7 `9 {) a/ m. M
extracing or listing only the dds files:
" q7 S" P w+ E- z# c$ o1 w, E* OCode:
" m0 l- j/ V8 xquickbms -f "*.dds" outcry.bms c:\common.spk c:\folder
, ]/ }1 l8 J' H+ w. I" w5 ]4 s5 _- X% |
---------------------------- / w5 O6 Y6 U! K
工具更新2
J9 C# C3 E5 e7 r0 P4 j----------------------------
- d7 S& {2 a6 \4 ~' A+ ~. q* M4 eif 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:
1 ~; m! g$ G7 e+ r5 T0 W0 Z7 T" h. x& U# T- z6 p+ w
Code:get OFFSET asize
# [) @8 h. E+ d! nmath OFFSET -= 4 ! Z% j8 M# }+ W; @
goto OFFSET
6 X& C8 y) @$ |2 y; uget OFFSET long ! V+ c2 f3 N& d# A( M6 g
goto OFFSET # |5 y1 U% N! b \( ^
..."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.
8 u6 Z7 Y& t" C& panyway 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. ' E: G% i8 T9 p6 H/ u, ^
% h, B* E4 L+ }4 @7 j
oh and about the "repacking" question, no it will be not supported
; Q, B) m3 `9 c6 {. v
$ [. Z" C, }0 y! u8 D*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)
' L4 J6 Q! U; ~
; y5 ]) j% x# \! v) t4 |----------------------------------------------------- % I' `$ k' w7 I k. G& ^3 f: l
2009.4.17 更新
2 v; R) ^4 R; l. q9 K6 k老外发布了最新的0.1.2 版。
r3 u' t- x" g$ _2 F% w( {-----------------------------------------------------
, T. I3 m( C7 O$ x* z4 i; q5 _% g2009.4.18 更新 " p/ E! ~1 W1 n, h$ f) M5 K, p& i
老外发布了最新的0.1.2a 版。
" P4 i2 T) | X4 |! N-----------------------------------------------------
- Y$ q. G# q4 }$ g+ V2009.5.10 更新
' ?& j/ U; R& X, ]老外发布了最新的0.2.0 版。
% h0 V5 B& R0 i/ O-----------------------------------------------------
, R2 T, o1 V1 j0 h0 p3 F7 Z4 Y2009.5.10 更新
- N8 i, P, {. G6 f) a8 k老外发布了最新的0.2.3a版。
( F% M) j6 _% i8 U5 _/ V
4 A& @/ v/ `/ L: P$ e! r9 Y) L$ ?: g) d. A! n3 ?
说明:ND20在老版本打不开。 |