LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
LIEF::Function Class Reference

Class that represents a function in the binary. More...

#include <Function.hpp>

Inheritance diagram for LIEF::Function:
Inheritance graph
[legend]
Collaboration diagram for LIEF::Function:
Collaboration graph
[legend]

Public Types

enum class  FLAGS {
  NONE = 0 , CONSTRUCTOR , DESTRUCTOR , DEBUG ,
  EXPORTED , IMPORTED
}
 Flags used to characterize the semantic of the function. More...
 
using flags_list_t = std::vector<FLAGS>
 
using flags_t = std::set<FLAGS>
 
- Public Types inherited from LIEF::Object
template<class T >
using output_t = add_pointer_t<decay_t<T>>
 
template<class T >
using output_const_t = add_pointer_t<add_const_t<decay_t<T>>>
 

Public Member Functions

 Function (const std::string &name)
 
 Function (uint64_t address)
 
 Function (const std::string &name, uint64_t address)
 
 Function (const std::string &name, uint64_t address, const flags_list_t &flags)
 
 Function (const Function &)
 
Functionoperator= (const Function &)
 
flags_list_t flags () const
 List of FLAGS.
 
Functionadd (FLAGS f)
 Add a flag to the current function.
 
uint64_t address () const
 Address of the current function. For functions that are set with the FLAGS::IMPORTED flag, this value is likely 0.
 
void address (uint64_t address)
 
void accept (Visitor &visitor) const override
 Method so that the visitor can visit us.
 
- Public Member Functions inherited from LIEF::Symbol
 Symbol (std::string name)
 
 Symbol (std::string name, uint64_t value)
 
 Symbol (std::string name, uint64_t value, uint64_t size)
 
 Symbol (const Symbol &)
 
Symboloperator= (const Symbol &)
 
void swap (Symbol &other)
 
virtual const std::string & name () const
 Return the symbol's name.
 
virtual std::string & name ()
 
virtual void name (const std::string &name)
 Set symbol name.
 
virtual uint64_t value () const
 
virtual void value (uint64_t value)
 
virtual uint64_t size () const
 This size of the symbol (when applicable)
 
virtual void size (uint64_t value)
 
void accept (Visitor &visitor) const override
 Method so that the visitor can visit us.
 
- Public Member Functions inherited from LIEF::Object
 Object (const Object &other)
 
Objectoperator= (const Object &other)
 
template<class T >
output_t< T > as ()
 
template<class T >
output_const_t< T > as () const
 
virtual bool operator== (const Object &other) const
 
virtual bool operator!= (const Object &other) const
 

Detailed Description

Class that represents a function in the binary.

Member Enumeration Documentation

◆ FLAGS

enum class LIEF::Function::FLAGS
strong

Flags used to characterize the semantic of the function.

Enumerator
CONSTRUCTOR 

The function acts as constructor.

Usually this flag is associated with functions that are located in the .init_array, __mod_init_func or .tls sections

DESTRUCTOR 

The function acts a destructor.

Usually this flag is associated with functions that are located in the .fini_array or __mod_term_func sections

DEBUG 

The function is associated with Debug information.

EXPORTED 

The function is exported by the binary and the address() method returns its virtual address in the binary.

IMPORTED 

The function is imported by the binary and the address() should return 0.

Member Function Documentation

◆ accept()

void LIEF::Function::accept ( Visitor & visitor) const
overridevirtual

Method so that the visitor can visit us.

Implements LIEF::Object.


The documentation for this class was generated from the following file: