C++

Note

You can also find the Doxygen documentation here: here

Engine

class Engine

This class interfaces the assembler/disassembler support.

Public Types

using instructions_it = iterator_range<Instruction::Iterator>

Disassembly instruction iterator.

Public Functions

Engine() = delete
Engine(std::unique_ptr<details::Engine> impl)
Engine(const Engine&) = delete
Engine &operator=(const Engine&) = delete
Engine(Engine&&) noexcept
Engine &operator=(Engine&&) noexcept
instructions_it disassemble(const uint8_t *buffer, size_t size, uint64_t addr)

Disassemble the provided buffer with the address specified in the second parameter.

inline instructions_it disassemble(const std::vector<uint8_t> &bytes, uint64_t addr)

Disassemble the given vector of bytes with the address specified in the second parameter.

~Engine()

Instruction

class Instruction

This class represents an assembly instruction.

Public Functions

virtual ~Instruction()
uint64_t address() const

Address of the instruction.

size_t size() const

Size of the instruction in bytes.

const std::vector<uint8_t> &raw() const

Raw bytes of the current instruction.

std::string mnemonic() const

Instruction mnemonic (e.g. br)

std::string to_string() const

Representation of the current instruction in a pretty assembly way.

Friends

inline friend std::ostream &operator<<(std::ostream &os, const Instruction &inst)
class Iterator : public LIEF::iterator_facade_base<Iterator, std::forward_iterator_tag, std::unique_ptr<Instruction>, std::ptrdiff_t, Instruction*, std::unique_ptr<Instruction>>

Public Types

using implementation = details::InstructionIt

Public Functions

Iterator(std::unique_ptr<details::InstructionIt> impl)
Iterator(const Iterator&)
Iterator &operator=(const Iterator&)
Iterator(Iterator&&) noexcept
Iterator &operator=(Iterator&&) noexcept
~Iterator()
Iterator &operator++()
std::unique_ptr<Instruction> operator*() const

Friends

friend bool operator==(const Iterator &LHS, const Iterator &RHS)
inline friend bool operator!=(const Iterator &LHS, const Iterator &RHS)