From 9ee97b0258700c746404edfcd9640a0a327eb21f Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Wed, 11 Feb 2009 18:30:06 +0100 Subject: [PATCH] added support for multiname type 0x1d --- lib/as3/pool.c | 22 +++++++++++++++++++--- lib/as3/pool.h | 3 ++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/as3/pool.c b/lib/as3/pool.c index d2963b0..54609d0 100644 --- a/lib/as3/pool.c +++ b/lib/as3/pool.c @@ -189,8 +189,7 @@ char* namespace_tostring(namespace_t*ns) else if(!*s) sprintf(string, "[%s]\"\"", access, s); else - sprintf(string, "[%s]", access, s); - + sprintf(string, "[%s]%s", access, s); free(s); return string; } @@ -567,7 +566,7 @@ char* multiname_tostring(multiname_t*m) strcat(mname,s); free(s); } else { - fprintf(stderr, "Invalid multiname type: %02x\n", m->type); + return strdup(""); } free(name); return mname; @@ -1144,6 +1143,12 @@ void pool_read(pool_t*pool, TAG*tag) for(t=1;tdata[tag->pos+s]); + printf("\n");*/ + m.type = swf_GetU8(tag); if(m.type==0x07 || m.type==0x0d) { int namespace_index = swf_GetU30(tag); @@ -1165,6 +1170,17 @@ void pool_read(pool_t*pool, TAG*tag) } else if(m.type==0x1b || m.type==0x1c) { int namespace_set_index = swf_GetU30(tag); m.namespace_set = (namespace_set_t*)array_getkey(pool->x_namespace_sets, namespace_set_index); + } else if(m.type==0x1d) { + int v1 = swf_GetU30(tag); + int v2 = swf_GetU30(tag); + int v3 = swf_GetU30(tag); + //printf("%02x %02x %02x\n", v1, v2, v3); + m.type = 0x07; + m.namespace_set = 0; + m.name = pool_lookup_string(pool, v1); + m.ns = pool_lookup_namespace(pool, v2); + /* not sure what to do with v3- + it's definitely not a namespace */ } else { printf("can't parse type %d multinames yet\n", m.type); } diff --git a/lib/as3/pool.h b/lib/as3/pool.h index 30ae0cf..0d0cec5 100644 --- a/lib/as3/pool.h +++ b/lib/as3/pool.h @@ -119,7 +119,8 @@ typedef enum multiname_type RTQNAMEA=0x10, RTQNAMELA=0x12, MULTINAMEA=0x0E, - MULTINAMELA=0x1C + MULTINAMELA=0x1C, + MULTIX=0x1D } multiname_type_t; char* access2str(int type); -- 1.7.10.4