X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfdump.c;h=92cce4f58e6881d102329d8025353bc9032eb5fa;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hp=f2bddccd8a58d51f9b7820873fb93c6529e4f9c9;hpb=6b0eae5874aee62fa747aa98ad79d4eae97067e4;p=swftools.git diff --git a/lib/modules/swfdump.c b/lib/modules/swfdump.c index f2bddcc..92cce4f 100644 --- a/lib/modules/swfdump.c +++ b/lib/modules/swfdump.c @@ -7,9 +7,23 @@ Copyright (c) 2001 Rainer Böhme - This file is distributed under the GPL, see file COPYING for details + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -*/ + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include "../rfxswf.h" void swf_DumpHeader(FILE * f,SWF * swf) { if (!f) f = stderr; @@ -22,9 +36,22 @@ void swf_DumpHeader(FILE * f,SWF * swf) void swf_DumpMatrix(FILE * f,MATRIX * m) { if (!f) f = stderr; - fprintf(f,"[%08x][%08x]\n",m->sx,m->r1); + /*fprintf(f,"[%08x][%08x]\n",m->sx,m->r1); fprintf(f,"[%08x][%08x]\n",m->r0,m->sy); - fprintf(f," %08x, %08x\n",m->tx,m->ty); + fprintf(f," %08x, %08x\n",m->tx,m->ty);*/ + fprintf(f,"[%08x][%08x] %5.2f %5.2f %5.2f\n",m->sx,m->r1, m->sx/65536.0,m->r1/65536.0, m->tx/20.0); + fprintf(f,"[%08x][%08x] %5.2f %5.2f %5.2f\n",m->r0,m->sy, m->r0/65536.0,m->sy/65536.0, m->ty/20.0 ); + fprintf(f," %08x, %08x \n",m->tx,m->ty); +} + +void swf_DumpGradient(FILE * f,GRADIENT * g) +{ if (!f) f = stderr; + fprintf(f, "%d gradient steps\n", g->num); + int t; + for(t=0;tnum;t++) { + RGBA c = g->rgba[t]; + fprintf(f, "%d) %02x%02x%02x%02x at %d\n", t, c.r,c.g,c.b,c.a, g->ratios[t]); + } } void swf_DumpTag(FILE * f,TAG * t) @@ -37,6 +64,59 @@ void swf_DumpTag(FILE * f,TAG * t) fprintf(f,"\n"); } +void swf_DumpSWF(FILE * f, SWF*swf) +{ + TAG* tag = swf->firstTag; + fprintf(f, "vvvvvvvvvvvvvvvvvvvvv\n"); + while(tag) { + printf("%8d %s\n", tag->len, swf_TagGetName(tag)); + tag = tag->next; + } + fprintf(f, "^^^^^^^^^^^^^^^^^^^^^\n"); +} + +void swf_DumpFont(SWFFONT * font) +{ + printf("ID: %d\n", font->id); + printf("Version: %d\n", font->version); + printf("name: %s\n", font->name); + printf("characters: %d\n", font->numchars); + printf("biggest mapped ascii value: %d\n", font->maxascii); + printf("layout: %s\n", font->layout?"yes":"no"); + if(font->layout) + { + printf(" ascent:%d\n", font->layout->ascent); + printf(" descent:%d\n", font->layout->descent); + printf(" leading:%d\n", font->layout->leading); + printf(" bounds: (not shown)\n"); + printf(" kerning records:%d\n", font->layout->kerningcount); + printf(" kerning records: (not shown)\n"); + } + printf("style: %d\n", font->style); + printf("encoding: %d\n", font->encoding); + printf("language: %d\n", font->language); +} + +void swf_DumpShape(SHAPE2*shape2) +{ + SHAPELINE*l = shape2->lines; + while(l) { + if(l->type == moveTo) { + //printf("fill %d/%d line %d\n", l->fillstyle0, l->fillstyle1, l->linestyle); + printf("moveTo %.2f,%.2f (fill0:%d fill1:%d line:%d)\n", l->x/20.0, l->y/20.0, l->fillstyle0, l->fillstyle1, l->linestyle); + } + if(l->type == lineTo) { + //printf("fill %d/%d line %d\n", l->fillstyle0, l->fillstyle1, l->linestyle); + printf("lineTo %.2f,%.2f (fill0:%d fill1:%d line:%d)\n", l->x/20.0, l->y/20.0, l->fillstyle0, l->fillstyle1, l->linestyle); + } + if(l->type == splineTo) { + //printf("fill %d/%d line %d\n", l->fillstyle0, l->fillstyle1, l->linestyle); + printf("splineTo %.2f,%.2f %.2f,%.2f (fill0:%d fill1:%d line:%d)\n", l->sx/20.0, l->sy/20.0, l->x/20.0, l->y/20.0, l->fillstyle0, l->fillstyle1, l->linestyle); + } + l = l->next; + } +} + char* swf_TagGetName(TAG*tag) { switch(tag->id) @@ -53,8 +133,8 @@ char* swf_TagGetName(TAG*tag) return "PLACEOBJECT"; case ST_REMOVEOBJECT: return "REMOVEOBJECT"; - case ST_DEFINEBITS: - return "DEFINEBITS"; + case ST_DEFINEBITSJPEG: + return "DEFINEBITSJPEG"; case ST_DEFINEBUTTON: return "DEFINEBUTTON"; case ST_JPEGTABLES: @@ -69,6 +149,10 @@ char* swf_TagGetName(TAG*tag) return "DEFINEEDITTEXT"; case ST_DOACTION: return "DOACTION"; + case ST_DOABC: + return "DOABC"; + case ST_RAWABC: + return "RAWABC"; case ST_DEFINEFONTINFO: return "DEFINEFONTINFO"; case ST_DEFINESOUND: @@ -119,6 +203,8 @@ char* swf_TagGetName(TAG*tag) return "SOUNDSTREAMHEAD2"; case ST_DEFINEMORPHSHAPE: return "DEFINEMORPHSHAPE"; + case ST_DEFINEMORPHSHAPE2: + return "DEFINEMORPHSHAPE2"; case ST_DEFINEFONT2: return "DEFINEFONT2"; case ST_TEMPLATECOMMAND: @@ -127,8 +213,63 @@ char* swf_TagGetName(TAG*tag) return "GENERATOR3"; case ST_EXTERNALFONT: return "EXTERNALFONT"; - case ST_REFLEX: + case ST_EXPORTASSETS: + return "EXPORTASSETS"; + case ST_SYMBOLCLASS: + return "SYMBOLCLASS"; + case ST_DEFINEBINARY: + return "DEFINEBINARY"; + case ST_IMPORTASSETS: + return "IMPORTASSETS"; + case ST_ENABLEDEBUGGER: + return "ENABLEDEBUGGER"; + case ST_DOINITACTION: + return "DOINITACTION"; + case ST_DEFINEMOVIE: + return "DEFINEMOVIE"; + case ST_DEFINEVIDEOSTREAM: + return "DEFINEVIDEOSTREAM"; + case ST_VIDEOFRAME: + return "VIDEOFRAME"; + case ST_DEFINEFONTINFO2: + return "DEFINEFONTINFO2"; + case ST_FILEATTRIBUTES: + return "FILEATTRIBUTES"; + case ST_IMPORTASSETS2: + return "IMPORTASSETS2"; + case ST_DEFINESCALINGGRID: + return "DEFINESCALINGGRID"; + case ST_DEFINESHAPE4: + return "DEFINESHAPE4"; + case ST_DEFINEFONT3: + return "DEFINEFONT3"; + case ST_DEFINEFONTALIGNZONES: + return "DEFINEFONTALIGNZONES"; + case ST_DEFINEFONTNAME: + return "DEFINEFONTNAME"; + case ST_CSMTEXTSETTINGS: + return "CSMTEXTSETTINGS"; + case ST_FREEALL: + return "FREEALL"; + case ST_MX4: + return "MX4"; + case ST_SCRIPTLIMITS: + return "SCRIPTLIMITS"; + case ST_SETTABINDEX: + return "SETTABINDEX"; + case ST_ENABLEDEBUGGER2: + return "ENABLEDEBUGGER2"; + case ST_PLACEOBJECT3: + return "PLACEOBJECT3"; + case ST_METADATA: + return "METADATA"; + case ST_SCENEDESCRIPTION: + return "SCENEDESCRIPTION"; + + case ST_REFLEX: return "REFLEX"; + case ST_GLYPHNAMES: + return "GLYPHNAMES"; } return 0; }