Пример #1
0
 static function dumpActionTag($tag, $frame, $opts)
 {
     echo "    Actions: (in frame {$frame})";
     if ($tag->code == 59) {
         // DoInitAction
         echo " SpriteID=" . $tag->tag->_spriteId;
     }
     echo "\n";
     $basic_block = array();
     // self::decomposePush($tag);
     for ($i = 0; $i < count($tag->tag->_actions); $i++) {
         $action = $tag->tag->_actions[$i];
         if (isset($tag->tag->_labels[$i])) {
             self::dumpBasicBlock($basic_block, $i, $opts);
             $basic_block = array();
             echo "    (LABEL" . $tag->tag->_labels[$i] . "):\n";
         }
         $action_str = IO_SWF_Type_Action::getCodeName($action['Code']);
         if (isset($tag->tag->_branches[$i])) {
             self::dumpBasicBlock($basic_block, $i, $opts);
             $basic_block = array();
             echo "\t{$action_str}";
             echo " (LABEL" . $tag->tag->_branches[$i] . ")\n";
         } else {
             $basic_block[] = $action;
         }
     }
     if (count($basic_block) != 0) {
         self::dumpBasicBlock($basic_block, $i, $opts);
     }
     if (isset($tag->tag->_labels[$i])) {
         echo "    (LABEL" . $tag->tag->_labels[$i] . "):\n";
     }
 }
Пример #2
0
}
echo "SWF Version:{$version}  Check Version:{$check_version}\n";
foreach ($swf->_tags as $tag) {
    $code = $tag->code;
    $tag_name = $tag->getTagInfo($code, "name");
    $tag_ver = $tag->getTagInfo($code, "version");
    if (is_null($tag_ver)) {
        continue;
    }
    if ($check_version < $tag_ver) {
        echo "{$tag_name}({$code}):{$tag_ver}\n";
    }
    if ($code === 12 || $code === 59) {
        // DoAction or DoInitAction
        if ($tag->parseTagContent()) {
            $actions = $tag->tag->_actions;
            foreach ($actions as $action) {
                $actionCode = $action['Code'];
                $actionVersion = IO_SWF_Type_Action::getCodeVersion($actionCode);
                if ($check_version < $actionVersion) {
                    $actionName = IO_SWF_Type_Action::getCodeName($actionCode);
                    $hexCode = strtoupper(dechex($actionCode));
                    echo "    {$actionName}(0x{$hexCode}):{$actionVersion}\n";
                }
            }
        } else {
            echo "Illegal Action Contents\n";
        }
    }
}
exit(0);