LIEF: Library to Instrument Executable Formats
Version 0.17.4
Toggle main menu visibility
Loading...
Searching...
No Matches
install
linux
x86_64
sdk
static
include
LIEF
OAT
DexFile.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2025 R. Thomas
2
* Copyright 2017 - 2025 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 <cstdint>
20
#include <string>
21
#include <vector>
22
23
#include "
LIEF/visibility.h
"
24
#include "
LIEF/Object.hpp
"
25
26
namespace
LIEF
{
27
class
Visitor
;
28
29
namespace
DEX
{
30
class
File
;
31
}
32
33
namespace
OAT
{
34
class
Parser
;
35
36
class
LIEF_API
DexFile
:
public
Object
{
37
friend
class
Parser
;
38
39
public
:
40
DexFile
();
41
DexFile
(
const
DexFile
&);
42
DexFile
&
operator=
(
const
DexFile
&);
43
44
const
std::string&
location
()
const
;
45
46
uint32_t
checksum
()
const
;
47
uint32_t
dex_offset
()
const
;
48
49
bool
has_dex_file
()
const
;
50
51
const
DEX::File
*
dex_file
()
const
;
52
DEX::File
*
dex_file
();
53
54
void
location
(
const
std::string&
location
);
55
void
checksum
(uint32_t
checksum
);
56
void
dex_offset
(uint32_t
dex_offset
);
57
58
const
std::vector<uint32_t>&
classes_offsets
()
const
;
59
60
// Android 7.X.X and Android 8.0.0
61
// ===============================
62
uint32_t
lookup_table_offset
()
const
;
63
64
void
class_offsets_offset
(uint32_t offset);
65
void
lookup_table_offset
(uint32_t offset);
66
// ===============================
67
68
void
accept
(
Visitor
& visitor)
const override
;
69
70
71
~DexFile
()
override
;
72
73
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
const
DexFile
&
dex_file
);
74
75
private
:
76
std::string location_;
77
uint32_t checksum_ = 0;
78
uint32_t dex_offset_ = 0;
79
80
DEX::File
* dex_file_ =
nullptr
;
81
82
// OAT 64 (Android 6.X.X)
83
std::vector<uint32_t> classes_offsets_;
84
85
// OAT 79 / 88 (Android 7.X.X)
86
uint32_t lookup_table_offset_ = 0;
87
88
// OAT 131 (Android 8.1.0)
89
uint32_t method_bss_mapping_offset_ = 0;
90
uint32_t dex_sections_layout_offset_ = 0;
91
};
92
93
}
// Namespace OAT
94
}
// Namespace LIEF
95
#endif
Object.hpp
LIEF::DEX::File
Class that represents a DEX file.
Definition
DEX/File.hpp:39
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
const std::string & 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:37
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:38
LIEF::Object::Object
Object()
LIEF::Visitor
Definition
Visitor.hpp:210
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:41
Generated by
1.17.0