LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
Engine.hpp
Go to the documentation of this file.
1/* Copyright 2022 - 2024 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_ASM_ENGINE_H
16#define LIEF_ASM_ENGINE_H
17#include "LIEF/visibility.h"
18#include "LIEF/iterators.hpp"
20
21#include <memory>
22
23namespace LIEF {
24namespace assembly {
27
28namespace details {
29class Engine;
30}
31class LIEF_API Engine {
34 public: using instructions_it = iterator_range<Instruction::Iterator>;
37
38 Engine() = delete;
39 Engine(std::unique_ptr<details::Engine> impl);
40
41 Engine(const Engine&) = delete;
42 Engine& operator=(const Engine&) = delete;
43
44 Engine(Engine&&) noexcept;
45 Engine& operator=(Engine&&) noexcept;
46 instructions_it disassemble(const uint8_t* buffer, size_t size, uint64_t addr);
50 instructions_it disassemble(const std::vector<uint8_t>& bytes, uint64_t addr) {
54 return disassemble(bytes.data(), bytes.size(), addr);
55 }
56
58 const details::Engine& impl() const {
61 return *impl_;
62 }
63 details::Engine& impl() {
66 return *impl_;
67 }
68
69 private:
70 std::unique_ptr<details::Engine> impl_;
71};
72}
73}
74
75#endif
This class interfaces the assembler/disassembler support.
Definition Engine.hpp:33
Engine(const Engine &)=delete
Engine & operator=(const Engine &)=delete
Engine()=delete
Engine(std::unique_ptr< details::Engine > impl)
Engine(Engine &&) noexcept
~Engine()
Definition Engine.hpp:28
Namespace related to assembly/disassembly support.
Definition Abstract/Binary.hpp:43
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41