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
DWARF
Editor.hpp
Go to the documentation of this file.
1
/* Copyright 2022 - 2026 R. Thomas
2
*
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
#ifndef LIEF_DWARF_EDITOR_H
16
#define LIEF_DWARF_EDITOR_H
17
#include <memory>
18
#include <string>
19
#include <cstdint>
20
21
#include "
LIEF/compiler_attributes.hpp
"
22
#include "
LIEF/visibility.h
"
23
24
namespace
LIEF
{
25
class
Binary
;
26
namespace
dwarf
{
27
28
namespace
details
{
29
class
Editor;
30
}
31
32
namespace
editor
{
33
class
CompilationUnit
;
34
}
35
37
class
LIEF_API
Editor
{
38
public
:
39
Editor
() =
delete
;
40
Editor
(std::unique_ptr<details::Editor> impl);
41
42
enum class
FORMAT
: uint32_t {
43
ELF
,
44
MACHO,
45
PE
,
46
};
47
48
enum class
ARCH
: uint32_t {
49
UNKNOWN,
50
X64,
51
X86,
52
AARCH64,
53
ARM,
54
};
55
57
static
std::unique_ptr<Editor>
from_binary
(
LIEF::Binary
& bin);
58
60
static
std::unique_ptr<Editor>
create
(
FORMAT
fmt,
ARCH
arch);
61
63
std::unique_ptr<editor::CompilationUnit>
64
create_compilation_unit
()
LIEF_LIFETIMEBOUND
;
65
67
void
write
(const std::
string
& output);
68
69
~
Editor
();
70
71
private:
72
std::unique_ptr<
details
::
Editor
> impl_;
73
};
74
75
}
76
}
77
#endif
LIEF::Binary
Generic interface representing a binary executable.
Definition
Abstract/Binary.hpp:60
LIEF::dwarf::Editor::FORMAT
FORMAT
Definition
Editor.hpp:42
LIEF::dwarf::Editor::create
static std::unique_ptr< Editor > create(FORMAT fmt, ARCH arch)
Instantiate an editor for the given format and arch.
LIEF::dwarf::Editor::ARCH
ARCH
Definition
Editor.hpp:48
LIEF::dwarf::Editor::Editor
Editor(std::unique_ptr< details::Editor > impl)
LIEF::dwarf::Editor::from_binary
static std::unique_ptr< Editor > from_binary(LIEF::Binary &bin)
Instantiate an editor for the given binary object.
LIEF::dwarf::Editor::Editor
Editor()=delete
LIEF::dwarf::Editor::write
void write(const std::string &output)
Write the DWARF file to the specified output.
LIEF::dwarf::Editor::create_compilation_unit
std::unique_ptr< editor::CompilationUnit > create_compilation_unit()
Create a new compilation unit.
LIEF::dwarf::editor::CompilationUnit
This class represents an editable DWARF compilation unit.
Definition
DWARF/editor/CompilationUnit.hpp:43
compiler_attributes.hpp
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
LIEF::ELF
Namespace related to the LIEF's ELF module.
Definition
Abstract/Header.hpp:28
LIEF::PE
Namespace related to the LIEF's PE module.
Definition
Abstract/Header.hpp:32
LIEF::dwarf::details
Definition
DWARF/CompilationUnit.hpp:32
LIEF::dwarf::editor
Definition
Editor.hpp:32
LIEF::dwarf
Namespace for the DWARF debug format.
Definition
DWARF/CompilationUnit.hpp:30
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:41
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.17.0