16#ifndef LIEF_DEX_METHOD_H
17#define LIEF_DEX_METHOD_H
22#include "LIEF/visibility.h"
23#include "LIEF/Object.hpp"
25#include "LIEF/DEX/enums.hpp"
26#include "LIEF/DEX/CodeInfo.hpp"
27#include "LIEF/DEX/deopt.hpp"
39 using access_flags_list_t = std::vector<ACCESS_FLAGS>;
42 using bytecode_t = std::vector<uint8_t>;
50 const std::string&
name()
const;
77 void insert_dex2dex_info(uint32_t pc, uint32_t index);
79 void accept(
Visitor& visitor)
const override;
81 const dex2dex_method_info_t& dex2dex_info()
const;
84 bool has(ACCESS_FLAGS f)
const;
90 LIEF_API
friend std::ostream& operator<<(std::ostream& os,
const Method& mtd);
95 void set_virtual(
bool v);
99 Class* parent_ =
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_;
110 dex2dex_method_info_t dex2dex_info_;
Class which represents a DEX Class (i.e. a Java/Kotlin class)
Definition DEX/Class.hpp:35
Definition CodeInfo.hpp:33
Class which represents a DEX::Method.
Definition DEX/Method.hpp:36
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.
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 Visitor.hpp:219
LIEF namespace.
Definition Abstract/Binary.hpp:32