Exemplo n.º 1
0
def pytest_funcarg__gen(request):
    abcfile = AbcFile()
    gen = abcfile.create_generator()
    script = gen.begin_script()
    init = script.make_init()
    gen.enter_rib(init)
    return gen
Exemplo n.º 2
0
def pytest_funcarg__gen(request):
    abcfile = AbcFile()
    gen = abcfile.create_generator()
    script = gen.begin_script()
    init = script.make_init()
    gen.enter_rib(init)
    return gen
Exemplo n.º 3
0
def gen_library(path, output, Library=Library):
    """
    This method does the entire generation process for a random SWC.
    """
    if path.endswith(".swc"):
        L = Library.gen_library_swcdata(SwcData.from_filename(path))
    elif path.endswith(".abc"):
        L = Library.gen_library_abc(AbcFile.from_filename(path))
    L.save_pickledb(output)
Exemplo n.º 4
0
    def __init__(self, name="Mecheye Fusion", abc=None, flags=0):
        """
        Constructor.

        :param name: the name for the ABC Block
        :type name:  a string
        :param flags: the flags for the ABC Block
                      currently, that can be 1, which
                      lazily inits the ABC Block
        """
        self.abc = abc or AbcFile()
        self.name = name
        self.flags = flags
Exemplo n.º 5
0
from fusion.swf.swfdata import SwfData
from fusion.swf.records import Rect, RGBA
from fusion.swf import tags

from fusion.avm2.abc_ import AbcFile
from fusion.avm2.node import export_function, INode, Slot
from fusion.avm2.loadable import Chain, This, Field, Stack, Local
from fusion.avm2.playerglobal import flash

swf = SwfData()

abc = AbcFile()
gen = abc.create_generator()

@export_function(["Object", flash.text.TextField], rettype="void")
def dump(gen, params, tracer):
    gen.load(0)
    gen.emit('convert_i')
    index_reg = gen.store_var("idx")
    params_reg = params.get_index(gen)

    gen.set_label("loop")

    gen.emit('hasnext2', params_reg, index_reg)
    gen.branch_if_false("done")

    gen.load(params)
    gen.load(Local("idx"))
    gen.emit('nextname')
    gen.load("=")
Exemplo n.º 6
0
from fusion.avm2.abc_ import AbcFile
from fusion.avm2.constants import packagedQName

abc = AbcFile()
gen = abc.create_generator()
with gen.Class("testing"):
    pass
gen.script0.make_init()
gen.emit('findpropstrict', "print")
gen.emit('findpropstrict', "testing")
gen.emit('constructprop', "testing", 0)
gen.gettype()
gen.emit('callpropvoid', "print", 1)
gen.finish()
abc.serialize()

f = open("prototype.abc", "wb")
f.write(abc.serialize())
f.close()
Exemplo n.º 7
0
 def parse_inner(cls, bitstream):
     flags = bitstream.read(UI32)
     name = bitstream.read(CString)
     abc = AbcFile.from_bitstream(bitstream)
     instance = cls(name, abc, flags)
     return instance
Exemplo n.º 8
0
 def parse_inner(cls, bitstream):
     flags = bitstream.read(UI32)
     name  = bitstream.read(CString)
     abc   = AbcFile.from_bitstream(bitstream)
     instance = cls(name, abc, flags)
     return instance