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
OAT
DexFile.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_DEXFILE_H
17
#define LIEF_OAT_DEXFILE_H
18
19
#include <string_view>
20
#include <cstdint>
21
#include <string>
22
#include <vector>
23
24
#include "
LIEF/Object.hpp
"
25
#include "
LIEF/visibility.h
"
26
27
namespace
LIEF
{
28
class
Visitor
;
29
30
namespace
DEX
{
31
class
File
;
32
}
33
34
namespace
OAT
{
35
class
Parser
;
36
37
class
LIEF_API
DexFile
:
public
Object
{
38
friend
class
Parser
;
39
40
public
:
41
DexFile
();
42
DexFile
(
const
DexFile
&);
43
DexFile
&
operator=
(
const
DexFile
&);
44
45
std::string_view
location
()
const
;
46
47
uint32_t
checksum
()
const
;
48
uint32_t
dex_offset
()
const
;
49
50
bool
has_dex_file
()
const
;
51
52
const
DEX::File
*
dex_file
()
const
;
53
DEX::File
*
dex_file
();
54
55
void
location
(
const
std::string&
location
);
56
void
checksum
(uint32_t
checksum
);
57
void
dex_offset
(uint32_t
dex_offset
);
58
59
const
std::vector<uint32_t>&
classes_offsets
()
const
;
60
61
// Android 7.X.X and Android 8.0.0
62
// ===============================
63
uint32_t
lookup_table_offset
()
const
;
64
65
void
class_offsets_offset
(uint32_t offset);
66
void
lookup_table_offset
(uint32_t offset);
67
// ===============================
68
69
void
accept
(
Visitor
& visitor)
const override
;
70
71
72
~DexFile
()
override
;
73
74
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
75
const
DexFile
&
dex_file
);
76
77
private
:
78
std::string location_;
79
uint32_t checksum_ = 0;
80
uint32_t dex_offset_ = 0;
81
82
DEX::File
* dex_file_ =
nullptr
;
83
84
// OAT 64 (Android 6.X.X)
85
std::vector<uint32_t> classes_offsets_;
86
87
// OAT 79 / 88 (Android 7.X.X)
88
uint32_t lookup_table_offset_ = 0;
89
90
// OAT 131 (Android 8.1.0)
91
uint32_t method_bss_mapping_offset_ = 0;
92
uint32_t dex_sections_layout_offset_ = 0;
93
};
94
95
}
// Namespace OAT
96
}
// Namespace LIEF
97
#endif
Object.hpp
LIEF::DEX::File
Class that represents a DEX file.
Definition
DEX/File.hpp:40
LIEF::OAT::DexFile::dex_file
DEX::File * dex_file()
LIEF::OAT::DexFile::operator<<
friend std::ostream & operator<<(std::ostream &os, const DexFile &dex_file)
LIEF::OAT::DexFile::operator=
DexFile & operator=(const DexFile &)
LIEF::OAT::DexFile::classes_offsets
const std::vector< uint32_t > & classes_offsets() const
LIEF::OAT::DexFile::dex_offset
void dex_offset(uint32_t dex_offset)
LIEF::OAT::DexFile::checksum
void checksum(uint32_t checksum)
LIEF::OAT::DexFile::DexFile
DexFile(const DexFile &)
LIEF::OAT::DexFile::checksum
uint32_t checksum() const
LIEF::OAT::DexFile::location
void location(const std::string &location)
LIEF::OAT::DexFile::lookup_table_offset
uint32_t lookup_table_offset() const
LIEF::OAT::DexFile::accept
void accept(Visitor &visitor) const override
LIEF::OAT::DexFile::location
std::string_view location() const
LIEF::OAT::DexFile::lookup_table_offset
void lookup_table_offset(uint32_t offset)
LIEF::OAT::DexFile::has_dex_file
bool has_dex_file() const
LIEF::OAT::DexFile::~DexFile
~DexFile() override
LIEF::OAT::DexFile::Parser
friend class Parser
Definition
DexFile.hpp:38
LIEF::OAT::DexFile::dex_file
const DEX::File * dex_file() const
LIEF::OAT::DexFile::class_offsets_offset
void class_offsets_offset(uint32_t offset)
LIEF::OAT::DexFile::DexFile
DexFile()
LIEF::OAT::DexFile::dex_offset
uint32_t dex_offset() const
LIEF::OAT::Parser
Class to parse an OAT file to produce an OAT::Binary.
Definition
OAT/Parser.hpp:40
LIEF::Object::Object
Object()
LIEF::Visitor
Definition
Visitor.hpp:212
LIEF::DEX
Definition
DEX/Class.hpp:31
LIEF::OAT
Definition
ELF/Parser.hpp:32
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:41
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.18.0