Exemplo n.º 1
0
def s_word(value,
           endian="<",
           format="binary",
           signed=False,
           full_range=False,
           fuzzable=True,
           name=None):
    '''
    Push a word onto the current block stack.

    @see: Aliases: s_short()

    @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
    '''

    word = primitives.word(value, endian, format, signed, full_range, fuzzable,
                           name)
    blocks.CURRENT.push(word)
Exemplo n.º 2
0
def s_word (value, endian="<", format="binary", signed=False, full_range=False, fuzzable=True, name=None, hex_vals=False):
    '''
    Push a word onto the current block stack.

    @see: Aliases: s_short()

    @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 hex_vals:    Boolean
    @param hex_vals:   (Optional, def=False) Only applicable when format="ascii". Return the hex representation of the fuzz values
    '''

    word = primitives.word(value, endian, format, signed, full_range, fuzzable, name, hex_vals)
    blocks.CURRENT.push(word)
Exemplo n.º 3
0
def s_word (value, endian="<", format="binary", synchsafe=False, signed=False, full_range=False, fuzzable=True, name=None):
    '''
    Push a word onto the current block stack.

    @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)
    '''

    word = primitives.word(value, endian, format, synchsafe, signed, full_range, fuzzable, name)
    blocks.CURRENT.push(word)