请看一下这个" y1 A7 z, N, ?4 f% z
https://www.chinaavg.com/read.php?tid=20978! `5 z! V, \& o
5 F' T" }- F+ Q5 U$ Q这是一段解vbf文件的代码& E( {& u" L. [+ z- S$ ?
int vxbg_extract(FILE *fd) {4 I1 w- w* { G
u32 offset," d5 o: V: H) h9 [: j: \2 P
start,6 t R3 s/ w) `3 H: c
size;% N2 U% p5 X! L# Y. ~+ b1 ]
int i,
/ y! Y" j2 A% H9 [5 F0 u c,; l6 _& o/ E& N0 C9 N
files = 0;
4 Y2 Y" x2 b3 U u8 fname[BUFFSZ + 1];4 R% {: S* U( Q' W
6 G, Z7 E0 D6 L fseek(fd, 4, SEEK_SET);3 Y( R: m2 [. |; \: G8 R
if(FREAD(&offset, 4, fd)) goto quit;. ?1 d1 i9 U$ ^1 d
, O1 s+ B9 Z( r: E printf("\\n"$ }1 ]! t( ~4 O$ P {& D8 K
" offset size filename\\n"# H2 g k. g. q& ^
" ----------------------------\\n");
6 o/ n1 W2 B# s
5 V2 {& A# g& J, d- X" f3 a offset += 8;
, w, N& Y+ g, u% O for(start = offset; ftell(fd) < start; offset += size) {
: A8 f. Q1 }' l5 c( q, X& n$ w' W for(i = 0; i < BUFFSZ; i++) {
2 s% ?1 W1 f' V1 t c = fgetc(fd);" P# L( Z9 R3 @8 I( m
fname = c; q/ L& G- y5 x1 K
if(!c) break;# O: O; a# g2 B* E: N
if(c < 0) goto quit;% q$ x0 C& g& C3 [+ I7 w
}
j% }9 h) \* @4 _+ I2 [ if(FREAD(&size, 4, fd)) goto quit;' g6 }4 O1 [# O9 J" o/ [9 F
( }. p& j# H9 D. I4 ? printf(" %08x %-10u %s\\n", offset, size, fname);, C/ j& g, x8 r$ W8 I
if(!listonly) getfile(fd, fname, size, offset);
$ _. w9 S/ D6 T0 M files++;
. s' f* S0 K0 u' I# f }+ T% o) ]' o" N7 ~3 y/ S) h3 U
quit:
0 Y5 O' ]+ C( { return(files);7 G; L$ u; W0 U. [! w; u
} |