LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
AssemblerConfig.hpp
Go to the documentation of this file.
1/* Copyright 2022 - 2025 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_ASSEMBLER_CONFIG_H
16#define LIEF_ASM_ASSEMBLER_CONFIG_H
17
18#include "LIEF/visibility.h"
19#include "LIEF/optional.hpp"
20
21#include <string>
22
23namespace LIEF {
24
25namespace assembly {
30 public:
31 AssemblerConfig() = default;
32
33 AssemblerConfig(const AssemblerConfig &) = default;
34 AssemblerConfig &operator=(const AssemblerConfig &) = default;
35
36 AssemblerConfig(AssemblerConfig &&) = default;
37 AssemblerConfig &operator=(AssemblerConfig &&) = default;
38 enum class DIALECT {
41 DEFAULT_DIALECT = 0, X86_INTEL,
44 X86_ATT,
47 };
48 static AssemblerConfig& default_config() {
51 static AssemblerConfig AC;
52 return AC;
53 }
54 DIALECT dialect = DIALECT::DEFAULT_DIALECT;
57 virtual optional<uint64_t> resolve_symbol(const std::string& /*name*/) {
83 return nullopt();
84 }
85
86 virtual ~AssemblerConfig() = default;
87};
88}
89}
90
91#endif
LIEF::assembly::AssemblerConfig
This class exposes the different elements that can be configured to assemble code.
Definition AssemblerConfig.hpp:29
LIEF::assembly::AssemblerConfig::operator=
AssemblerConfig & operator=(const AssemblerConfig &)=default
LIEF::assembly::AssemblerConfig::AssemblerConfig
AssemblerConfig()=default
LIEF::assembly::AssemblerConfig::default_config
static AssemblerConfig & default_config()
Default configuration.
Definition AssemblerConfig.hpp:50
LIEF::assembly::AssemblerConfig::operator=
AssemblerConfig & operator=(AssemblerConfig &&)=default
LIEF::assembly::AssemblerConfig::AssemblerConfig
AssemblerConfig(const AssemblerConfig &)=default
LIEF::assembly::AssemblerConfig::AssemblerConfig
AssemblerConfig(AssemblerConfig &&)=default
LIEF::assembly::AssemblerConfig::~AssemblerConfig
virtual ~AssemblerConfig()=default
LIEF::assembly::AssemblerConfig::resolve_symbol
virtual optional< uint64_t > resolve_symbol(const std::string &)
This function aims to be overloaded in order to resolve symbols used in the assembly listing.
Definition AssemblerConfig.hpp:82
LIEF::assembly
Namespace related to assembly/disassembly support.
Definition Abstract/Binary.hpp:47
LIEF
LIEF namespace.
Definition Abstract/Binary.hpp:40
LIEF::nullopt
tl::unexpected< lief_errors > nullopt()
Definition optional.hpp:36
optional.hpp
visibility.h
LIEF_API
#define LIEF_API
Definition visibility.h:41