X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fswfdump.c;h=df55e9be31fcc26174ace1713fd6b99dee2e57ee;hb=89174f31c34e6a727efe9600b4a81c90dc63e23a;hp=c1a003ba272083e99eb32dbdc88e716d68d5b90c;hpb=f44e1c274f5d0b5d9c950c65e1b5c22fb5b34d1b;p=swftools.git diff --git a/src/swfdump.c b/src/swfdump.c index c1a003b..df55e9b 100644 --- a/src/swfdump.c +++ b/src/swfdump.c @@ -7,6 +7,10 @@ This file is distributed under the GPL, see file COPYING for details */ +#ifdef HAVE_SYS_STAT_H +#include +#endif +#include #include #include #include "../lib/rfxswf.h" @@ -56,6 +60,9 @@ int main (int argc,char ** argv) { SWF swf; TAG*tag; +#ifdef HAVE_SYS_STAT_H + struct stat statbuf; +#endif int f; char prefix[128]; prefix[0] = 0; @@ -76,12 +83,27 @@ int main (int argc,char ** argv) close(f); exit(1); } + +#ifdef HAVE_SYS_STAT_H + fstat(f, &statbuf); + if(statbuf.st_size != swf.FileSize) + fprintf(stderr, "Error: Real Filesize (%d) doesn't match header Filesize (%d)", + statbuf.st_size, swf.FileSize); +#endif + close(f); + printf("[HEADER] File version: %d\n", swf.FileVersion); + printf("[HEADER] File size: %d\n", swf.FileSize); + printf("[HEADER] Frame rate: %f\n",swf.FrameRate/256.0); + printf("[HEADER] Frame count: %d\n",swf.FrameCount); + printf("[HEADER] Movie width: %.3f\n",(swf.MovieSize.xmax-swf.MovieSize.xmin)/20.0); + printf("[HEADER] Movie height: %.3f\n",(swf.MovieSize.ymax-swf.MovieSize.ymin)/20.0); + tag = swf.FirstTag; while(tag) { - printf("[%02x] %9d %s%s", tag->id, tag->len, prefix, getTagName(tag)); + printf("[%03x] %9d %s%s", tag->id, tag->len, prefix, getTagName(tag)); if(isDefiningTag(tag)) { U16 id = GetDefineID(tag); printf(" defines id %04x", id);