From 13a4fd22f3cfc2369a5687b6b0de05886605eb31 Mon Sep 17 00:00:00 2001 From: kramm Date: Tue, 30 Oct 2001 10:52:33 +0000 Subject: [PATCH] added SetAction routine --- lib/modules/swfaction.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/lib/modules/swfaction.c b/lib/modules/swfaction.c index b0b7390..8609686 100644 --- a/lib/modules/swfaction.c +++ b/lib/modules/swfaction.c @@ -88,7 +88,6 @@ r: register (byte) {4,"Trace", 0x26, ""}, //-1 {4,"GetTime", 0x34, ""}, //+1 {4,"RandomNumber", 0x30, ""}, //-1,+1 - {5,"Modulo", 0x3f,""}, {5,"BitAnd", 0x60,""}, {5,"BitLShift", 0x63,""}, @@ -133,15 +132,15 @@ ActionTAG* GetActions(TAG*tag) U8 op = 1; int length; ActionTAG tmp; - ActionTAG*atag = &tmp; + ActionTAG*action = &tmp; U8*data; while(op) { int pos; - atag->next = (ActionTAG*)malloc(sizeof(ActionTAG)); - atag->next->prev = atag; - atag->next->next = 0; - atag = atag->next; + action->next = (ActionTAG*)malloc(sizeof(ActionTAG)); + action->next->prev = action; + action->next->next = 0; + action = action->next; op = GetU8(tag); if(op<0x80) @@ -157,13 +156,28 @@ ActionTAG* GetActions(TAG*tag) } else { data = 0; } - atag->op = op; - atag->len = length; - atag->data = data; + action->op = op; + action->len = length; + action->data = data; + action->parent = tag; } return tmp.next; } +void SetActions(TAG*tag, ActionTAG*action) +{ + while(action) + { + SetU8(tag, action->op); + if(action->op & 128) + SetU16(tag, action->len); + + SetBlock(tag, action->data, action->len); + + action = action->next; + } +} + /* TODO: this should be in swfdump.c */ void DumpActions(ActionTAG*atag, char*prefix) { -- 1.7.10.4