X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fswfdump.c;h=7ce9773502f78cf3521c78596e4399476bb0263a;hb=01cdd1cf0539dbacbd795e6ef0ea54e324c464db;hp=616dbbfe23888714d1704bc6aa0d5b05126b908b;hpb=f5c49841296c5533b500fc89b010f5529b1b9824;p=swftools.git diff --git a/src/swfdump.c b/src/swfdump.c index 616dbbf..7ce9773 100644 --- a/src/swfdump.c +++ b/src/swfdump.c @@ -34,12 +34,14 @@ char * filename = 0; to detect errors in the file. (i.e. ids which are defined more than once */ char idtab[65536]; +char * indent = " "; int action = 0; int html = 0; int xy = 0; int showtext = 0; int hex = 0; +int used = 0; struct options_t options[] = { @@ -49,6 +51,7 @@ struct options_t options[] = {"Y","height"}, {"r","rate"}, {"e","html"}, + {"u","used"}, {"v","verbose"}, {"V","version"}, {"d","hex"}, @@ -90,6 +93,10 @@ int args_callback_option(char*name,char*val) hex = 1; return 0; } + else if(name[0]=='u') { + used = 1; + return 0; + } else { printf("Unknown option: -%s\n", name); } @@ -111,6 +118,7 @@ void args_callback_usage(char*name) printf("\t-a , --action\t\t Disassemble action tags\n"); printf("\t-t , --text\t\t Show text data\n"); printf("\t-d , --hex\t\t Print hex output of tag data, too\n"); + printf("\t-u , --used\t\t Show referred IDs for each Tag\n"); printf("\t-V , --version\t\t Print program version and exit\n"); } int args_callback_command(char*name,char*val) @@ -619,6 +627,23 @@ int main (int argc,char ** argv) else printf("\n"); } + + if(tag->len && used) { + int num = swf_GetNumUsedIDs(tag); + int* used; + int t; + if(num) { + used = (int*)malloc(sizeof(int)*num); + swf_GetUsedIDs(tag, used); + printf("%s%suses IDs: ", indent, prefix); + for(t=0;tpos = used[t]; + printf("%d%s", swf_GetU16(tag), tlen && hex) { int t; printf(" %s-=> ",prefix);