libTriton version 1.0 build 1590
Loading...
Searching...
No Matches
Public Member Functions | List of all members
triton::arch::CpuInterface Interface Referenceabstract

This interface is used as abstract CPU interface. All CPU must use this interface. More...

#include <cpuInterface.hpp>

Inheritance diagram for triton::arch::CpuInterface:

Public Member Functions

virtual TRITON_EXPORT ~CpuInterface ()
 Destructor.
 
virtual TRITON_EXPORT void clear (void)=0
 Clears the architecture states (registers and memory).
 
virtual TRITON_EXPORT triton::arch::endianness_e getEndianness (void) const =0
 Returns the kind of endianness as triton::arch::endianness_e.
 
virtual TRITON_EXPORT bool isFlag (triton::arch::register_e regId) const =0
 Returns true if the register ID is a flag.
 
virtual TRITON_EXPORT bool isRegister (triton::arch::register_e regId) const =0
 Returns true if the register ID is a register.
 
virtual TRITON_EXPORT bool isRegisterValid (triton::arch::register_e regId) const =0
 Returns true if the register ID is valid.
 
virtual TRITON_EXPORT bool isThumb (void) const =0
 Returns true if the execution mode is Thumb. Only useful for Arm32.
 
virtual TRITON_EXPORT void setThumb (bool state)=0
 Sets CPU state to Thumb mode.
 
virtual TRITON_EXPORT bool isMemoryExclusive (const triton::arch::MemoryAccess &mem) const =0
 Returns true if the given memory access is tagged as exclusive. Only valid for Arm32 and AArch64.
 
virtual TRITON_EXPORT void setMemoryExclusiveTag (const triton::arch::MemoryAccess &mem, bool tag)=0
 Sets exclusive memory access tag. Only valid for Arm32 and AArch64.
 
virtual TRITON_EXPORT triton::uint32 gprSize (void) const =0
 Returns the bit in byte of the General Purpose Registers.
 
virtual TRITON_EXPORT triton::uint32 gprBitSize (void) const =0
 Returns the bit in bit of the General Purpose Registers.
 
virtual TRITON_EXPORT triton::uint32 numberOfRegisters (void) const =0
 Returns the number of registers according to the CPU architecture.
 
virtual TRITON_EXPORT std::set< const triton::arch::Register * > getParentRegisters (void) const =0
 Returns all parent registers.
 
virtual TRITON_EXPORT const std::unordered_map< triton::arch::register_e, const triton::arch::Register > & getAllRegisters (void) const =0
 Returns all registers.
 
virtual TRITON_EXPORT const std::unordered_map< triton::uint64, triton::uint8, IdentityHash< triton::uint64 > > & getConcreteMemory (void) const =0
 Return all memory.
 
virtual TRITON_EXPORT const triton::arch::RegistergetParentRegister (const triton::arch::Register &reg) const =0
 Returns parent register from a given one.
 
virtual TRITON_EXPORT const triton::arch::RegistergetParentRegister (triton::arch::register_e id) const =0
 Returns parent register from a given one.
 
virtual TRITON_EXPORT const triton::arch::RegistergetRegister (triton::arch::register_e id) const =0
 Returns register from id.
 
virtual TRITON_EXPORT const triton::arch::RegistergetRegister (const std::string &name) const =0
 Returns register from name.
 
virtual TRITON_EXPORT const triton::arch::RegistergetProgramCounter (void) const =0
 Returns the program counter register.
 
virtual TRITON_EXPORT const triton::arch::RegistergetStackPointer (void) const =0
 Returns the stack pointer register.
 
virtual TRITON_EXPORT void disassembly (triton::arch::Instruction &inst)=0
 Disassembles the instruction according to the architecture.
 
virtual TRITON_EXPORT triton::uint8 getConcreteMemoryValue (triton::uint64 addr, bool execCallbacks=true) const =0
 Returns the concrete value of a memory cell.
 
virtual TRITON_EXPORT triton::uint512 getConcreteMemoryValue (const triton::arch::MemoryAccess &mem, bool execCallbacks=true) const =0
 Returns the concrete value of memory cells.
 
virtual TRITON_EXPORT std::vector< triton::uint8getConcreteMemoryAreaValue (triton::uint64 baseAddr, triton::usize size, bool execCallbacks=true) const =0
 Returns the concrete value of a memory area.
 
virtual TRITON_EXPORT triton::uint512 getConcreteRegisterValue (const triton::arch::Register &reg, bool execCallbacks=true) const =0
 Returns the concrete value of a register.
 
virtual TRITON_EXPORT void setConcreteMemoryValue (triton::uint64 addr, triton::uint8 value, bool execCallbacks=true)=0
 [architecture api] - Sets the concrete value of a memory cell.
 
virtual TRITON_EXPORT void setConcreteMemoryValue (const triton::arch::MemoryAccess &mem, const triton::uint512 &value, bool execCallbacks=true)=0
 [architecture api] - Sets the concrete value of memory cells.
 
virtual TRITON_EXPORT void setConcreteMemoryAreaValue (triton::uint64 baseAddr, const std::vector< triton::uint8 > &values, bool execCallbacks=true)=0
 [architecture api] - Sets the concrete value of a memory area.
 
virtual TRITON_EXPORT void setConcreteMemoryAreaValue (triton::uint64 baseAddr, const void *area, triton::usize size, bool execCallbacks=true)=0
 [architecture api] - Sets the concrete value of a memory area.
 
virtual TRITON_EXPORT void setConcreteRegisterValue (const triton::arch::Register &reg, const triton::uint512 &value, bool execCallbacks=true)=0
 [architecture api] - Sets the concrete value of a register.
 
virtual TRITON_EXPORT bool isConcreteMemoryValueDefined (const triton::arch::MemoryAccess &mem) const =0
 Returns true if memory cells have a defined concrete value.
 
virtual TRITON_EXPORT bool isConcreteMemoryValueDefined (triton::uint64 baseAddr, triton::usize size=1) const =0
 Returns true if memory cells have a defined concrete value.
 
virtual TRITON_EXPORT void clearConcreteMemoryValue (const triton::arch::MemoryAccess &mem)=0
 Clears concrete values assigned to the memory cells.
 
virtual TRITON_EXPORT void clearConcreteMemoryValue (triton::uint64 baseAddr, triton::usize size=1)=0
 Clears concrete values assigned to the memory cells.
 

Detailed Description

This interface is used as abstract CPU interface. All CPU must use this interface.

Definition at line 42 of file cpuInterface.hpp.

Constructor & Destructor Documentation

◆ ~CpuInterface()

virtual TRITON_EXPORT triton::arch::CpuInterface::~CpuInterface ( )
inlinevirtual

Destructor.

Definition at line 45 of file cpuInterface.hpp.

Member Function Documentation

◆ clear()

virtual TRITON_EXPORT void triton::arch::CpuInterface::clear ( void  )
pure virtual

Clears the architecture states (registers and memory).

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ clearConcreteMemoryValue() [1/2]

virtual TRITON_EXPORT void triton::arch::CpuInterface::clearConcreteMemoryValue ( const triton::arch::MemoryAccess mem)
pure virtual

◆ clearConcreteMemoryValue() [2/2]

virtual TRITON_EXPORT void triton::arch::CpuInterface::clearConcreteMemoryValue ( triton::uint64  baseAddr,
triton::usize  size = 1 
)
pure virtual

◆ disassembly()

virtual TRITON_EXPORT void triton::arch::CpuInterface::disassembly ( triton::arch::Instruction inst)
pure virtual

Disassembles the instruction according to the architecture.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ getAllRegisters()

virtual TRITON_EXPORT const std::unordered_map< triton::arch::register_e, const triton::arch::Register > & triton::arch::CpuInterface::getAllRegisters ( void  ) const
pure virtual

◆ getConcreteMemory()

virtual TRITON_EXPORT const std::unordered_map< triton::uint64, triton::uint8, IdentityHash< triton::uint64 > > & triton::arch::CpuInterface::getConcreteMemory ( void  ) const
pure virtual

◆ getConcreteMemoryAreaValue()

virtual TRITON_EXPORT std::vector< triton::uint8 > triton::arch::CpuInterface::getConcreteMemoryAreaValue ( triton::uint64  baseAddr,
triton::usize  size,
bool  execCallbacks = true 
) const
pure virtual

◆ getConcreteMemoryValue() [1/2]

virtual TRITON_EXPORT triton::uint512 triton::arch::CpuInterface::getConcreteMemoryValue ( const triton::arch::MemoryAccess mem,
bool  execCallbacks = true 
) const
pure virtual

◆ getConcreteMemoryValue() [2/2]

virtual TRITON_EXPORT triton::uint8 triton::arch::CpuInterface::getConcreteMemoryValue ( triton::uint64  addr,
bool  execCallbacks = true 
) const
pure virtual

◆ getConcreteRegisterValue()

virtual TRITON_EXPORT triton::uint512 triton::arch::CpuInterface::getConcreteRegisterValue ( const triton::arch::Register reg,
bool  execCallbacks = true 
) const
pure virtual

◆ getEndianness()

virtual TRITON_EXPORT triton::arch::endianness_e triton::arch::CpuInterface::getEndianness ( void  ) const
pure virtual

◆ getParentRegister() [1/2]

virtual TRITON_EXPORT const triton::arch::Register & triton::arch::CpuInterface::getParentRegister ( const triton::arch::Register reg) const
pure virtual

◆ getParentRegister() [2/2]

virtual TRITON_EXPORT const triton::arch::Register & triton::arch::CpuInterface::getParentRegister ( triton::arch::register_e  id) const
pure virtual

◆ getParentRegisters()

virtual TRITON_EXPORT std::set< const triton::arch::Register * > triton::arch::CpuInterface::getParentRegisters ( void  ) const
pure virtual

◆ getProgramCounter()

virtual TRITON_EXPORT const triton::arch::Register & triton::arch::CpuInterface::getProgramCounter ( void  ) const
pure virtual

◆ getRegister() [1/2]

virtual TRITON_EXPORT const triton::arch::Register & triton::arch::CpuInterface::getRegister ( const std::string &  name) const
pure virtual

◆ getRegister() [2/2]

virtual TRITON_EXPORT const triton::arch::Register & triton::arch::CpuInterface::getRegister ( triton::arch::register_e  id) const
pure virtual

◆ getStackPointer()

virtual TRITON_EXPORT const triton::arch::Register & triton::arch::CpuInterface::getStackPointer ( void  ) const
pure virtual

◆ gprBitSize()

virtual TRITON_EXPORT triton::uint32 triton::arch::CpuInterface::gprBitSize ( void  ) const
pure virtual

Returns the bit in bit of the General Purpose Registers.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ gprSize()

virtual TRITON_EXPORT triton::uint32 triton::arch::CpuInterface::gprSize ( void  ) const
pure virtual

Returns the bit in byte of the General Purpose Registers.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ isConcreteMemoryValueDefined() [1/2]

virtual TRITON_EXPORT bool triton::arch::CpuInterface::isConcreteMemoryValueDefined ( const triton::arch::MemoryAccess mem) const
pure virtual

Returns true if memory cells have a defined concrete value.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ isConcreteMemoryValueDefined() [2/2]

virtual TRITON_EXPORT bool triton::arch::CpuInterface::isConcreteMemoryValueDefined ( triton::uint64  baseAddr,
triton::usize  size = 1 
) const
pure virtual

Returns true if memory cells have a defined concrete value.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ isFlag()

virtual TRITON_EXPORT bool triton::arch::CpuInterface::isFlag ( triton::arch::register_e  regId) const
pure virtual

◆ isMemoryExclusive()

virtual TRITON_EXPORT bool triton::arch::CpuInterface::isMemoryExclusive ( const triton::arch::MemoryAccess mem) const
pure virtual

Returns true if the given memory access is tagged as exclusive. Only valid for Arm32 and AArch64.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ isRegister()

virtual TRITON_EXPORT bool triton::arch::CpuInterface::isRegister ( triton::arch::register_e  regId) const
pure virtual

◆ isRegisterValid()

virtual TRITON_EXPORT bool triton::arch::CpuInterface::isRegisterValid ( triton::arch::register_e  regId) const
pure virtual

◆ isThumb()

virtual TRITON_EXPORT bool triton::arch::CpuInterface::isThumb ( void  ) const
pure virtual

Returns true if the execution mode is Thumb. Only useful for Arm32.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ numberOfRegisters()

virtual TRITON_EXPORT triton::uint32 triton::arch::CpuInterface::numberOfRegisters ( void  ) const
pure virtual

Returns the number of registers according to the CPU architecture.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ setConcreteMemoryAreaValue() [1/2]

virtual TRITON_EXPORT void triton::arch::CpuInterface::setConcreteMemoryAreaValue ( triton::uint64  baseAddr,
const std::vector< triton::uint8 > &  values,
bool  execCallbacks = true 
)
pure virtual

[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.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ setConcreteMemoryAreaValue() [2/2]

virtual TRITON_EXPORT void triton::arch::CpuInterface::setConcreteMemoryAreaValue ( triton::uint64  baseAddr,
const void *  area,
triton::usize  size,
bool  execCallbacks = true 
)
pure virtual

[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.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ setConcreteMemoryValue() [1/2]

virtual TRITON_EXPORT void triton::arch::CpuInterface::setConcreteMemoryValue ( const triton::arch::MemoryAccess mem,
const triton::uint512 value,
bool  execCallbacks = true 
)
pure virtual

[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.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ setConcreteMemoryValue() [2/2]

virtual TRITON_EXPORT void triton::arch::CpuInterface::setConcreteMemoryValue ( triton::uint64  addr,
triton::uint8  value,
bool  execCallbacks = true 
)
pure virtual

[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.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ setConcreteRegisterValue()

virtual TRITON_EXPORT void triton::arch::CpuInterface::setConcreteRegisterValue ( const triton::arch::Register reg,
const triton::uint512 value,
bool  execCallbacks = true 
)
pure virtual

[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.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ setMemoryExclusiveTag()

virtual TRITON_EXPORT void triton::arch::CpuInterface::setMemoryExclusiveTag ( const triton::arch::MemoryAccess mem,
bool  tag 
)
pure virtual

Sets exclusive memory access tag. Only valid for Arm32 and AArch64.

Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.

◆ setThumb()

virtual TRITON_EXPORT void triton::arch::CpuInterface::setThumb ( bool  state)
pure virtual

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