LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
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/visibility.h"
22
23namespace LIEF {
24class Binary;
25namespace dwarf {
26
27namespace details {
28class Editor;
29}
30
31namespace editor {
32class CompilationUnit;
33}
34
37 public:
38 Editor() = delete;
39 Editor(std::unique_ptr<details::Editor> impl);
40
41 enum class FORMAT : uint32_t {
45 };
46
47 enum class ARCH : uint32_t {
52 };
53
55 static std::unique_ptr<Editor> from_binary(LIEF::Binary& bin);
56
58 static std::unique_ptr<Editor> create(FORMAT fmt, ARCH arch);
59
61 std::unique_ptr<editor::CompilationUnit> create_compilation_unit();
62
64 void write(const std::string& output);
65
67
68 private:
69 std::unique_ptr<details::Editor> impl_;
70
71};
72
73}
74}
75#endif
Generic interface representing a binary executable.
Definition Abstract/Binary.hpp:59
FORMAT
Definition Editor.hpp:41
@ PE
Definition Editor.hpp:44
@ ELF
Definition Editor.hpp:42
@ MACHO
Definition Editor.hpp:43
static std::unique_ptr< Editor > create(FORMAT fmt, ARCH arch)
Instantiate an editor for the given format and arch.
ARCH
Definition Editor.hpp:47
@ AARCH64
Definition Editor.hpp:50
@ ARM
Definition Editor.hpp:51
@ X64
Definition Editor.hpp:48
@ X86
Definition Editor.hpp:49
Editor(std::unique_ptr< details::Editor > impl)
static std::unique_ptr< Editor > from_binary(LIEF::Binary &bin)
Instantiate an editor for the given binary object.
void write(const std::string &output)
Write the DWARF file to the specified output.
std::unique_ptr< editor::CompilationUnit > create_compilation_unit()
Create a new compilation unit.
This class represents an editable DWARF compilation unit.
Definition DWARF/editor/CompilationUnit.hpp:41
Definition DWARF/CompilationUnit.hpp:30
Definition Editor.hpp:31
Namespace for the DWARF debug format.
Definition DWARF/CompilationUnit.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:41