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 * 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_RUNTIME_ASSEMBLER_H
17#define LIEF_RUNTIME_ASSEMBLER_H
18#include "LIEF/visibility.h"
19#include <string_view>
20#include <vector>
21
23
24namespace llvm {
25class MCInst;
26}
27
28
29namespace LIEF::runtime {
30
47LIEF_API std::vector<uint8_t> assemble(
48 uint64_t addr, std::string_view Asm,
50);
51
54LIEF_API std::vector<uint8_t> assemble(uint64_t address, const llvm::MCInst& inst);
55
58LIEF_API std::vector<uint8_t> assemble(uint64_t address,
59 const std::vector<llvm::MCInst>& insts);
60
61}
62
63#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:24
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:37
#define LIEF_API
Definition visibility.h:45