static int hex = 0;
static int used = 0;
static int bbox = 0;
+static int cumulative = 0;
static struct options_t options[] = {
{"h", "help"},
html = 1;
return 0;
}
+ else if(name[0]=='c') {
+ cumulative = 1;
+ return 0;
+ }
else if(name[0]=='E') {
html = 1;
xhtml = 1;
printf("-D , --full Show everything. Same as -atp\n");
printf("-V , --version Print version info and exit\n");
printf("-e , --html Print out html code for embedding the file\n");
+ printf("-E , --xhtml Print out xhtml code for embedding the file\n");
printf("-a , --action Disassemble action tags\n");
printf("-t , --text Show text fields (like swfstrings).\n");
printf("-s , --shapes Show shape coordinates/styles\n");
if(glyphs[t] >= fonts[font]->numchars /*glyph is in range*/
|| !fonts[font]->glyph2ascii /* font has ascii<->glyph mapping */
) a = glyphs[t];
- else
- a = fonts[font]->glyph2ascii[glyphs[t]];
+ else {
+ if(fonts[font]->glyph2ascii[glyphs[t]])
+ a = fonts[font]->glyph2ascii[glyphs[t]];
+ else
+ a = glyphs[t];
+ }
} else {
a = glyphs[t];
}
{
U16 id = swf_GetU16(tag);
U8 flags = swf_GetU8(tag);
- int compression = (flags>>4)&3;
+ int compression = (flags>>4)&7;
int rate = (flags>>2)&3;
int bits = flags&2?16:8;
int stereo = flags&1;
if(compression == 0) printf("Raw ");
else if(compression == 1) printf("ADPCM ");
else if(compression == 2) printf("MP3 ");
+ else if(compression == 3) printf("Raw little-endian ");
+ else if(compression == 6) printf("ASAO ");
else printf("? ");
if(rate == 0) printf("5.5Khz ");
if(rate == 1) printf("11Khz ");
case 0x10: case 0x12:
sprintf(stylebuf, "GRADIENT (%d steps)", style->gradient.num);
break;
- case 0x40:
+ case 0x40: case 0x42:
/* TODO: display information about that bitmap */
- sprintf(stylebuf, "BITMAPt %d", style->id_bitmap);
+ sprintf(stylebuf, "BITMAPt%s %d", (style->type&2)?"n":"", style->id_bitmap);
/* TODO: show matrix */
break;
- case 0x41:
+ case 0x41: case 0x43:
/* TODO: display information about that bitmap */
- sprintf(stylebuf, "BITMAPc %d", style->id_bitmap);
+ sprintf(stylebuf, "BITMAPc%s %d", (style->type&2)?"n":"", style->id_bitmap);
/* TODO: show matrix */
break;
default:
char* framelabel = 0;
char prefix[128];
int filesize = 0;
+ int filepos = 0;
prefix[0] = 0;
memset(idtab,0,65536);
//tag = tag->next;
//continue;
}
- if(swf_TagGetName(tag)) {
- printf("[%03x] %9ld %s%s", tag->id, tag->len, prefix, swf_TagGetName(tag));
+ if(!name) {
+ name = "UNKNOWN TAG";
+ }
+ if(cumulative) {
+ filepos += tag->len;
+ printf("[%03x] %9ld %9ld %s%s", tag->id, tag->len, filepos, prefix, swf_TagGetName(tag));
} else {
- printf("[%03x] %9ld %sUNKNOWN TAG %03x", tag->id, tag->len, prefix, tag->id);
+ printf("[%03x] %9ld %s%s", tag->id, tag->len, prefix, swf_TagGetName(tag));
}
- if(tag->id == ST_FREECHARACTER) {
- U16 id = swf_GetU16(tag);
- idtab[id] = 0;
- }
-
if(swf_isDefiningTag(tag)) {
U16 id = swf_GetDefineID(tag);
printf(" defines id %04d", id);
printf("\n");
}
}
+
+ if(tag->id == ST_FREECHARACTER) {
+ U16 id;
+ swf_SetTagPos(tag, 0);
+ id = swf_GetU16(tag);
+ idtab[id] = 0;
+ }
if(tag->len && hex) {
hexdumpTag(tag, prefix);