LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
assembler.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 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_RUNTIME_ASSEMBLER_H
16#define LIEF_RUNTIME_ASSEMBLER_H
17#include "LIEF/visibility.h"
18#include <string_view>
19#include <vector>
20
22
23namespace llvm {
24class MCInst;
25}
26
27
28namespace LIEF::runtime {
29
46LIEF_API std::vector<uint8_t> assemble(
47 uint64_t addr, std::string_view Asm,
49);
50
53LIEF_API std::vector<uint8_t> assemble(uint64_t address, const llvm::MCInst& inst);
54
57LIEF_API std::vector<uint8_t> assemble(uint64_t address,
58 const std::vector<llvm::MCInst>& insts);
59
60}
61
62#endif
This class exposes the different elements that can be configured to assemble code.
Definition AssemblerConfig.hpp:29
static AssemblerConfig & default_config()
Default configuration.
Definition AssemblerConfig.hpp:50
Definition android/Host.hpp:23
std::vector< uint8_t > assemble(uint64_t addr, std::string_view Asm, assembly::AssemblerConfig &config=assembly::AssemblerConfig::default_config())
Assemble the provided assembly code at the specified (absolute) virtual address.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:44