C++¶
AssemblerConfig¶
- class AssemblerConfig¶
This class exposes the different elements that can be configured to assemble code.
Public Types
Public Functions
- AssemblerConfig() = default¶
- AssemblerConfig(const AssemblerConfig&) = default¶
- AssemblerConfig &operator=(const AssemblerConfig&) = default¶
- AssemblerConfig(AssemblerConfig&&) = default¶
- AssemblerConfig &operator=(AssemblerConfig&&) = default¶
- inline virtual std::optional<uint64_t> resolve_symbol(const std::string&)¶
This function aims to be overloaded in order to resolve symbols used in the assembly listing.
For instance, given this assembly code:
0x1000: mov rdi, rbx 0x1003: call _my_function
The function
_my_functionwill remain undefined unless we return its address inresolve_symbol():class MyConfig : public AssemblerConfig { public: std::optional<uint64_t> resolve_symbol(const std::string& name) { if (name == "_my_function") { return 0x4000; } return std::nullopt; // or AssemblerConfig::resolve_symbol(name) } };
- virtual ~AssemblerConfig() = default¶
Public Members
- DIALECT dialect = DIALECT::DEFAULT_DIALECT¶
The dialect of the input assembly code.
Public Static Functions
- static inline AssemblerConfig &default_config()¶
Default configuration.
- AssemblerConfig() = default¶