class Symbol(object):
A modelisation of a static symbol.
Must not be directly constructed but retrieved through the following examples. Using an instance of Symbol
directly constructed could lead to an AssertionError
.
>>> # From a Transition >>> transition.context_before().ossi.location().symbol >>> transition.context_after().ossi.location().symbol
>>> # From a Context >>> context.location().symbol
>>> # From a Binary >>> for symbol in binary.symbols: >>> print(symbol) 'toto' 'tata'
Method | __init__ |
Undocumented |
Property | rva |
Property: The relative virtual address (rva) inside the binary. |
Property | source_name |
Property: The name of the symbol as it is found in the binary or the debug file without any transformation. |
Property | name |
Property: The name of the symbol. |
Property | name_only |
Property: The short, demangled, form of the symbol, if available. |
Property | prototype |
Property: The long, demangled, form of the symbol, if available. |
Property | binary |
Property: The binary in which the symbol have been declared. |
Method | __hash__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __eq__ |
Undocumented |
Method | __ne__ |
Undocumented |
Method | __lt__ |
Undocumented |
Method | __le__ |
Undocumented |
Method | __gt__ |
Undocumented |
Method | __ge__ |
Undocumented |
Instance Variable | _datasource |
Undocumented |
Instance Variable | _binary_id |
Undocumented |
Instance Variable | _symbol |
Undocumented |
Property: The relative virtual address (rva) inside the binary.
The rva is the offset from the base address of the binary loaded in memory.
>>> hex(symbol.rva) '0x1445a0'
Returns | An integer . |
int
)
Property: The name of the symbol as it is found in the binary or the debug file without any transformation.
The source name can be mangled, depending on the source language of the symbol.
>>> symbol.source '??0COREDEVICEACCESS@@QEAA@QEAVDXGDEVICE@@W4_DXGDEVICEACCESS_TYPE@@I_N@Z'
Returns | A string . |
str
)
Property: The name of the symbol.
>>> symbol.name 'COREDEVICEACCESS::COREDEVICEACCESS'
Returns | If available, the short demangled form of the symbol (name_only ), otherwise the possibly mangled name (source_name ). |
str
)
Property: The short, demangled, form of the symbol, if available.
This form only includes the name of the function symbol and omits any attribute (such as calling convention), arguments and return type. However, this form does include the path (namespace) and template arguments.
Depending on the source language, for some symbols this form can be missing entirely.
>>> symbol.name_only 'COREDEVICEACCESS::COREDEVICEACCESS'
Returns | Either a string if the name only is available or None . |
_Optional[str]
)
Property: The long, demangled, form of the symbol, if available.
This form includes the name of the function symbol, all attributes (such as calling convention), all arguments and the return type that constitute its signature, if available.
Depending on the source language, for some symbols this form can be equal to the name_only
form, or missing entirely.
>>> symbol.prototype 'public: __cdecl COREDEVICEACCESS::COREDEVICEACCESS(class DXGDEVICE * const, enum _DXGDEVICEACCESS_TYPE, unsigned int,bool)'
Returns | Either a string if the prototype is available or None . |
_Optional[str]
)