LIEF: Library to Instrument Executable Formats
Version 1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
OAT
OAT/Method.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
* Copyright 2017 - 2026 Quarkslab
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#ifndef LIEF_OAT_METHOD_H
17
#define LIEF_OAT_METHOD_H
18
19
#include <vector>
20
#include <string>
21
#include <ostream>
22
#include "
LIEF/visibility.h
"
23
#include "
LIEF/Object.hpp
"
24
#include "
LIEF/DEX/deopt.hpp
"
25
26
namespace
LIEF
{
27
namespace
DEX
{
28
class
Method
;
29
}
30
namespace
OAT
{
31
class
Parser
;
32
class
Class
;
33
34
class
LIEF_API
Method
:
public
Object
{
35
friend
class
Parser
;
36
37
public
:
39
using
quick_code_t
= std::vector<uint8_t>;
40
41
public
:
42
Method
();
43
Method
(
DEX::Method
* method,
Class
*
oat_class
, std::vector<uint8_t> code = {});
44
Method
(
const
Method
&);
45
Method
&
operator=
(
const
Method
&);
46
47
49
std::string
name
()
const
;
50
52
const
Class
*
oat_class
() const
LIEF_LIFETIMEBOUND
;
53
Class
*
oat_class
()
LIEF_LIFETIMEBOUND
;
54
57
bool
has_dex_method
() const;
58
60
const
DEX
::
Method
*
dex_method
() const
LIEF_LIFETIMEBOUND
;
61
DEX
::
Method
*
dex_method
()
LIEF_LIFETIMEBOUND
;
62
64
bool
is_dex2dex_optimized
() const;
65
66
// True if the optimization is native
67
bool
is_compiled
() const;
68
69
const
DEX
::dex2dex_method_info_t&
dex2dex_info
() const;
70
72
const
quick_code_t
&
quick_code
() const;
73
void
quick_code
(const
quick_code_t
& code);
74
75
void
accept
(
Visitor
& visitor) const override;
76
77
78
LIEF_API
friend std::ostream& operator<<(std::ostream& os, const
Method
& meth);
79
80
~
Method
() override;
81
82
private:
83
DEX
::
Method
* dex_method_ =
nullptr
;
84
Class
* class_ =
nullptr
;
85
86
quick_code_t
quick_code_;
87
};
88
89
}
// Namespace OAT
90
}
// Namespace LIEF
91
#endif
Object.hpp
LIEF::DEX::Method
Class which represents a DEX::Method.
Definition
DEX/Method.hpp:36
LIEF::OAT::Class
Definition
OAT/Class.hpp:36
LIEF::OAT::Method::dex2dex_info
const DEX::dex2dex_method_info_t & dex2dex_info() const
LIEF::OAT::Method::quick_code_t
std::vector< uint8_t > quick_code_t
Container for the Quick Code.
Definition
OAT/Method.hpp:39
LIEF::OAT::Method::has_dex_method
bool has_dex_method() const
Check if a LIEF::DEX::Method is associated with this Method.
LIEF::OAT::Method::Method
Method(DEX::Method *method, Class *oat_class, std::vector< uint8_t > code={})
LIEF::OAT::Method::is_compiled
bool is_compiled() const
LIEF::OAT::Method::dex_method
const DEX::Method * dex_method() const
LIEF::DEX::Method associated (if any).
LIEF::OAT::Method::is_dex2dex_optimized
bool is_dex2dex_optimized() const
True if the optimization is DEX.
LIEF::OAT::Method::name
std::string name() const
Method's name.
LIEF::OAT::Method::Method
Method(const Method &)
LIEF::OAT::Method::accept
void accept(Visitor &visitor) const override
LIEF::OAT::Method::Parser
friend class Parser
Definition
OAT/Method.hpp:35
LIEF::OAT::Method::oat_class
const Class * oat_class() const
OAT Class associated with this Method.
LIEF::OAT::Method::operator=
Method & operator=(const Method &)
LIEF::OAT::Method::quick_code
const quick_code_t & quick_code() const
Quick code associated with the method.
LIEF::OAT::Method::Method
Method()
LIEF::OAT::Parser
Class to parse an OAT file to produce an OAT::Binary.
Definition
OAT/Parser.hpp:38
LIEF::Object::Object
Object()
LIEF::Visitor
Definition
Visitor.hpp:212
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
deopt.hpp
LIEF::DEX
Definition
DEX/Class.hpp:30
LIEF::OAT
Definition
ELF/Parser.hpp:32
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.17.0