示例#1
0
def s_qword(value,
            endian="<",
            format="binary",
            signed=False,
            full_range=False,
            fuzzable=True,
            name=None):
    '''
    Push a quad word onto the current block stack.

    @see: Aliases: s_double()

    @type  value:      Integer
    @param value:      Default integer value
    @type  endian:     Character
    @param endian:     (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
    @type  format:     String
    @param format:     (Optional, def=binary) Output format, "binary" or "ascii"
    @type  signed:     Boolean
    @param signed:     (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
    @type  full_range: Boolean
    @param full_range: (Optional, def=False) If enabled the field mutates through *all* possible values.
    @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
    '''

    qword = primitives.qword(value, endian, format, signed, full_range,
                             fuzzable, name)
    blocks.CURRENT.push(qword)
示例#2
0
文件: __init__.py 项目: BwRy/FuzzLabs
def s_qword (value, endian="<", format="binary", synchsafe=False, signed=False, full_range=False, fuzzable=True, name=None):
    '''
    Push a quad word onto the current block stack.

    @see: Aliases: s_double()

    @type  value:      Integer
    @param value:      Default integer value
    @type  endian:     Character
    @param endian:     (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
    @type  format:     String
    @param format:     (Optional, def=binary) Output format, "binary" or "ascii"
    @type  signed:     Boolean
    @param signed:     (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
    @type  full_range: Boolean
    @param full_range: (Optional, def=False) If enabled the field mutates through *all* possible values.
    @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
    @type  synchsafe:  Boolean
    @param synchsafe:  (Optional, def=False) Synchsafe (https://en.wikipedia.org/wiki/Synchsafe)
    '''

    qword = primitives.qword(value, endian, format, synchsafe, signed, full_range, fuzzable, name)
    blocks.CURRENT.push(qword)
示例#3
0
文件: mongo.py 项目: MNeubauer/sulley
    def __init__(self, name, request, value, options):
        # Create the super class and push a header to the block.
        options = self.init_options(options, opCodes['get_more'])
        MongoMsg.__init__(self, name, request, options)

        self.db = options.get("db", "test")
        self.collection = options.get("collection", "fuzzing")
        self.numberToReturn = options.get("numberToReturn", 35)
        self.cursorID = options.get("cursorID", 34970110)

        # int32 ZERO
        self.push(dword(0, signed=True))
        # cstring fullCollectionName
        self.push_namespace(self.db, self.collection)
        # int32 numberToReturn
        self.push(dword(self.numberToReturn, signed=True))
        # int64 numberToReturn
        self.push(qword(self.cursorID, signed=True))
        self.end_block()
示例#4
0
文件: mongo.py 项目: MNeubauer/sulley
    def __init__(self, name, request, value, options):
        # Create the super class and push a header to the block.
        options = self.init_options(options, opCodes['kill_cursors'])
        MongoMsg.__init__(self, name, request, options)

        self.numberOfCursorIDs = options.get('numberOfCursorIDs', 10)
        self.cursorIDs = options.get('cursorIDs', None)
        if not self.cursorIDs or len(self.cursorIDs) != self.numberOfCursorIDs:
            self.cursorIDs = []
            for i in xrange(self.numberOfCursorIDs):
                self.cursorIDs.append(randint(0,2**63-1))

        # int32 ZERO
        self.push(dword(0, signed=True))
        # int32 numberOfCursorIDs
        self.push(dword(self.numberOfCursorIDs, signed=True))
        # int64* cursorIDs
        for cursor_id in self.cursorIDs:
            self.push(qword(cursor_id, signed=True))
        self.end_block()