请看一下这个
) k* p6 ^! ~- K# Nhttps://www.chinaavg.com/read.php?tid=209789 f; i" T# S& {' P
- s* I l1 H; ^5 u2 h这是一段解vbf文件的代码, F4 Q2 ^; _( V8 \3 {9 y
int vxbg_extract(FILE *fd) {9 q+ }( L1 {$ @! l ~5 @
u32 offset,
4 I6 U5 N: ~8 Z; L6 |4 C/ v+ W start,+ @- _6 [, o8 i9 u/ @1 S
size;8 ^( K$ ?" r6 {% J# Z8 N$ {
int i,; w8 H8 u& }- x2 u4 U) `
c,
$ c) O8 a: D5 E9 W7 L) J: a4 C Z files = 0;/ ?2 h& I9 |/ [7 x; _3 P! x4 R
u8 fname[BUFFSZ + 1];9 @/ F, @8 _, [; ?* X
( F7 {' Y+ q) i4 F: @5 i$ t
fseek(fd, 4, SEEK_SET);& L4 x* m# U+ A6 X5 b) e
if(FREAD(&offset, 4, fd)) goto quit;
) ^' i9 A' C# c& M: k7 ]# t
: R, \- P0 X7 y+ T x) O) `6 V2 d. H4 b printf("\\n"
+ f: k5 z) j1 m " offset size filename\\n"
5 Y& t# N5 \7 |# K' H- \* H# Y " ----------------------------\\n");
8 a3 {3 {. d: H: U+ t9 o/ |1 a
# w' E7 t* t, n r1 Y& [ offset += 8;9 X& ]' g, t- v8 R9 a& x0 Z5 E
for(start = offset; ftell(fd) < start; offset += size) {
& N% m, y! I6 ^, u for(i = 0; i < BUFFSZ; i++) {
/ ]+ N* M! t8 {9 O! V/ E c = fgetc(fd);3 y* E/ O' u) B) h" ?: [
fname = c;. q+ S" U- i6 S0 D" u% S: g% ]
if(!c) break;
& b8 s, r% N& x: \/ b if(c < 0) goto quit;* A# S8 k+ O: Q* D( E; \! n9 Q
}
0 O! T3 B: a1 ^2 G4 e' q- h5 L6 B if(FREAD(&size, 4, fd)) goto quit;! s+ m+ N$ J) M5 d4 `
- G* L1 {3 E, E8 x- f0 ` printf(" %08x %-10u %s\\n", offset, size, fname);- T6 a5 j4 T0 t0 i! {9 z' S4 l
if(!listonly) getfile(fd, fname, size, offset);
- R( n% Y2 ^- Q9 J) N1 x files++;( ^2 j; J4 b `- V/ K0 B& x4 a: l
}
, V9 ]% \6 {2 _- bquit:
8 \% c( R0 G1 h& X% n0 w. M return(files);! w7 h' Q, u1 i, g/ ?0 U* D6 H4 K
} |