放上老外发布的FPAK文件解包器。! F: I8 E- a. V9 l
) B6 u% q0 P- Z$ i# Tibet Quest7 U% W8 F! R! b. ~
# script for QuickBMS http://aluigi.org/papers.htm#quickbms
) p. n) ~ g$ l1 c: f& m3 kquickbmsver 0.2.1 # needed for the "binary" type used for MEMORY_FILE27 {) m! n7 Z* u& K6 _
idstring FPAK* Z0 v8 _* r: z3 Q- C
get DUMMY long
7 M u# d) y# l/ f5 L0 w, u) uget DUMMY long" a' r6 g, \# ]0 e6 |8 ~
get FILES long
[- z E- ]8 v1 Tset INFO_SIZE long FILES
w/ u* I1 e. B3 z4 Emath INFO_SIZE *= 73* Y& o) M3 m& `' A
savepos INFO_OFFSET5 L3 X8 R1 C* _
log MEMORY_FILE INFO_OFFSET INFO_SIZE
7 O% S4 B2 W& m# Uset VAR_A long INFO_SIZE4 K3 d, M& `3 r- `8 Y9 }
math VAR_A -= 0x27& j* {& e6 }- j, m
set VAR_C long 0xad. _ ~" I# d" k; A$ H
set VAR_D long 0x6f5 T! b. p) ]. m6 }% ^
for i = 0 < INFO_SIZE/ P& V" ^6 Z" b% q$ m6 B0 q7 Q
math VAR_A += VAR_C5 p+ t: U& S0 o* o0 I
math VAR_C += VAR_A
5 r; r9 Y* r/ @' F7 O! { math VAR_D += VAR_C- {& A: p. |; e, }) G& Z
math VAR_D ^= VAR_A: q9 p6 l; d9 R* ?. h* O6 ]) S
math VAR_A &= 0xff # not needed
7 }* }( ~4 Q+ N- D7 ^ math VAR_C &= 0xff # not needed
( r+ S9 u" p9 G5 {7 ^; L math VAR_D &= 0xff # not needed
" k' i) j+ Z' Z! A, o getvarchr BYTE MEMORY_FILE i* R E/ F2 d. ]- s6 b; `$ E
math BYTE ^= VAR_D
7 w3 A6 K8 _5 D0 }! _ putvarchr MEMORY_FILE i BYTE
, ]6 u) V# T; K0 y* o! Lnext i
9 N8 |/ Q, Z) B5 a1 C5 W, E! [set MEMORY_FILE2 binary "\x7B\x47\x85\xF0\x91\x8B\x2C\x94\xA7\x55\x3A\xF6\x17\xB1\xC2\x06\x6B\x64\x28\x8A\x86\x09\xCE\xA23 E* H. _8 T O i: j+ [# G0 p; n
\x9F\x58\xDE\x46\xAE\x24\x63\x74\x69\x9D\xFB\xFD\x6E\x50\xE0\x12\x57\x1C\x08\xBC\x1B\xD0\xD9\x81\x01\xE4\xC7\x07\x88\x16\x76* H) |. Y+ e% ]5 H5 F
\x49\x23\x05\xAD\x51\x38\x78\x45\x89\x5D\xCF\x2E\x20\x26\xB6\x3B\xC3\xEB\xEF\x22\xA0\x19\xC6\x6A\xBB\xA1\x41\xF5\xCB\x737 V: m9 G& L+ Z3 j( u+ j& X$ O
\xED\xEA\x9B\x90\xA9\x2D\xAA\x15\x27\xDA\x37\xF9\x40\xA4\xE8\x67\xBF\x1E\xB8\xAC\x60\x53\xD2\x54\x1D\x68\xF7\x4F\x00\xC4
; B4 j7 d6 Z" N( ~. \$ l* C+ K* S\x5E\x33\x29\x14\x0C\x3F\x62\xFC\x93\xC1\xB0\xB4\x9C\x1F\x72\xAB\x11\x18\x87\xB5\xE9\xF1\x59\xF8\x36\x5C\xA3\xE3\x79
4 s+ w) h( @% h6 u& l F9 [\x8C\x2F\x0A\xBA\x44\xD8\xC8\xA6\x2A\x03\xCA\x1A\x10\x35\xF3\x77\xD7\x31\xB9\x97\x43\xF2\x3D\xDF\x21\x52\x65\xB2\x34
. v) B- r" I+ \) m\x6F\x7F\xD3\x2B\xC0\xCC\x6D\x75\xDD\x0D\x13\xDB\xE5\x02\xEE\xB3\xF4\xC9\xFE\x66\x5B\xEC\x7D\x83\x5F\xCD\x8E\xE6\x84\xD4/ ^; L6 L' Z5 f$ h3 |& U
\xBE\x32\xD1\xA5\x56\xC5\x70\x9E\x0B\x9A\x80\x6C\x5A\xE7\x7A\x7C\xB7\x7E\xFA\xDC\x0F\xE1\x4B\x4C\x8F\x4A\x04\x4E\xA8- V C1 R: n; x4 ]
\xFF\x3C\xD6\x0E\x95\x39\x82\x42\x3E\x61\x96\x48\x8D\xAF\x30\xE2\x71\x4D\xD5\x25\x92\xBD\x99\x98" y% {. o Y% D4 q/ l6 d2 |% f
for i = 0 < FILES: i; h3 z) e' @# K" U
getdstring NAME 0x41 MEMORY_FILE
7 a# ^4 b& I/ Z8 v get OFFSET long MEMORY_FILE
9 H9 ]/ N+ R. G# i& k9 v get SIZE long MEMORY_FILE( k# k( L) ]% ]; V% A9 d! h
log MEMORY_FILE3 OFFSET SIZE: }6 E2 h) C9 L. R0 ~# r
for j = 0 < SIZE
1 {. m2 e# y/ v) ^! ~$ I getvarchr BYTE MEMORY_FILE3 j2 k/ Q! ^% \( f! \& L6 p5 G
getvarchr BYTE MEMORY_FILE2 BYTE3 A) B' j$ e' y4 A0 M& m
putvarchr MEMORY_FILE3 j BYTE
[6 Z) W Y: I* R, }3 w+ X next j
% N6 Y2 a/ j% S. a* `* X0 J) | log NAME 0 SIZE MEMORY_FILE3
- Q! O1 H; e" e+ S$ @next i |