Go to the documentation of this file.
16#ifndef LIEF_DEX_METHOD_H
17#define LIEF_DEX_METHOD_H
39 using access_flags_list_t = std::vector<ACCESS_FLAGS>;
42 using bytecode_t = std::vector<uint8_t>;
44 Method(std::string name, Class* parent =
nullptr);
48 const std::string&
name()
const;
54 const Class*
cls()
const;
79 void accept(Visitor& visitor)
const override;
82 bool has(ACCESS_FLAGS f)
const;
95 void set_virtual(
bool v);
99 Class* parent_ =
nullptr;
100 Prototype* prototype_ =
nullptr;
101 uint32_t access_flags_ = ACCESS_FLAGS::ACC_UNKNOWN;
102 uint32_t original_index_ = UINT_MAX;
103 bool is_virtual_ =
false;
105 uint64_t code_offset_ = 0;
106 std::vector<uint8_t> bytecode_;
Class which represents a DEX Class (i.e. a Java/Kotlin class)
Definition DEX/Class.hpp:36
Class which represents a DEX::Method.
Definition DEX/Method.hpp:36
void accept(Visitor &visitor) const override
friend std::ostream & operator<<(std::ostream &os, const Method &mtd)
const dex2dex_method_info_t & dex2dex_info() const
Method(std::string name, Class *parent=nullptr)
void insert_dex2dex_info(uint32_t pc, uint32_t index)
const bytecode_t & bytecode() const
Dalvik Bytecode as bytes.
bool is_virtual() const
True if this method is a virtual one. i.e. not static, private, finale or constructor.
const std::string & name() const
Name of the Method.
Method & operator=(const Method &)
const Class * cls() const
DEX::Class associated with this Method or a nullptr if not resolved.
access_flags_list_t access_flags() const
ACCESS_FLAGS as an std::set.
bool has(ACCESS_FLAGS f) const
Check if the current method has the given ACCESS_FLAGS.
size_t index() const
Index in the DEX Methods pool.
const Prototype * prototype() const
Method's prototype or a nullptr if it is not resolved.
bool has_class() const
True if a class is associated with this method.
uint64_t code_offset() const
Offset to the Dalvik Bytecode.
Class which parses a DEX file to produce a DEX::File object.
Definition DEX/Parser.hpp:38
Class which represents a DEX method prototype.
Definition Prototype.hpp:29
Definition DEX/Class.hpp:30
std::unordered_map< uint32_t, uint32_t > dex2dex_method_info_t
Definition deopt.hpp:27
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41