X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfaction.c;h=d897c1073f3ec33ea63adc0d36c4f50900ec0a88;hb=ba50f044fa8cb1504465a9795cd7865cba934e60;hp=3906f6c482edbdc5f5641891f0e864f03ab1d10a;hpb=58e7d89f8115525c32a0e3f3f4e5501c6a17186d;p=swftools.git diff --git a/lib/modules/swfaction.c b/lib/modules/swfaction.c index 3906f6c..d897c10 100644 --- a/lib/modules/swfaction.c +++ b/lib/modules/swfaction.c @@ -38,7 +38,7 @@ f: frame (word) u: url (string) t: target (string) l: label (string) -C: constant pool header (byte) +C: constant pool header (word) c: constant pool entry (string) s: skip (byte) (number of actions) m: method (byte) swf_GetUrl2:(0=none, 1=get, 2=post)/GotoFrame2:(1=play) @@ -251,6 +251,8 @@ int OpAdvance(char c, U8*data) return 1+4; //float } else if (type == 2) { return 1+0; //NULL + } else if (type == 3) { + return 1+0; //Undefined } else if (type == 4) { return 1+1; //register } else if (type == 5) { @@ -261,6 +263,8 @@ int OpAdvance(char c, U8*data) return 1+4; //int } else if (type == 8) { return 1+1; //lookup + } else if (type == 9) { + return 1+2; //lookup 16 } else return 1; break; } @@ -312,7 +316,7 @@ void swf_DumpActions(ActionTAG*atag, char*prefix) while(atag) { char*indent = &spaces[sizeof(spaces)-1-countpos*4]; - U8 poollen = 0; + U16 poollen = 0; for(t=0;top) break; @@ -350,7 +354,7 @@ void swf_DumpActions(ActionTAG*atag, char*prefix) #endif } break; case 'C': { - poollen = *data; + poollen = data[0]+256*data[1]; entry = 0; printf("(%d entries)", poollen); } break; @@ -371,7 +375,7 @@ void swf_DumpActions(ActionTAG*atag, char*prefix) num = (data[s++]); //num num += (data[s++])*256; for(t=0;top) break; @@ -563,7 +576,7 @@ int swf_ActionEnumerate(ActionTAG*atag, char*(*callback)(char*), int type) } } break; case 'C': { - poollen = (*data); + poollen = (data[0]+256*data[1]); } break; case 'o': { } break; @@ -964,6 +977,12 @@ ActionTAG* action_PushNULL(ActionTAG*atag) *(U8*)atag->tmp = 2; //NULL return atag; } +ActionTAG* action_PushUndefined(ActionTAG*atag) +{ + atag = swf_AddActionTAG(atag, ACTION_PUSH, 0, 1); + *(U8*)atag->tmp = 3; //Undefined + return atag; +} ActionTAG* action_PushBoolean(ActionTAG*atag, char c) { atag = swf_AddActionTAG(atag, ACTION_PUSH, 0, 2); @@ -985,6 +1004,14 @@ ActionTAG* action_PushLookup(ActionTAG*atag, U8 index) *(U8*)&atag->tmp[1] = index; return atag; } +ActionTAG* action_PushLookup16(ActionTAG*atag, U16 index) +{ + atag = swf_AddActionTAG(atag, ACTION_PUSH, 0, 3); + *(U8*)atag->tmp = 9; //lookup + *(U8*)&atag->tmp[1] = index; + *(U8*)&atag->tmp[2] = index>>8; + return atag; +} ActionTAG* action_PushString(ActionTAG*atag, char*str) { int l = strlen(str);