X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfdump.c;h=a4d9c5e2893f693024f6890c0e74c3b1e2a673a1;hb=71d34b3ecce0fdd7bfcc80b0825897fe9b9f0405;hp=f2752d1505c695c729fdc7d5d5b59a47fde74a44;hpb=46afeff995a5c1e7ec32b6770a8aa5e05e14a2e2;p=swftools.git diff --git a/src/swfdump.c b/src/swfdump.c index f2752d1..a4d9c5e 100644 --- a/src/swfdump.c +++ b/src/swfdump.c @@ -249,6 +249,23 @@ void handleText(TAG*tag) printf("\n"); swf_FontExtract_DefineTextCallback(-1,0,tag,4, textcallback); } + +void handleDefineBits(TAG*tag) +{ + U16 id; + U8 mode; + U16 width,height; + int bpp; + id = swf_GetU16(tag); + mode = swf_GetU8(tag); + width = swf_GetU16(tag); + height = swf_GetU16(tag); + printf(" image %dx%d",width,height); + if(mode == 3) printf(" (8 bpp)"); + else if(mode == 4) printf(" (16 bpp)"); + else if(mode == 5) printf(" (32 bpp)"); + else printf(" (? bpp)"); +} void handleEditText(TAG*tag) { @@ -376,6 +393,22 @@ void fontcallback2(U16 id,U8 * name) fontnum++; } +void hexdumpTag(TAG*tag, char* prefix) +{ + int t; + printf(" %s-=> ",prefix); + for(t=0;tlen;t++) { + printf("%02x ", tag->data[t]); + if((t && ((t&15)==15)) || (t==tag->len-1)) + { + if(t==tag->len-1) + printf("\n"); + else + printf("\n %s-=> ",prefix); + } + } +} + void dumperror(const char* format, ...) { char buf[1024]; @@ -385,7 +418,8 @@ void dumperror(const char* format, ...) vsprintf(buf, format, arglist); va_end(arglist); - printf("==== Error: %s ====\n", buf); + if(!html && !xy) + printf("==== Error: %s ====\n", buf); } int main (int argc,char ** argv) @@ -470,14 +504,15 @@ int main (int argc,char ** argv) } printf("\n" " \n" " \n" " \n" " \n" - " \n" @@ -564,6 +599,9 @@ int main (int argc,char ** argv) else if(tag->id == ST_REMOVEOBJECT2) { printf(" removes object from depth %04d", swf_GetDepth(tag)); } + else if(tag->id == ST_FREECHARACTER) { + printf(" frees object %04d", swf_GetPlaceID(tag)); + } else if(tag->id == ST_STARTSOUND) { printf(" starts id %04d", swf_GetPlaceID(tag)); } @@ -605,7 +643,12 @@ int main (int argc,char ** argv) if(!issprite) {mainframe++; framelabel = 0;} } - if(tag->id == ST_DEFINEEDITTEXT) { + if(tag->id == ST_DEFINEBITSLOSSLESS || + tag->id == ST_DEFINEBITSLOSSLESS2) { + handleDefineBits(tag); + printf("\n"); + } + else if(tag->id == ST_DEFINEEDITTEXT) { handleEditText(tag); printf("\n"); } @@ -666,7 +709,7 @@ int main (int argc,char ** argv) swf_GetUsedIDs(tag, used); printf("%s%suses IDs: ", indent, prefix); for(t=0;tpos = used[t]; + swf_SetTagPos(tag, used[t]); printf("%d%s", swf_GetU16(tag), tlen && hex) { - int t; - printf(" %s-=> ",prefix); - for(t=0;tlen;t++) { - printf("%02x ", tag->data[t]); - if((t && ((t&15)==15)) || (t==tag->len-1)) - { - if(t==tag->len-1) - printf("\n"); - else - printf("\n %s-=> ",prefix); - } - } + hexdumpTag(tag, prefix); } tag = tag->next; fflush(stdout);