Ejemplo n.º 1
0
    def __init__ (self, name, request, value, options={}):
        blocks.block.__init__(self, name, request, None, None, None, None)

        self.value   = value
        self.options = options

        if not self.value:
            raise sex.SullyRuntimeError("MISSING LEGO.tag DEFAULT VALUE")

        # <example>
        # [delim][string][delim]

        self.push(primitives.delim("<"))
        self.push(primitives.string(self.value))
        self.push(primitives.delim(">"))
Ejemplo n.º 2
0
    def __init__(self, name, request, value, options={}):
        blocks.block.__init__(self, name, request, None, None, None, None)

        self.value = value
        self.options = options

        if not self.value:
            raise sex.error("MISSING LEGO.tag DEFAULT VALUE")

        ip_arr = value.split(".")
        ctr = 0
        for ip_val in ip_arr:
            if ctr == 0:
                self.push(primitives.string(ip_val))
                self.push(primitives.delim("."))
            else:
                self.push(primitives.static(ip_val))
                if ctr < 3:
                    self.push(primitives.delim("."))
            ctr += 1
Ejemplo n.º 3
0
def s_delim (value, fuzzable=True, name=None):
    '''
    Push a delimiter onto the current block stack.

    @type  value:    Character
    @param value:    Original value
    @type  fuzzable: Boolean
    @param fuzzable: (Optional, def=True) Enable/disable fuzzing of this primitive
    @type  name:     String
    @param name:     (Optional, def=None) Specifying a name gives you direct access to a primitive
    '''

    delim = primitives.delim(value, fuzzable, name)
    blocks.CURRENT.push(delim)
Ejemplo n.º 4
0
 def push_namespace(self, db, collection):
     self.block.push(string(db))
     self.block.push(delim("."))
     self.block.push(string(collection))