Peach :: Generators :: static :: StaticBinary :: Class StaticBinary
[hide private]

Class StaticBinary

source code


Contains some binary data. Can be set by string containing several formats of binary data such as " FF FF FF FF " or "ÿ ÿ ÿ", etc.

Example:

>>> gen = StaticBinary("""41 41 41
... 41 41 41 41 0x41 0x41""")
>>>
>>> print gen.getValue()
AAAAAAAAA
Instance Methods [hide private]
 
__init__(self, value)
Base constructor, please call me!
source code
Static
setValue(self, value)
Set binary data to be used.
source code

Inherited from Static: getRawValue, next

Inherited from generator.Generator: __iter__, getGroup, getName, getTransformer, getValue, identity, reset, setGroup, setName, setTransformer

Static Methods [hide private]
 
unittest() source code
Class Variables [hide private]
  _regsHex = re.compile(r"^(\s*\\x([a-zA-Z0-9]{2})\s*)"), re.com...

Inherited from Static (private): _value

Method Details [hide private]

__init__(self, value)
(Constructor)

source code 

Base constructor, please call me!

Parameters:
  • value (string) - String of hex values
Overrides: generator.Generator.__init__

setValue(self, value)

source code 

Set binary data to be used.

Parameters:
  • value (string) - String of hex values
Returns: Static
self
Overrides: Static.setValue

unittest()
Static Method

source code 
Overrides: Static.unittest

Class Variable Details [hide private]

_regsHex

Value:
re.compile(r"^(\s*\\x([a-zA-Z0-9]{2})\s*)"), re.compile(r"^(\s*%([a-zA\
-Z0-9]{2})\s*)"), re.compile(r"^(\s*0x([a-zA-Z0-9]{2})\s*)"), re.compi\
le(r"^(\s*x([a-zA-Z0-9]{2})\s*)"), re.compile(r"^(\s*([a-zA-Z0-9]{2})\\
s*)")