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
MachO
DataCodeEntry.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_MACHO_DATA_CODE_ENTRY_H
17
#define LIEF_MACHO_DATA_CODE_ENTRY_H
18
#include <ostream>
19
#include <cstdint>
20
21
#include "
LIEF/visibility.h
"
22
23
#include "
LIEF/Object.hpp
"
24
25
namespace
LIEF
{
26
namespace
MachO
{
27
28
namespace
details
{
29
struct
data_in_code_entry;
30
}
31
33
class
LIEF_API
DataCodeEntry
:
public
LIEF::Object
{
34
public
:
35
enum class
TYPES
{
36
UNKNOWN
= 0,
37
DATA = 1,
38
JUMP_TABLE_8 = 2,
39
JUMP_TABLE_16 = 3,
40
JUMP_TABLE_32 = 4,
41
ABS_JUMP_TABLE_32 = 5,
42
};
43
44
public
:
45
DataCodeEntry
() =
default
;
46
DataCodeEntry
(uint32_t off, uint16_t
length
,
TYPES
type
) :
47
offset_(off),
48
length_(
length
),
49
type_(
type
) {}
50
DataCodeEntry
(
const
details::data_in_code_entry& entry);
51
52
DataCodeEntry
&
operator=
(
const
DataCodeEntry
&) =
default
;
53
DataCodeEntry
(
const
DataCodeEntry
&) =
default
;
54
56
uint32_t
offset
()
const
{
57
return
offset_;
58
}
59
61
uint16_t
length
()
const
{
62
return
length_;
63
}
64
65
// Type of the data
66
TYPES
type
()
const
{
67
return
type_;
68
}
69
70
void
offset
(uint32_t off) {
71
offset_ = off;
72
}
73
void
length
(uint16_t
length
) {
74
length_ =
length
;
75
}
76
void
type
(
TYPES
type
) {
77
type_ =
type
;
78
}
79
80
~DataCodeEntry
()
override
=
default
;
81
82
void
accept
(
Visitor
& visitor)
const override
;
83
84
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
85
const
DataCodeEntry
& entry);
86
87
private
:
88
uint32_t offset_ = 0;
89
uint16_t length_ = 0;
90
TYPES
type_ =
TYPES::UNKNOWN
;
91
};
92
93
LIEF_API
const
char
*
to_string
(
DataCodeEntry::TYPES
e);
94
95
}
96
}
97
98
#endif
Object.hpp
LIEF::MachO::DataCodeEntry::~DataCodeEntry
~DataCodeEntry() override=default
LIEF::MachO::DataCodeEntry::operator<<
friend std::ostream & operator<<(std::ostream &os, const DataCodeEntry &entry)
LIEF::MachO::DataCodeEntry::accept
void accept(Visitor &visitor) const override
LIEF::MachO::DataCodeEntry::DataCodeEntry
DataCodeEntry()=default
LIEF::MachO::DataCodeEntry::DataCodeEntry
DataCodeEntry(const details::data_in_code_entry &entry)
LIEF::MachO::DataCodeEntry::DataCodeEntry
DataCodeEntry(const DataCodeEntry &)=default
LIEF::MachO::DataCodeEntry::offset
void offset(uint32_t off)
Definition
DataCodeEntry.hpp:70
LIEF::MachO::DataCodeEntry::type
TYPES type() const
Definition
DataCodeEntry.hpp:66
LIEF::MachO::DataCodeEntry::operator=
DataCodeEntry & operator=(const DataCodeEntry &)=default
LIEF::MachO::DataCodeEntry::length
void length(uint16_t length)
Definition
DataCodeEntry.hpp:73
LIEF::MachO::DataCodeEntry::offset
uint32_t offset() const
Offset of the data.
Definition
DataCodeEntry.hpp:56
LIEF::MachO::DataCodeEntry::DataCodeEntry
DataCodeEntry(uint32_t off, uint16_t length, TYPES type)
Definition
DataCodeEntry.hpp:46
LIEF::MachO::DataCodeEntry::type
void type(TYPES type)
Definition
DataCodeEntry.hpp:76
LIEF::MachO::DataCodeEntry::TYPES
TYPES
Definition
DataCodeEntry.hpp:35
LIEF::MachO::DataCodeEntry::TYPES::UNKNOWN
@ UNKNOWN
Definition
DataCodeEntry.hpp:36
LIEF::MachO::DataCodeEntry::length
uint16_t length() const
Length of the data.
Definition
DataCodeEntry.hpp:61
LIEF::Object
Definition
Object.hpp:25
LIEF::Visitor
Definition
Visitor.hpp:212
LIEF::MachO::details
Definition
endianness_support.hpp:60
LIEF::MachO
Namespace related to the LIEF's Mach-O module.
Definition
Abstract/Header.hpp:36
LIEF::MachO::MACHO_TYPES::UNKNOWN
@ UNKNOWN
Definition
MachO/enums.hpp:24
LIEF::MachO::to_string
const char * to_string(BuildToolVersion::TOOLS tool)
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:43
Generated by
1.17.0