LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::assembly::x86::operands::Memory Class Reference

This class represents a memory operand. More...

#include <Memory.hpp>

Inheritance diagram for LIEF::assembly::x86::operands::Memory:
Collaboration diagram for LIEF::assembly::x86::operands::Memory:

Public Member Functions

REG base () const
 The base register.
 
REG scaled_register () const
 The scaled register.
 
REG segment_register () const
 The segment register associated with the memory operation.
 
uint64_t scale () const
 The scale value associated with the scaled_register():
 
int64_t displacement () const
 The displacement value.
 
 ~Memory () override=default
 
- Public Member Functions inherited from LIEF::assembly::x86::Operand
std::string to_string () const
 Pretty representation of the operand.
 
template<class T >
const T * as () const
 This function can be used to down cast an Operand instance:
 
virtual ~Operand ()
 

Static Public Member Functions

static bool classof (const Operand *op)
 

Detailed Description

This class represents a memory operand.

For instance:

movq xmm3, qword ptr [rip + 823864];
|
|
Memory
|
+-----------+-----------+
| | |
Base: rip Scale: 1 Displacement: 823864

Constructor & Destructor Documentation

◆ ~Memory()

LIEF::assembly::x86::operands::Memory::~Memory ( )
overridedefault

Member Function Documentation

◆ base()

REG LIEF::assembly::x86::operands::Memory::base ( ) const

The base register.

For lea rdx, [rip + 244634] it would return rip

◆ classof()

static bool LIEF::assembly::x86::operands::Memory::classof ( const Operand * op)
static

◆ displacement()

int64_t LIEF::assembly::x86::operands::Memory::displacement ( ) const

The displacement value.

For call qword ptr [rip + 248779] it would return 248779

◆ scale()

uint64_t LIEF::assembly::x86::operands::Memory::scale ( ) const

The scale value associated with the scaled_register():

For mov rdi, qword ptr [r13 + 8*r14] it would return 8

◆ scaled_register()

REG LIEF::assembly::x86::operands::Memory::scaled_register ( ) const

The scaled register.

For mov rdi, qword ptr [r13 + 8*r14] it would return r14

◆ segment_register()

REG LIEF::assembly::x86::operands::Memory::segment_register ( ) const

The segment register associated with the memory operation.

For mov eax, dword ptr gs:[0] is would return gs


The documentation for this class was generated from the following file: