git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
10feac6
)
swfdump: fix segfault and endless loop; improved action code output
author
boehme
<boehme>
Mon, 3 Dec 2001 22:23:49 +0000
(22:23 +0000)
committer
boehme
<boehme>
Mon, 3 Dec 2001 22:23:49 +0000
(22:23 +0000)
lib/modules/swfaction.c
patch
|
blob
|
history
src/swfdump.c
patch
|
blob
|
history
diff --git
a/lib/modules/swfaction.c
b/lib/modules/swfaction.c
index
652fd6d
..
014730b
100644
(file)
--- a/
lib/modules/swfaction.c
+++ b/
lib/modules/swfaction.c
@@
-13,6
+13,8
@@
#include "../rfxswf.h"
#include "../rfxswf.h"
+#define MAX_LOOKUP 1024 // make cross references in dumps
+
struct Action
{
int version;
struct Action
{
int version;
@@
-229,7
+231,7
@@
int OpAdvance(char c, char*data)
return 1+4; //int
} else if (type == 8) {
return 1+1; //lookup
return 1+4; //int
} else if (type == 8) {
return 1+1; //lookup
- }
+ } else return 1;
break;
}
}
break;
}
}
@@
-242,8
+244,18
@@
void swf_DumpActions(ActionTAG*atag, char*prefix)
int t;
U8*data;
char* cp;
int t;
U8*data;
char* cp;
- if(!prefix)
- prefix="";
+ int entry = 0;
+
+#ifdef MAX_LOOKUP
+
+ char * lookup[MAX_LOOKUP];
+ memset(lookup,0x00,sizeof(lookup));
+
+#endif
+
+ if (!prefix)
+ prefix="";
+
while(atag)
{
U8 poollen = 0;
while(atag)
{
U8 poollen = 0;
@@
-278,9
+290,14
@@
void swf_DumpActions(ActionTAG*atag, char*prefix)
} break;
case 'c': {
printf(" String:\"%s\"", data);
} break;
case 'c': {
printf(" String:\"%s\"", data);
+#ifdef MAX_LOOKUP
+ if (entry<MAX_LOOKUP)
+ lookup[entry++] = strdup(data);
+#endif
} break;
case 'C': {
poollen = *data;
} break;
case 'C': {
poollen = *data;
+ entry = 0;
printf("(%d entries)", poollen);
} break;
case 's': {
printf("(%d entries)", poollen);
} break;
case 's': {
@@
-312,6
+329,10
@@
void swf_DumpActions(ActionTAG*atag, char*prefix)
printf(" int:%d", *(int*)value);
} else if (type == 8) {
printf(" Lookup:%d", *value);
printf(" int:%d", *(int*)value);
} else if (type == 8) {
printf(" Lookup:%d", *value);
+#ifdef MAX_LOOKUP
+ if (lookup[*value])
+ printf(" (\"%s\")",lookup[*value]);
+#endif
} else {
printf(" UNKNOWN[%02x]",type);
}
} else {
printf(" UNKNOWN[%02x]",type);
}
@@
-341,6
+362,10
@@
void swf_DumpActions(ActionTAG*atag, char*prefix)
printf("\n");
atag = atag->next;
}
printf("\n");
atag = atag->next;
}
+
+#ifdef MAX_LOOKUP
+ for (t=0;t<MAX_LOOKUP;t++) if (lookup[t]) free(lookup[t]);
+#endif
}
static const char TYPE_URL = 1;
}
static const char TYPE_URL = 1;
diff --git
a/src/swfdump.c
b/src/swfdump.c
index
95c57d6
..
81dae0c
100644
(file)
--- a/
src/swfdump.c
+++ b/
src/swfdump.c
@@
-335,7
+335,7
@@
void handlePlaceObject2(TAG*tag, char*prefix)
swf_ActionFree(a);
}
if(globalflags) // should go to sterr.
swf_ActionFree(a);
}
if(globalflags) // should go to sterr.
- printf("%s ERROR: unsatisfied handlerflags: %02x", globalflags);
+ printf("ERROR: unsatisfied handlerflags: %02x", globalflags);
} else {
printf(" has action code\n");
}
} else {
printf(" has action code\n");
}