libTriton  version 0.6 build 1389
Public Member Functions | Protected Attributes | List of all members
triton::arch::Architecture Class Reference

The abstract architecture class. More...

#include <architecture.hpp>

Public Member Functions

TRITON_EXPORT Architecture (triton::callbacks::Callbacks *callbacks=nullptr)
 Constructor.
 
TRITON_EXPORT bool isFlag (triton::arch::registers_e regId) const
 Returns true if the register ID is a flag.
 
TRITON_EXPORT bool isFlag (const triton::arch::Register &reg) const
 Returns true if the register is a flag.
 
TRITON_EXPORT bool isRegister (triton::arch::registers_e regId) const
 Returns true if the register ID is a register.
 
TRITON_EXPORT bool isRegister (const triton::arch::Register &reg) const
 Returns true if the register is a register.
 
TRITON_EXPORT bool isRegisterValid (triton::arch::registers_e regId) const
 Returns true if the register ID is a register or a flag.
 
TRITON_EXPORT bool isRegisterValid (const triton::arch::Register &reg) const
 Returns true if the register is a register or a flag.
 
TRITON_EXPORT bool isValid (void) const
 Returns true if the architecture is valid.
 
TRITON_EXPORT triton::arch::architectures_e getArchitecture (void) const
 Returns the kind of architecture as triton::arch::architecture_e.
 
TRITON_EXPORT triton::arch::CpuInterfacegetCpuInstance (void)
 Returns the instance of the current CPU used.
 
TRITON_EXPORT triton::uint32 numberOfRegisters (void) const
 Returns the number of registers according to the CPU architecture.
 
TRITON_EXPORT triton::uint32 gprBitSize (void) const
 Returns the bit in bit of the General Purpose Registers.
 
TRITON_EXPORT triton::uint32 gprSize (void) const
 Returns the bit in byte of the General Purpose Registers.
 
TRITON_EXPORT void setArchitecture (triton::arch::architectures_e arch)
 Initializes an architecture.
 
TRITON_EXPORT void clearArchitecture (void)
 Clears the architecture states (registers and memory).
 
TRITON_EXPORT const std::unordered_map< registers_e, const triton::arch::Register > & getAllRegisters (void) const
 Returns all registers.
 
TRITON_EXPORT std::set< const triton::arch::Register * > getParentRegisters (void) const
 Returns all parent registers.
 
TRITON_EXPORT const triton::arch::RegistergetRegister (triton::arch::registers_e id) const
 Returns register from id.
 
TRITON_EXPORT const triton::arch::RegistergetParentRegister (triton::arch::registers_e id) const
 Returns parent register from id.
 
TRITON_EXPORT const triton::arch::RegistergetParentRegister (const triton::arch::Register &reg) const
 Returns parent register from register.
 
TRITON_EXPORT void disassembly (triton::arch::Instruction &inst) const
 Disassembles the instruction according to the architecture.
 
TRITON_EXPORT bool buildSemantics (triton::arch::Instruction &inst)
 Builds the instruction semantics according to the architecture. Returns true if the instruction is supported.
 
TRITON_EXPORT triton::uint8 getConcreteMemoryValue (triton::uint64 addr, bool execCallbacks=true) const
 Returns the concrete value of a memory cell.
 
TRITON_EXPORT triton::uint512 getConcreteMemoryValue (const triton::arch::MemoryAccess &mem, bool execCallbacks=true) const
 Returns the concrete value of memory cells.
 
TRITON_EXPORT std::vector< triton::uint8getConcreteMemoryAreaValue (triton::uint64 baseAddr, triton::usize size, bool execCallbacks=true) const
 Returns the concrete value of a memory area.
 
TRITON_EXPORT triton::uint512 getConcreteRegisterValue (const triton::arch::Register &reg, bool execCallbacks=true) const
 Returns the concrete value of a register.
 
TRITON_EXPORT void setConcreteMemoryValue (triton::uint64 addr, triton::uint8 value)
 [architecture api] - Sets the concrete value of a memory cell. More...
 
TRITON_EXPORT void setConcreteMemoryValue (const triton::arch::MemoryAccess &mem, const triton::uint512 &value)
 [architecture api] - Sets the concrete value of memory cells. More...
 
TRITON_EXPORT void setConcreteMemoryAreaValue (triton::uint64 baseAddr, const std::vector< triton::uint8 > &values)
 [architecture api] - Sets the concrete value of a memory area. More...
 
TRITON_EXPORT void setConcreteMemoryAreaValue (triton::uint64 baseAddr, const triton::uint8 *area, triton::usize size)
 [architecture api] - Sets the concrete value of a memory area. More...
 
TRITON_EXPORT void setConcreteRegisterValue (const triton::arch::Register &reg, const triton::uint512 &value)
 [architecture api] - Sets the concrete value of a register. More...
 
TRITON_EXPORT bool isMemoryMapped (triton::uint64 baseAddr, triton::usize size=1)
 Returns true if the range [baseAddr:size] is mapped into the internal memory representation. More...
 
TRITON_EXPORT void unmapMemory (triton::uint64 baseAddr, triton::usize size=1)
 Removes the range [baseAddr:size] from the internal memory representation. More...
 

Protected Attributes

triton::arch::architectures_e arch
 The kind of architecture used.
 
std::unique_ptr< triton::arch::CpuInterfacecpu
 Instance to the real CPU class.
 

Detailed Description

The abstract architecture class.

Definition at line 50 of file architecture.hpp.

Member Function Documentation

◆ isMemoryMapped()

bool triton::arch::Architecture::isMemoryMapped ( triton::uint64  baseAddr,
triton::usize  size = 1 
)

Returns true if the range [baseAddr:size] is mapped into the internal memory representation.

See also
getConcreteMemoryValue() and getConcreteMemoryAreaValue().

Definition at line 241 of file architecture.cpp.

◆ setConcreteMemoryAreaValue() [1/2]

void triton::arch::Architecture::setConcreteMemoryAreaValue ( triton::uint64  baseAddr,
const std::vector< triton::uint8 > &  values 
)

[architecture api] - Sets the concrete value of a memory area.

Note that by setting a concrete value will probably imply a desynchronization with the symbolic state (if it exists). You should probably use the concretize functions after this.

Definition at line 220 of file architecture.cpp.

◆ setConcreteMemoryAreaValue() [2/2]

void triton::arch::Architecture::setConcreteMemoryAreaValue ( triton::uint64  baseAddr,
const triton::uint8 area,
triton::usize  size 
)

[architecture api] - Sets the concrete value of a memory area.

Note that by setting a concrete value will probably imply a desynchronization with the symbolic state (if it exists). You should probably use the concretize functions after this.

Definition at line 227 of file architecture.cpp.

◆ setConcreteMemoryValue() [1/2]

void triton::arch::Architecture::setConcreteMemoryValue ( triton::uint64  addr,
triton::uint8  value 
)

[architecture api] - Sets the concrete value of a memory cell.

Note that by setting a concrete value will probably imply a desynchronization with the symbolic state (if it exists). You should probably use the concretize functions after this.

Definition at line 206 of file architecture.cpp.

◆ setConcreteMemoryValue() [2/2]

void triton::arch::Architecture::setConcreteMemoryValue ( const triton::arch::MemoryAccess mem,
const triton::uint512 value 
)

[architecture api] - Sets the concrete value of memory cells.

Note that by setting a concrete value will probably imply a desynchronization with the symbolic state (if it exists). You should probably use the concretize functions after this.

Definition at line 213 of file architecture.cpp.

◆ setConcreteRegisterValue()

void triton::arch::Architecture::setConcreteRegisterValue ( const triton::arch::Register reg,
const triton::uint512 value 
)

[architecture api] - Sets the concrete value of a register.

Note that by setting a concrete value will probably imply a desynchronization with the symbolic state (if it exists). You should probably use the concretize functions after this.

Definition at line 234 of file architecture.cpp.

◆ unmapMemory()

void triton::arch::Architecture::unmapMemory ( triton::uint64  baseAddr,
triton::usize  size = 1 
)

Removes the range [baseAddr:size] from the internal memory representation.

See also
isMemoryMapped().

Definition at line 248 of file architecture.cpp.


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