LIEF: Library to Instrument Executable Formats
Version 2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
ART
ART/Header.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_ART_HEADER_H
17
#define LIEF_ART_HEADER_H
18
19
#include <array>
20
#include <cstdint>
21
#include <ostream>
22
23
#include "
LIEF/ART/enums.hpp
"
24
#include "
LIEF/ART/types.hpp
"
25
26
#include "
LIEF/Object.hpp
"
27
#include "
LIEF/visibility.h
"
28
29
30
namespace
LIEF::ART
{
31
class
Parser
;
32
33
class
LIEF_API
Header
:
public
Object
{
34
friend
class
Parser
;
35
36
public
:
37
using
magic_t
= std::array<uint8_t, 4>;
38
39
Header
();
40
41
template
<
class
T>
42
LIEF_LOCAL
Header
(
const
T* header);
43
44
Header
(
const
Header
&);
45
Header
&
operator=
(
const
Header
&);
46
47
magic_t
magic
()
const
;
48
art_version_t
version
()
const
;
49
50
uint32_t
image_begin
()
const
;
51
uint32_t
image_size
()
const
;
52
53
uint32_t
oat_checksum
()
const
;
54
55
uint32_t
oat_file_begin
()
const
;
56
uint32_t
oat_file_end
()
const
;
57
58
uint32_t
oat_data_begin
()
const
;
59
uint32_t
oat_data_end
()
const
;
60
61
int32_t
patch_delta
()
const
;
62
63
uint32_t
image_roots
()
const
;
64
65
uint32_t
pointer_size
()
const
;
66
bool
compile_pic
()
const
;
67
68
uint32_t
nb_sections
()
const
;
69
uint32_t
nb_methods
()
const
;
70
71
uint32_t
boot_image_begin
()
const
;
72
uint32_t
boot_image_size
()
const
;
73
74
uint32_t
boot_oat_begin
()
const
;
75
uint32_t
boot_oat_size
()
const
;
76
77
STORAGE_MODES
storage_mode
()
const
;
78
79
uint32_t
data_size
()
const
;
80
81
void
accept
(
Visitor
& visitor)
const override
;
82
83
84
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
const
Header
& hdr);
85
86
~Header
()
override
;
87
88
private
:
89
magic_t
magic_{};
90
art_version_t
version_ = 0;
91
92
uint32_t image_begin_ = 0;
93
uint32_t image_size_ = 0;
94
95
uint32_t oat_checksum_ = 0;
96
97
uint32_t oat_file_begin_ = 0;
98
uint32_t oat_file_end_ = 0;
99
100
uint32_t oat_data_begin_ = 0;
101
uint32_t oat_data_end_ = 0;
102
103
int32_t patch_delta_ = 0;
104
uint32_t image_roots_ = 0;
105
106
uint32_t pointer_size_ = 0;
107
108
bool
compile_pic_ =
false
;
109
110
uint32_t nb_sections_ = 0;
111
uint32_t nb_methods_ = 0;
112
113
bool
is_pic_ =
false
;
114
115
// From ART 29
116
// ===========
117
uint32_t boot_image_begin_ = 0;
118
uint32_t boot_image_size_ = 0;
119
120
uint32_t boot_oat_begin_ = 0;
121
uint32_t boot_oat_size_ = 0;
122
123
STORAGE_MODES
storage_mode_ =
STORAGE_MODES::STORAGE_UNCOMPRESSED
;
124
125
uint32_t data_size_ = 0;
126
};
127
128
}
// Namespace ART
129
// Namespace LIEF
130
131
#endif
enums.hpp
types.hpp
Object.hpp
LIEF::ART::Header::operator=
Header & operator=(const Header &)
LIEF::ART::Header::compile_pic
bool compile_pic() const
LIEF::ART::Header::boot_image_begin
uint32_t boot_image_begin() const
LIEF::ART::Header::nb_sections
uint32_t nb_sections() const
LIEF::ART::Header::image_size
uint32_t image_size() const
LIEF::ART::Header::data_size
uint32_t data_size() const
LIEF::ART::Header::storage_mode
STORAGE_MODES storage_mode() const
LIEF::ART::Header::operator<<
friend std::ostream & operator<<(std::ostream &os, const Header &hdr)
LIEF::ART::Header::Header
Header()
LIEF::ART::Header::pointer_size
uint32_t pointer_size() const
LIEF::ART::Header::magic_t
std::array< uint8_t, 4 > magic_t
Definition
ART/Header.hpp:37
LIEF::ART::Header::~Header
~Header() override
LIEF::ART::Header::Header
Header(const T *header)
LIEF::ART::Header::magic
magic_t magic() const
LIEF::ART::Header::oat_file_end
uint32_t oat_file_end() const
LIEF::ART::Header::nb_methods
uint32_t nb_methods() const
LIEF::ART::Header::image_begin
uint32_t image_begin() const
LIEF::ART::Header::version
art_version_t version() const
LIEF::ART::Header::accept
void accept(Visitor &visitor) const override
LIEF::ART::Header::boot_oat_begin
uint32_t boot_oat_begin() const
LIEF::ART::Header::patch_delta
int32_t patch_delta() const
LIEF::ART::Header::oat_data_end
uint32_t oat_data_end() const
LIEF::ART::Header::Parser
friend class Parser
Definition
ART/Header.hpp:34
LIEF::ART::Header::Header
Header(const Header &)
LIEF::ART::Header::oat_file_begin
uint32_t oat_file_begin() const
LIEF::ART::Header::boot_image_size
uint32_t boot_image_size() const
LIEF::ART::Header::boot_oat_size
uint32_t boot_oat_size() const
LIEF::ART::Header::oat_data_begin
uint32_t oat_data_begin() const
LIEF::ART::Header::oat_checksum
uint32_t oat_checksum() const
LIEF::ART::Header::image_roots
uint32_t image_roots() const
LIEF::ART::Parser
Class which parses an ART file and transforms it into an ART::File object.
Definition
ART/Parser.hpp:32
LIEF::Object::Object
Object()
LIEF::Visitor
Definition
Visitor.hpp:212
LIEF::ART
Definition
ART/enums.hpp:20
LIEF::ART::STORAGE_MODES
STORAGE_MODES
Definition
ART/enums.hpp:22
LIEF::ART::STORAGE_UNCOMPRESSED
@ STORAGE_UNCOMPRESSED
Definition
ART/enums.hpp:23
LIEF::ART::art_version_t
uint32_t art_version_t
Definition
ART/types.hpp:24
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
LIEF_LOCAL
#define LIEF_LOCAL
Definition
visibility.h:46
Generated by
1.18.0