From: kramm Date: Thu, 6 Jun 2002 10:07:13 +0000 (+0000) Subject: * fix a bug with -u, which caused wrong IDs to be displayed X-Git-Tag: release-0-4-0~48 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=84b771ec731d95fd65541076e6b8da430f620e2b * fix a bug with -u, which caused wrong IDs to be displayed * display FreeCharacter info. --- diff --git a/src/swfdump.c b/src/swfdump.c index 4902873..a4d9c5e 100644 --- a/src/swfdump.c +++ b/src/swfdump.c @@ -393,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]; @@ -583,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)); } @@ -690,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);