Class |
Description |
|---|---|
|
|
Note This object is a “passive” object. Any changes you make to it will not be reflected in… |
|
class PossibleValueSet PossibleValueSet is used to define possible values that a variable can… |
|
|
|
|
Bases: RegisterValue
ConstantData(value: int, offset: int, type: binaryninja.enums.RegisterValueType = <RegisterValueType.UndeterminedValue: 0>, confidence: int = 255, size: int = 0, function: ‘_function.Function’ = None)
value (int) –
offset (int) –
type (RegisterValueType) –
confidence (int) –
size (int) –
function (_function.Function) –
None
Bases: RegisterValue
ConstantDataRegisterValue(value: int, offset: int, type: binaryninja.enums.RegisterValueType = <RegisterValueType.UndeterminedValue: 0>, confidence: int = 255, size: int = 0)
Bases: RegisterValue
ConstantPointerRegisterValue(value: int, offset: int = 0, type: binaryninja.enums.RegisterValueType = <RegisterValueType.ConstantPointerValue: 3>, confidence: int = 255, size: int = 0)
value (int) –
offset (int) –
type (RegisterValueType) –
confidence (int) –
size (int) –
None
Bases: RegisterValue
ConstantRegisterValue(value: int, offset: int = 0, type: binaryninja.enums.RegisterValueType = <RegisterValueType.ConstantValue: 2>, confidence: int = 255, size: int = 0)
value (int) –
offset (int) –
type (RegisterValueType) –
confidence (int) –
size (int) –
None
Bases: object
class CoreVariable is the base class for other variable types,
such as VariableNameAndType and Variable
index – Internal identifier
storage – If this variable is a stack variable (source_type == VariableSourceType.StackVariableSourceType), then the storage location is the offset onto the stack that contains the first byte of this variable. Otherwise it’s used as an internal identifier.
Whether this variable was created based off of an underlying register, stack location, or flag.
Bases: RegisterValue
EntryRegisterValue(value: int = 0, offset: int = 0, type: binaryninja.enums.RegisterValueType = <RegisterValueType.EntryValue: 1>, confidence: int = 255, size: int = 0, reg: Optional[ForwardRef(‘binaryninja.architecture.RegisterName’)] = None)
value (int) –
offset (int) –
type (RegisterValueType) –
confidence (int) –
size (int) –
reg (RegisterName | None) –
None
Bases: RegisterValue
ExternalPointerRegisterValue(value: int, offset: int, type: binaryninja.enums.RegisterValueType = <RegisterValueType.ExternalPointerValue: 4>, confidence: int = 255, size: int = 0)
value (int) –
offset (int) –
type (RegisterValueType) –
confidence (int) –
size (int) –
None
Bases: RegisterValue
ImportedAddressRegisterValue(value: int, offset: int = 0, type: binaryninja.enums.RegisterValueType = <RegisterValueType.ImportedAddressValue: 7>, confidence: int = 255, size: int = 0)
value (int) –
offset (int) –
type (RegisterValueType) –
confidence (int) –
size (int) –
None
Bases: object
IndirectBranchInfo(source_arch: ‘binaryninja.architecture.Architecture’, source_addr: int, dest_arch: ‘binaryninja.architecture.Architecture’, dest_addr: int, auto_defined: bool)
source_arch (Architecture) –
source_addr (int) –
dest_arch (Architecture) –
dest_addr (int) –
auto_defined (bool) –
None
Bases: object
LookupTableEntry(from_values: List[int], to_value: int, type: binaryninja.enums.RegisterValueType = <RegisterValueType.LookupTableValue: 10>)
to_value (int) –
type (RegisterValueType) –
None
Bases: object
Note
This object is a “passive” object. Any changes you make to it will not be reflected in the core and vice-versa. If you wish to update a core version of this object you should use the appropriate API.
confidence (int) –
Bases: object
class PossibleValueSet PossibleValueSet is used to define possible values that a variable can take. It contains methods to instantiate different value sets such as Constant, Signed/Unsigned Ranges, etc.
Note
This object is a “passive” object. Any changes you make to it will not be reflected in the core and vice-versa. If you wish to update a core version of this object you should use the appropriate API.
arch (Architecture | None) –
value (BNPossibleValueSet | None) –
Add two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Perform bitwise AND of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Perform arithmetic right shift of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Create a constant valued PossibleValueSet object.
value (int) – Integer value of the constant
Create constant pointer valued PossibleValueSet object.
value (int) – Integer value of the constant pointer
Create a PossibleValueSet object for a value in a set of values.
Compute the intersection of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Perform logical right shift of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Create a PossibleValueSet object for a value which is a member of a lookup table.
lookup_table (list(LookupTableEntry)) – List of table entries
mapping –
Multiply two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Negate a PossibleValueSet.
size (int) –
Perform bitwise NOT of a PossibleValueSet.
size (int) –
Create a PossibleValueSet object for a value NOT in a set of values.
Perform bitwise OR of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Perform left rotation of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Perform right rotation of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Perform left shift of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Perform signed division of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Perform signed modulo of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Create a PossibleValueSet object for a signed range of values.
ranges (list(ValueRange)) – List of ValueRanges
>>> v_1 = ValueRange(-5, -1, 1)
>>> v_2 = ValueRange(7, 10, 1)
>>> val = PossibleValueSet.signed_range_value([v_1, v_2])
<signed ranges: [<range: -0x5 to -0x1>, <range: 0x7 to 0xa>]>
Create a PossibleValueSet object for a stack frame offset.
offset (int) – Integer value of the offset
Subtract two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Create a PossibleValueSet object of type UndeterminedValue.
PossibleValueSet object of type UndeterminedValue
Compute the union of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Perform unsigned division of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Perform unsigned modulo of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Create a PossibleValueSet object for a unsigned signed range of values.
ranges (list(ValueRange)) – List of ValueRanges
>>> v_1 = ValueRange(0, 5, 1)
>>> v_2 = ValueRange(7, 10, 1)
>>> val = PossibleValueSet.unsigned_range_value([v_1, v_2])
<unsigned ranges: [<range: 0x0 to 0x5>, <range: 0x7 to 0xa>]>
Perform bitwise XOR of two PossibleValueSets.
other (PossibleValueSet) –
size (int) –
Bases: object
RegisterValue(value: int, offset: int, type: binaryninja.enums.RegisterValueType = <RegisterValueType.UndeterminedValue: 0>, confidence: int = 255, size: int = 0)
value (int) –
offset (int) –
type (RegisterValueType) –
confidence (int) –
size (int) –
None
reg_value (BNRegisterValue | BNRegisterValueWithConfidence) –
arch (Architecture | None) –
reg_value (RegisterValue) –
BNRegisterValue
Bases: RegisterValue
ReturnAddressRegisterValue(value: int, offset: int = 0, type: binaryninja.enums.RegisterValueType = <RegisterValueType.ReturnAddressValue: 6>, confidence: int = 255, size: int = 0)
value (int) –
offset (int) –
type (RegisterValueType) –
confidence (int) –
size (int) –
None
Bases: RegisterValue
StackFrameOffsetRegisterValue(value: int, offset: int = 0, type: binaryninja.enums.RegisterValueType = <RegisterValueType.StackFrameOffset: 5>, confidence: int = 255, size: int = 0)
value (int) –
offset (int) –
type (RegisterValueType) –
confidence (int) –
size (int) –
None
Bases: object
StackVariableReference(_source_operand: Optional[int], type: ‘binaryninja.types.Type’, name: str, var: ‘Variable’, referenced_offset: int, size: int)
Bases: RegisterValue
Undetermined(value: int = 0, offset: int = 0, type: binaryninja.enums.RegisterValueType = <RegisterValueType.UndeterminedValue: 0>, confidence: int = 255, size: int = 0)
value (int) –
offset (int) –
type (RegisterValueType) –
confidence (int) –
size (int) –
None
Bases: CoreVariable
class Variable represents variables in Binary Ninja. Variables are resolved
in medium level IL, so variables objects are only valid for MLIL and above.
func (Function | LowLevelILFunction | MediumLevelILFunction | HighLevelILFunction) –
source_type (VariableSourceType) –
index (int) –
storage (int) –
func (Function | LowLevelILFunction | MediumLevelILFunction | HighLevelILFunction) –
var (BNVariable) –
func (Function | LowLevelILFunction | MediumLevelILFunction | HighLevelILFunction) –
var (CoreVariable) –
func (Function | LowLevelILFunction | MediumLevelILFunction | HighLevelILFunction) –
identifier (int) –
func (Function | LowLevelILFunction | MediumLevelILFunction | HighLevelILFunction) –
var (VariableNameAndType) –
set_name_and_type_async provides a way to asynchronously set both the name and type of a variable. This method should be used
when speed is of concern.
set_name_async provides a way to asynchronously set the name of a variable. This method should be used
when speed is of concern.
name (str | None) –
None
set_type_async provides a way to asynchronously set the type of a variable. This method should be used
when speed is of concern.
new_type (Type) –
None
Retrieve the underlying CoreVariable class
returns the dead store elimination setting for this variable
returns the IL Function object which this variable belongs to
Name of the variable, or the name most recently assigned if the variable has since been removed (read-only).
Name of the variable, Settings this property is slow because it ensures that analysis has been updated. If you are renaming many variables, use set_name_async, then call update_analysis when complete.
returns number of bytes to the next variable on the stack
Returns the SSA versions associated with this variable. Doesn’t return anything for aliased variables.
Convert to VariableNameAndType
Bases: CoreVariable
class VariableNameAndType is a lightweight wrapper around a
variable and its name, useful for shuttling between APIs that require
them both. While Variable has Variable.name and
Variable.type fields, those require additional core calls
each time you fetch them.
name – The variable’s name
type – The variable’s type