Package sulley
[show private | hide private]
[frames | no frames]

Package sulley

Submodules

Function Summary
  custom_raise(argument, msg)
  s_bigword(x)
  s_binary(value, name)
Parse a variable format binary string into a static value and push it onto the current block stack.
  s_binary_block_size_byte(x)
  s_binary_block_size_byte_mult(x)
  s_binary_block_size_byte_plus(x)
  s_binary_block_size_byte_variable(x)
  s_binary_block_size_halfword_bigendian(x)
  s_binary_block_size_halfword_bigendian_mult(x)
  s_binary_block_size_halfword_bigendian_variable(x)
  s_binary_block_size_intel_halfword(x)
  s_binary_block_size_intel_halfword_mult(x)
  s_binary_block_size_intel_halfword_plus(x)
  s_binary_block_size_intel_halfword_plus_variable(x)
  s_binary_block_size_intel_halfword_variable(x)
  s_binary_block_size_intel_word(x)
  s_binary_block_size_intel_word_plus(x)
  s_binary_block_size_intel_word_variable(x)
  s_binary_block_size_word_bigendian(x)
  s_binary_block_size_word_bigendian_mult(x)
  s_binary_block_size_word_bigendian_plussome(x)
  s_binary_block_size_word_bigendian_variable(x)
  s_binary_block_size_word_intel_mult_plus(x)
  s_binary_repeat(x)
  s_bit(value, width, endian, format, signed, full_range, fuzzable, name)
Push a variable length bit field onto the current block stack.
  s_bit_field(value, width, endian, format, signed, full_range, fuzzable, name)
Push a variable length bit field onto the current block stack.
  s_bits(value, width, endian, format, signed, full_range, fuzzable, name)
Push a variable length bit field onto the current block stack.
  s_block_end(name)
Close the last opened block.
  s_block_start(name, group, encoder, dep, dep_value, dep_values, dep_compare)
Open a new block under the current request.
  s_blocksize_asciihex(x)
  s_blocksize_asciihex_variable(x)
  s_blocksize_signed_string_variable(x)
  s_blocksize_string(x)
  s_blocksize_unsigned_string_variable(x)
  s_byte(value, endian, format, signed, full_range, fuzzable, name)
Push a byte onto the current block stack.
  s_char(value, endian, format, signed, full_range, fuzzable, name)
Push a byte onto the current block stack.
  s_checksum(block_name, algorithm, length, endian, name)
Create a checksum block bound to the block with the specified name.
  s_cstring(x)
  s_delim(value, fuzzable, name)
Push a delimiter onto the current block stack.
  s_double(value, endian, format, signed, full_range, fuzzable, name)
Push a quad word onto the current block stack.
  s_dunno(value, name)
Push a static value onto the current block stack.
  s_dword(value, endian, format, signed, full_range, fuzzable, name)
Push a double word onto the current block stack.
blocks.request s_get(name)
Return the request with the specified name or the current request if name is not specified.
  s_group(name, values)
This primitive represents a list of static values, stepping through each one on mutation.
String s_hex_dump(data, addr)
Return the hex dump of the supplied data starting at the offset address specified.
  s_initialize(name)
Initialize a new block request.
  s_int(value, endian, format, signed, full_range, fuzzable, name)
Push a double word onto the current block stack.
  s_intelhalfword(x)
  s_intelword(x)
  s_lego(lego_type, value, options)
Legos are pre-built blocks...
  s_long(value, endian, format, signed, full_range, fuzzable, name)
Push a double word onto the current block stack.
Boolean s_mutate()
Mutate the current request and return False if mutations are exhausted, in which case the request has been reverted back to its normal form.
Integer s_num_mutations()
Determine the number of repetitions we will be making.
  s_qword(value, endian, format, signed, full_range, fuzzable, name)
Push a quad word onto the current block stack.
  s_random(value, min_length, max_length, num_mutations, fuzzable, name)
Generate a random chunk of data while maintaining a copy of the original.
  s_raw(value, name)
Push a static value onto the current block stack.
Raw s_render()
Render out and return the entire contents of the current request.
  s_repeat(block_name, min_reps, max_reps, step, variable, fuzzable, name)
Repeat the rendered contents of the specified block cycling from min_reps to max_reps counting by step.
  s_repeater(block_name, min_reps, max_reps, step, variable, fuzzable, name)
Repeat the rendered contents of the specified block cycling from min_reps to max_reps counting by step.
  s_short(value, endian, format, signed, full_range, fuzzable, name)
Push a word onto the current block stack.
  s_size(block_name, length, endian, format, inclusive, signed, math, fuzzable, name)
Create a sizer block bound to the block with the specified name.
  s_sizer(block_name, length, endian, format, inclusive, signed, math, fuzzable, name)
Create a sizer block bound to the block with the specified name.
  s_static(value, name)
Push a static value onto the current block stack.
  s_string(value, size, padding, encoding, fuzzable, name)
Push a string onto the current block stack.
  s_string_lf(x)
  s_string_or_env(x)
  s_string_repeat(x)
  s_string_variable(x)
  s_string_variables(x)
  s_switch(name)
Change the currect request to the one specified by "name".
  s_unistring(x)
  s_unistring_variable(x)
  s_unknown(value, name)
Push a static value onto the current block stack.
  s_update(name, value)
Update the value of the named primitive in the currently open request.
  s_word(value, endian, format, signed, full_range, fuzzable, name)
Push a word onto the current block stack.
  s_xdr_string(x)

Variable Summary
str BIG_ENDIAN = '>'
str LITTLE_ENDIAN = '<'

Function Details

s_binary(value, name=None)

Parse a variable format binary string into a static value and push it onto the current block stack.
Parameters:
value - Variable format binary string
           (type=String)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

s_bit(value, width, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a variable length bit field onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
width - Width of bit fields
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_bit(), s_bits()

s_bit_field(value, width, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a variable length bit field onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
width - Width of bit fields
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_bit(), s_bits()

s_bits(value, width, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a variable length bit field onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
width - Width of bit fields
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_bit(), s_bits()

s_block_end(name=None)

Close the last opened block. Optionally specify the name of the block being closed (purely for aesthetic purposes).
Parameters:
name - (Optional, def=None) Name of block to closed.
           (type=String)

s_block_start(name, group=None, encoder=None, dep=None, dep_value=None, dep_values=[], dep_compare='==')

Open a new block under the current request. This routine always returns True so you can make your fuzzer pretty with indenting:
   if s_block_start("header"):
       s_static("\x00\x01")
       if s_block_start("body"):
           ...
Parameters:
name - Name of block being opened
           (type=String)
group - (Optional, def=None) Name of group to associate this block with
           (type=String)
encoder - (Optional, def=None) Optional pointer to a function to pass rendered data to prior to return
           (type=Function Pointer)
dep - (Optional, def=None) Optional primitive whose specific value this block is dependant on
           (type=String)
dep_value - (Optional, def=None) Value that field "dep" must contain for block to be rendered
           (type=Mixed)
dep_values - (Optional, def=[]) Values that field "dep" may contain for block to be rendered
           (type=List of Mixed Types)
dep_compare - (Optional, def="==") Comparison method to use on dependency (==, !=, >, >=, <, <=)
           (type=String)

s_byte(value, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a byte onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_char()

s_char(value, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a byte onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_char()

s_checksum(block_name, algorithm='crc32', length=0, endian='<', name=None)

Create a checksum block bound to the block with the specified name. You *can not* create a checksum for any currently open blocks.
Parameters:
block_name - Name of block to apply sizer to
           (type=String)
algorithm - (Optional, def=crc32) Checksum algorithm to use. (crc32, adler32, md5, sha1)
           (type=String)
length - (Optional, def=0) Length of checksum, specify 0 to auto-calculate
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
name - Name of this checksum field
           (type=String)

s_delim(value, fuzzable=True, name=None)

Push a delimiter onto the current block stack.
Parameters:
value - Original value
           (type=Character)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

s_double(value, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a quad word onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_double()

s_dunno(value, name=None)

Push a static value onto the current block stack.
Parameters:
value - Raw static data
           (type=Raw)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_dunno(), s_raw(), s_unknown()

s_dword(value, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a double word onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_long(), s_int()

s_get(name=None)

Return the request with the specified name or the current request if name is not specified. Use this to switch from global function style request manipulation to direct object manipulation. Example:
   req = s_get("HTTP BASIC")
   print req.num_mutations()
The selected request is also set as the default current. (ie: s_switch(name) is implied).
Parameters:
name - (Optional, def=None) Name of request to return or current request if name is None.
           (type=String)
Returns:
The requested request.
           (type=blocks.request)

s_group(name, values)

This primitive represents a list of static values, stepping through each one on mutation. You can tie a block to a group primitive to specify that the block should cycle through all possible mutations for *each* value within the group. The group primitive is useful for example for representing a list of valid opcodes.
Parameters:
name - Name of group
           (type=String)
values - List of possible raw values this group can take.
           (type=List or raw data)

s_hex_dump(data, addr=0)

Return the hex dump of the supplied data starting at the offset address specified.
Parameters:
data - Data to show hex dump of
           (type=Raw)
addr - (Optional, def=0) Offset to start displaying hex dump addresses from
           (type=Integer)
Returns:
Hex dump of raw data
           (type=String)

s_initialize(name)

Initialize a new block request. All blocks / primitives generated after this call apply to the named request. Use s_switch() to jump between factories.
Parameters:
name - Name of request
           (type=String)

s_int(value, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a double word onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_long(), s_int()

s_lego(lego_type, value=None, options={})

Legos are pre-built blocks... XXX finish this doc

s_long(value, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a double word onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_long(), s_int()

s_mutate()

Mutate the current request and return False if mutations are exhausted, in which case the request has been reverted back to its normal form.
Returns:
True on mutation success, False if mutations exhausted.
           (type=Boolean)

s_num_mutations()

Determine the number of repetitions we will be making.
Returns:
Number of mutated forms this primitive can take.
           (type=Integer)

s_qword(value, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a quad word onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_double()

s_random(value, min_length, max_length, num_mutations=25, fuzzable=True, name=None)

Generate a random chunk of data while maintaining a copy of the original. A random length range can be specified. For a static length, set min/max length to be the same.
Parameters:
value - Original value
           (type=Raw)
min_length - Minimum length of random block
           (type=Integer)
max_length - Maximum length of random block
           (type=Integer)
num_mutations - (Optional, def=25) Number of mutations to make before reverting to default
           (type=Integer)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

s_raw(value, name=None)

Push a static value onto the current block stack.
Parameters:
value - Raw static data
           (type=Raw)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_dunno(), s_raw(), s_unknown()

s_render()

Render out and return the entire contents of the current request.
Returns:
Rendered contents
           (type=Raw)

s_repeat(block_name, min_reps=0, max_reps=None, step=1, variable=None, fuzzable=True, name=None)

Repeat the rendered contents of the specified block cycling from min_reps to max_reps counting by step. By default renders to nothing. This block modifier is useful for fuzzing overflows in table entries. This block modifier MUST come after the block it is being applied to.
Parameters:
block_name - Name of block to apply sizer to
           (type=String)
min_reps - (Optional, def=0) Minimum number of block repetitions
           (type=Integer)
max_reps - (Optional, def=None) Maximum number of block repetitions
           (type=Integer)
step - (Optional, def=1) Step count between min and max reps
           (type=Integer)
variable - (Optional, def=None) An integer primitive which will specify the number of repitions
           (type=Sulley Integer Primitive)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_repeater()

s_repeater(block_name, min_reps=0, max_reps=None, step=1, variable=None, fuzzable=True, name=None)

Repeat the rendered contents of the specified block cycling from min_reps to max_reps counting by step. By default renders to nothing. This block modifier is useful for fuzzing overflows in table entries. This block modifier MUST come after the block it is being applied to.
Parameters:
block_name - Name of block to apply sizer to
           (type=String)
min_reps - (Optional, def=0) Minimum number of block repetitions
           (type=Integer)
max_reps - (Optional, def=None) Maximum number of block repetitions
           (type=Integer)
step - (Optional, def=1) Step count between min and max reps
           (type=Integer)
variable - (Optional, def=None) An integer primitive which will specify the number of repitions
           (type=Sulley Integer Primitive)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_repeater()

s_short(value, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a word onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_short()

s_size(block_name, length=4, endian='<', format='binary', inclusive=False, signed=False, math=None, fuzzable=False, name=None)

Create a sizer block bound to the block with the specified name. You *can not* create a sizer for any currently open blocks.
Parameters:
block_name - Name of block to apply sizer to
           (type=String)
length - (Optional, def=4) Length of sizer
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
inclusive - (Optional, def=False) Should the sizer count its own length?
           (type=Boolean)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
math - (Optional, def=None) Apply the mathematical operations defined in this function to the size
           (type=Function)
fuzzable - (Optional, def=False) Enable/disable fuzzing of this sizer
           (type=Boolean)
name - Name of this sizer field
           (type=String)

See Also: Aliases: s_sizer()

s_sizer(block_name, length=4, endian='<', format='binary', inclusive=False, signed=False, math=None, fuzzable=False, name=None)

Create a sizer block bound to the block with the specified name. You *can not* create a sizer for any currently open blocks.
Parameters:
block_name - Name of block to apply sizer to
           (type=String)
length - (Optional, def=4) Length of sizer
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
inclusive - (Optional, def=False) Should the sizer count its own length?
           (type=Boolean)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
math - (Optional, def=None) Apply the mathematical operations defined in this function to the size
           (type=Function)
fuzzable - (Optional, def=False) Enable/disable fuzzing of this sizer
           (type=Boolean)
name - Name of this sizer field
           (type=String)

See Also: Aliases: s_sizer()

s_static(value, name=None)

Push a static value onto the current block stack.
Parameters:
value - Raw static data
           (type=Raw)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_dunno(), s_raw(), s_unknown()

s_string(value, size=-1, padding='\x00', encoding='ascii', fuzzable=True, name=None)

Push a string onto the current block stack.
Parameters:
value - Default string value
           (type=String)
size - (Optional, def=-1) Static size of this field, leave -1 for dynamic.
           (type=Integer)
padding - (Optional, def="\x00") Value to use as padding to fill static field size.
           (type=Character)
encoding - (Optonal, def="ascii") String encoding, ex: utf_16_le for Microsoft Unicode.
           (type=String)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

s_switch(name)

Change the currect request to the one specified by "name".
Parameters:
name - Name of request
           (type=String)

s_unknown(value, name=None)

Push a static value onto the current block stack.
Parameters:
value - Raw static data
           (type=Raw)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_dunno(), s_raw(), s_unknown()

s_update(name, value)

Update the value of the named primitive in the currently open request.
Parameters:
name - Name of object whose value we wish to update
           (type=String)
value - Updated value
           (type=Mixed)

s_word(value, endian='<', format='binary', signed=False, full_range=False, fuzzable=True, name=None)

Push a word onto the current block stack.
Parameters:
value - Default integer value
           (type=Integer)
endian - (Optional, def=LITTLE_ENDIAN) Endianess of the bit field (LITTLE_ENDIAN: <, BIG_ENDIAN: >)
           (type=Character)
format - (Optional, def=binary) Output format, "binary" or "ascii"
           (type=String)
signed - (Optional, def=False) Make size signed vs. unsigned (applicable only with format="ascii")
           (type=Boolean)
full_range - (Optional, def=False) If enabled the field mutates through *all* possible values.
           (type=Boolean)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)

See Also: Aliases: s_short()


Variable Details

BIG_ENDIAN

Type:
str
Value:
'>'                                                                    

LITTLE_ENDIAN

Type:
str
Value:
'<'                                                                    

Generated by Epydoc 2.1 on Fri Jul 27 17:40:03 2007 http://epydoc.sf.net