retdec
|
#include <function.h>
Public Types | |
enum | eLinkType { DECOMPILER_DEFINED = 0 , USER_DEFINED , STATICALLY_LINKED , DYNAMICALLY_LINKED , SYSCALL , IDIOM } |
![]() | |
using | RangeType = T |
Public Member Functions | |
Function (const std::string &name=std::string()) | |
Function (retdec::common::Address start, retdec::common::Address end, const std::string &name=std::string()) | |
bool | operator< (const Function &o) const |
bool | operator== (const Function &o) const |
bool | operator!= (const Function &o) const |
Function query methods. | |
bool | isDecompilerDefined () const |
bool | isUserDefined () const |
bool | isStaticallyLinked () const |
bool | isDynamicallyLinked () const |
bool | isSyscall () const |
bool | isIdiom () const |
bool | isFromDebug () const |
bool | isWrapper () const |
bool | isConstructor () const |
bool | isDestructor () const |
bool | isVirtual () const |
bool | isExported () const |
bool | isVariadic () const |
bool | isThumb () const |
Function set methods. | |
void | setName (const std::string &n) |
void | setRealName (const std::string &n) |
void | setDemangledName (const std::string &n) |
void | setComment (const std::string &c) |
void | addComment (const std::string &c) |
void | setDeclarationString (const std::string &s) |
void | setSourceFileName (const std::string &n) |
void | setWrappedFunctionName (const std::string &n) |
void | setStartLine (const retdec::common::Address &l) |
void | setEndLine (const retdec::common::Address &l) |
void | setIsDecompilerDefined () |
void | setIsUserDefined () |
void | setIsStaticallyLinked () const |
void | setIsDynamicallyLinked () const |
void | setIsSyscall () |
void | setIsIdiom () |
void | setIsFromDebug (bool d) |
void | setIsConstructor (bool f) |
void | setIsDestructor (bool f) |
void | setIsVirtual (bool f) |
void | setIsExported (bool f) |
void | setIsVariadic (bool f) |
void | setIsThumb (bool f) |
void | setLinkType (eLinkType lt) |
Function get methods. | |
const std::string & | getId () const |
const std::string & | getName () const |
const std::string & | getRealName () const |
std::string | getDemangledName () const |
std::string | getComment () const |
std::string | getDeclarationString () const |
std::string | getSourceFileName () const |
std::string | getWrappedFunctionName () const |
LineNumber | getStartLine () const |
LineNumber | getEndLine () const |
eLinkType | getLinkType () const |
![]() | |
Range () | |
Range (const RangeType &start, const RangeType &end) | |
Range (const Range< RangeType > &range) | |
Range (Range< RangeType > &&range) noexcept(std::is_nothrow_move_constructible< RangeType >::value) | |
virtual | ~Range ()=default |
Range & | operator= (const Range< RangeType > &rhs)=default |
Range & | operator= (Range< RangeType > &&rhs)=default |
const RangeType & | getStart () const |
const RangeType & | getEnd () const |
void | setStart (const RangeType &start) |
void | setEnd (const RangeType &end) |
void | setStartEnd (const RangeType &start, const RangeType &end) |
RangeType | getSize () const |
bool | contains (const RangeType &value) const |
bool | contains (const Range< RangeType > &o) const |
bool | overlaps (const Range< RangeType > &o) const |
bool | operator== (const Range< RangeType > &rhs) const |
bool | operator< (const Range< RangeType > &rhs) const |
bool | operator!= (const Range< RangeType > &rhs) const |
Public Attributes | |
common::CallingConvention | callingConvention |
common::Storage | returnStorage |
common::Storage | frameBaseStorage |
common::Type | returnType |
common::ObjectSequentialContainer | parameters |
common::ObjectSetContainer | locals |
std::set< std::string > | usedCryptoConstants |
std::set< common::BasicBlock > | basicBlocks |
std::set< common::Address > | codeReferences |
Addresses of instructions which reference (use) this function. More... | |
Private Attributes | |
std::string | _name |
This is objects unique ID. More... | |
std::string | _realName |
std::string | _demangledName |
std::string | _comment |
std::string | _declarationString |
std::string | _sourceFileName |
std::string | _wrapperdFunctionName |
eLinkType | _linkType = DECOMPILER_DEFINED |
LineNumber | _startLine |
LineNumber | _endLine |
bool | _fromDebug = false |
bool | _constructor = false |
bool | _destructor = false |
bool | _virtualFunction = false |
bool | _exported = false |
bool | _variadic = false |
bool | _thumb = false |
Additional Inherited Members | |
![]() | |
RangeType | _start |
RangeType | _end |
Represents function.
Function's name is its unique ID. Function names in config must be the same as in LLVM IR. Function names in IR must be unique, therefore it is safe to demand unique names in config without loss of generality.
Function address is not suitable unique ID. LLVM IR do not know about functions' addresses. Some functions (syscalls) do not have meaningful addresses.
Recognized types of a function that will determine how the decompiler will treat the specified function.
When the type is DECOMPILER_DEFINED the decompiler is allowed to prefer info recieved from some heuristics, instead of info specified in the config.
When the type is USER_DEFINED the info about the function (params, type) specified in a config file will be projected on the decompiler output and the decompiler should not do any heuristcs.
Enumerator | |
---|---|
DECOMPILER_DEFINED | |
USER_DEFINED | |
STATICALLY_LINKED | |
DYNAMICALLY_LINKED | |
SYSCALL | |
IDIOM |
retdec::common::Function::Function | ( | const std::string & | name = std::string() | ) |
retdec::common::Function::Function | ( | retdec::common::Address | start, |
retdec::common::Address | end, | ||
const std::string & | name = std::string() |
||
) |
void retdec::common::Function::addComment | ( | const std::string & | c | ) |
std::string retdec::common::Function::getComment | ( | ) | const |
std::string retdec::common::Function::getDeclarationString | ( | ) | const |
std::string retdec::common::Function::getDemangledName | ( | ) | const |
LineNumber retdec::common::Function::getEndLine | ( | ) | const |
const std::string & retdec::common::Function::getId | ( | ) | const |
Function::eLinkType retdec::common::Function::getLinkType | ( | ) | const |
const std::string & retdec::common::Function::getName | ( | ) | const |
const std::string & retdec::common::Function::getRealName | ( | ) | const |
std::string retdec::common::Function::getSourceFileName | ( | ) | const |
LineNumber retdec::common::Function::getStartLine | ( | ) | const |
std::string retdec::common::Function::getWrappedFunctionName | ( | ) | const |
bool retdec::common::Function::isConstructor | ( | ) | const |
bool retdec::common::Function::isDecompilerDefined | ( | ) | const |
bool retdec::common::Function::isDestructor | ( | ) | const |
bool retdec::common::Function::isDynamicallyLinked | ( | ) | const |
bool retdec::common::Function::isExported | ( | ) | const |
bool retdec::common::Function::isFromDebug | ( | ) | const |
bool retdec::common::Function::isIdiom | ( | ) | const |
bool retdec::common::Function::isStaticallyLinked | ( | ) | const |
bool retdec::common::Function::isSyscall | ( | ) | const |
bool retdec::common::Function::isThumb | ( | ) | const |
bool retdec::common::Function::isUserDefined | ( | ) | const |
bool retdec::common::Function::isVariadic | ( | ) | const |
bool retdec::common::Function::isVirtual | ( | ) | const |
bool retdec::common::Function::isWrapper | ( | ) | const |
Some functions are just wrappers/adapters for other functions. i.e. they just call other function in their body. This member holds name of such called (wrapped) function. If it is empty, then this Function is not wrapper.
bool retdec::common::Function::operator!= | ( | const Function & | o | ) | const |
o | Other function. |
bool retdec::common::Function::operator< | ( | const Function & | o | ) | const |
o | Other function. |
bool retdec::common::Function::operator== | ( | const Function & | o | ) | const |
o | Other function to compare this instance with. |
void retdec::common::Function::setComment | ( | const std::string & | c | ) |
void retdec::common::Function::setDeclarationString | ( | const std::string & | s | ) |
void retdec::common::Function::setDemangledName | ( | const std::string & | n | ) |
void retdec::common::Function::setEndLine | ( | const retdec::common::Address & | l | ) |
void retdec::common::Function::setIsConstructor | ( | bool | f | ) |
void retdec::common::Function::setIsDecompilerDefined | ( | ) |
void retdec::common::Function::setIsDestructor | ( | bool | f | ) |
void retdec::common::Function::setIsDynamicallyLinked | ( | ) | const |
void retdec::common::Function::setIsExported | ( | bool | f | ) |
void retdec::common::Function::setIsFromDebug | ( | bool | d | ) |
void retdec::common::Function::setIsIdiom | ( | ) |
void retdec::common::Function::setIsStaticallyLinked | ( | ) | const |
void retdec::common::Function::setIsSyscall | ( | ) |
void retdec::common::Function::setIsThumb | ( | bool | f | ) |
void retdec::common::Function::setIsUserDefined | ( | ) |
void retdec::common::Function::setIsVariadic | ( | bool | f | ) |
void retdec::common::Function::setIsVirtual | ( | bool | f | ) |
void retdec::common::Function::setLinkType | ( | Function::eLinkType | lt | ) |
void retdec::common::Function::setName | ( | const std::string & | n | ) |
void retdec::common::Function::setRealName | ( | const std::string & | n | ) |
void retdec::common::Function::setSourceFileName | ( | const std::string & | n | ) |
void retdec::common::Function::setStartLine | ( | const retdec::common::Address & | l | ) |
void retdec::common::Function::setWrappedFunctionName | ( | const std::string & | n | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
This is objects unique ID.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
std::set<common::BasicBlock> retdec::common::Function::basicBlocks |
common::CallingConvention retdec::common::Function::callingConvention |
std::set<common::Address> retdec::common::Function::codeReferences |
Addresses of instructions which reference (use) this function.
common::Storage retdec::common::Function::frameBaseStorage |
common::ObjectSetContainer retdec::common::Function::locals |
common::ObjectSequentialContainer retdec::common::Function::parameters |
common::Storage retdec::common::Function::returnStorage |
common::Type retdec::common::Function::returnType |
std::set<std::string> retdec::common::Function::usedCryptoConstants |