pyObjectManager¶
Submodules¶
pyObjectManager.BitVec module¶
-
class
pySym.pyObjectManager.BitVec.
BitVec
(varName, ctx, size, count=None, state=None, increment=False, value=None, uuid=None, clone=None)[source]¶ Bases:
object
Define a BitVec
-
canBe
(*args, **kwargs)¶
-
count
¶
-
ctx
¶
-
getValue
(*args, **kwargs)¶
-
getZ3Object
(*args, **kwargs)¶
-
isStatic
(*args, **kwargs)¶
-
is_constrained
¶
-
is_unconstrained
¶
-
mustBe
(*args, **kwargs)¶
-
parent
¶
-
setTo
(var, *args, **kwargs)[source]¶ Sets this BitVec object to be equal/copy of another. Type can be int, or BitVec
-
size
¶
-
state
¶ Returns the state assigned to this object.
-
uuid
¶
-
value
¶
-
varName
¶
-
pyObjectManager.Char module¶
-
class
pySym.pyObjectManager.Char.
Char
(varName, ctx, count=None, variable=None, state=None, increment=False, uuid=None, clone=None)[source]¶ Bases:
object
Define a Char (Character)
-
canBe
(*args, **kwargs)¶
-
count
¶
-
ctx
¶
-
getValue
(*args, **kwargs)¶
-
getZ3Object
(*args, **kwargs)¶
-
isStatic
(*args, **kwargs)¶
-
is_constrained
¶
-
is_unconstrained
¶
-
mustBe
(*args, **kwargs)¶
-
parent
¶
-
state
¶ Returns the state assigned to this object.
-
uuid
¶
-
varName
¶
-
variable
¶
-
pyObjectManager.Ctx module¶
-
class
pySym.pyObjectManager.Ctx.
Ctx
(ctx, variables=None)[source]¶ Bases:
object
Define a Ctx Object
-
__setitem__
(key, value)[source]¶ Sets value at index key. Checks for variable type, updates counter according, similar to getVar call
-
ctx
¶
-
index
(elm)[source]¶ Returns “index” of the given element. Raises exception if it’s not found For a pseudo dict class, this is just the key for the key,val pair
-
state
¶ Returns the state assigned to this object.
-
variables
¶
-
variables_need_copy
¶
-
pyObjectManager.Int module¶
-
class
pySym.pyObjectManager.Int.
Int
(varName, ctx, count=None, value=None, state=None, increment=False, uuid=None, clone=None)[source]¶ Bases:
object
Define an Int
-
canBe
(*args, **kwargs)¶
-
count
¶
-
ctx
¶
-
getValue
(*args, **kwargs)¶
-
getZ3Object
(*args, **kwargs)¶
-
isStatic
(*args, **kwargs)¶
-
is_constrained
¶
-
is_unconstrained
¶
-
mustBe
(*args, **kwargs)¶
-
parent
¶
-
setTo
(var, *args, **kwargs)[source]¶ Sets this Int object to be equal/copy of another. Type can be int or Int
-
state
¶ Returns the state assigned to this object.
-
uuid
¶
-
value
¶
-
varName
¶
-
pyObjectManager.List module¶
-
class
pySym.pyObjectManager.List.
List
(varName, ctx, count=None, variables=None, state=None, increment=False, uuid=None)[source]¶ Bases:
object
Define a List
-
__setitem__
(key, value)[source]¶ Sets value at index key. Checks for variable type, updates counter according, similar to getVar call
-
append
(var, kwargs=None)[source]¶ - Input:
- var = pyObjectManager oject to append (i.e.: Int/Real/etc) (optional) kwargs = optional keyword args needed to instantiate type
- Action:
- Resolves object, creates variable if needed
- Returns:
- Nothing
-
count
¶
-
ctx
¶
-
getValue
()[source]¶ Return a possible value. You probably want to check isStatic before calling this.
-
isStatic
()[source]¶ Checks if this list can only have one possible value overall (including all elements). Returns True/False
-
parent
¶
-
setTo
(otherList, clear=False)[source]¶ Sets this list to another of type List (optional) clear = Should we clear the current variables and set, or set the current variables in place retaining their constraints?
-
state
¶ Returns the state assigned to this object.
-
uuid
¶
-
varName
¶
-
variables
¶
-
variables_need_copy
¶
-
pyObjectManager.Real module¶
-
class
pySym.pyObjectManager.Real.
Real
(varName, ctx, count=None, value=None, state=None, increment=False, uuid=None)[source]¶ Bases:
object
Define a Real
-
__str__
()[source]¶ str will change this object into a possible representation by calling state.any_real
-
count
¶
-
ctx
¶
-
getValue
()[source]¶ Resolves the value of this real. Assumes that isStatic method is called before this is called to ensure the value is not symbolic
-
parent
¶
-
setTo
(var, *args, **kwargs)[source]¶ Sets this Real object to be equal/copy of another. Type can be float, Real, Int, or int
-
state
¶ Returns the state assigned to this object.
-
uuid
¶
-
value
¶
-
varName
¶
-
pyObjectManager.String module¶
-
class
pySym.pyObjectManager.String.
String
(varName, ctx, count=None, string=None, variables=None, state=None, length=None, increment=False, uuid=None)[source]¶ Bases:
object
Define a String
-
__str__
()[source]¶ str will change this object into a possible representation by calling state.any_str
-
count
¶
-
ctx
¶
-
getValue
()[source]¶ Resolves the value of this String. Assumes that isStatic method is called before this is called to ensure the value is not symbolic
-
getZ3Object
()[source]¶ Convenience function. Will return z3 object for Chr if this is a string of length 1, else error.
-
isStatic
()[source]¶ Returns True if this object is a static variety (i.e.: “test”). Also returns True if object has only one possibility
-
mustBe
(var)[source]¶ Test if this string must be equal to the given variable. This means there’s no other options and it’s not symbolic
-
parent
¶
-
pop
(index=None)[source]¶ Not exactly something you can do on a string, but helpful for our symbolic execution
-
setTo
(var, clear=None)[source]¶ Sets this String object to be equal/copy of another. Type can be str or String. clear = Boolean if this variable should be cleared before setting (default False)
-
state
¶ Returns the state assigned to this object.
-
uuid
¶
-
varName
¶
-
variables
¶
-
Module contents¶
-
class
pySym.pyObjectManager.
ObjectManager
(variables=None, returnObjects=None, state=None)[source]¶ Bases:
object
Object Manager will keep track of objects. Generally, Objects will be variables such as ints, lists, strings, etc.
-
getParent
(key, haystack=None)[source]¶ Returns the parent object for any given object by recursively searching.
-
getVar
(varName, ctx, varType=None, kwargs=None, softFail=None)[source]¶ - Input:
- varName = name of variable to get ctx = Context for variable (optional) varType = Class type of variable (ex: pyObjectManager.Int) (optional) kwargs = args needed to instantiate variable (optional) softFail = True/False, should raise an exception if getVar fails. Default is False
- Action:
- Find appropriate variable object, creating one if necessary
- Returns:
- pyObjectManager object for given variable (i.e.: pyObjectManager.Int)
-
returnObjects
¶
-
setVar
(varName, ctx, var)[source]¶ - Input:
- varName = variable name (i.e.: ‘x’) ctx = Context to set for var = variable object of type pyObjectManager.X
- Action:
- Sets variable to the input (var) object
- Returns:
- Nothing
-
state
¶ Returns the state assigned to this object.
-
variables
¶
-