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
DEX
MapItem.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_MAP_ITEM_H
17
#define LIEF_MAP_ITEM_H
18
19
#include <cstdint>
20
#include <ostream>
21
22
#include "
LIEF/visibility.h
"
23
#include "
LIEF/Object.hpp
"
24
25
namespace
LIEF
{
26
namespace
DEX
{
27
class
Parser
;
28
class
Class
;
29
31
class
LIEF_API
MapItem
:
public
Object
{
32
friend
class
Parser
;
33
34
public
:
35
enum class
TYPES
: uint16_t {
36
HEADER = 0x0000,
37
STRING_ID = 0x0001,
38
TYPE_ID = 0x0002,
39
PROTO_ID = 0x0003,
40
FIELD_ID = 0x0004,
41
METHOD_ID = 0x0005,
42
CLASS_DEF = 0x0006,
43
CALL_SITE_ID = 0x0007,
44
METHOD_HANDLE = 0x0008,
45
MAP_LIST = 0x1000,
46
TYPE_LIST = 0x1001,
47
ANNOTATION_SET_REF_LIST = 0x1002,
48
ANNOTATION_SET = 0x1003,
49
CLASS_DATA = 0x2000,
50
CODE = 0x2001,
51
STRING_DATA = 0x2002,
52
DEBUG_INFO = 0x2003,
53
ANNOTATION = 0x2004,
54
ENCODED_ARRAY = 0x2005,
55
ANNOTATIONS_DIRECTORY = 0x2006,
56
57
};
58
59
public
:
60
MapItem
();
61
MapItem
(
TYPES
type
, uint32_t
offset
, uint32_t
size
, uint16_t
reserved
= 0);
62
63
MapItem
(
const
MapItem
&);
64
MapItem
&
operator=
(
const
MapItem
&);
65
67
TYPES
type
()
const
;
68
70
uint16_t
reserved
()
const
;
71
73
uint32_t
size
()
const
;
74
77
uint32_t
offset
()
const
;
78
79
void
accept
(
Visitor
& visitor)
const override
;
80
81
82
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
const
MapItem
& item);
83
84
~MapItem
()
override
;
85
86
private
:
87
TYPES
type_;
88
uint16_t reserved_;
89
uint32_t size_;
90
uint32_t offset_;
91
92
};
93
94
}
// Namespace DEX
95
}
// Namespace LIEF
96
#endif
Object.hpp
LIEF::DEX::Class
Class which represents a DEX Class (i.e. a Java/Kotlin class).
Definition
DEX/Class.hpp:36
LIEF::DEX::MapItem::MapItem
MapItem(const MapItem &)
LIEF::DEX::MapItem::operator=
MapItem & operator=(const MapItem &)
LIEF::DEX::MapItem::offset
uint32_t offset() const
Offset from the start of the DEX file to the items associated with the underlying TYPES.
LIEF::DEX::MapItem::reserved
uint16_t reserved() const
Reserved value (likely for alignment prupose).
LIEF::DEX::MapItem::MapItem
MapItem(TYPES type, uint32_t offset, uint32_t size, uint16_t reserved=0)
LIEF::DEX::MapItem::size
uint32_t size() const
The number of elements (the real meaning depends on the type).
LIEF::DEX::MapItem::type
TYPES type() const
The type of the item.
LIEF::DEX::MapItem::MapItem
MapItem()
LIEF::DEX::MapItem::operator<<
friend std::ostream & operator<<(std::ostream &os, const MapItem &item)
LIEF::DEX::MapItem::~MapItem
~MapItem() override
LIEF::DEX::MapItem::Parser
friend class Parser
Definition
MapItem.hpp:32
LIEF::DEX::MapItem::TYPES
TYPES
Definition
MapItem.hpp:35
LIEF::DEX::MapItem::accept
void accept(Visitor &visitor) const override
LIEF::DEX::Parser
Class which parses a DEX file to produce a DEX::File object.
Definition
DEX/Parser.hpp:38
LIEF::Object::Object
Object()
LIEF::Visitor
Definition
Visitor.hpp:210
LIEF::DEX
Definition
DEX/Class.hpp:30
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:41
Generated by
1.17.0