libTriton version 1.0 build 1592
|
This interface is used as abstract CPU interface. All CPU must use this interface. More...
#include <cpuInterface.hpp>
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::Register & | getParentRegister (const triton::arch::Register ®) const =0 |
Returns parent register from a given one. | |
virtual TRITON_EXPORT const triton::arch::Register & | getParentRegister (triton::arch::register_e id) const =0 |
Returns parent register from a given one. | |
virtual TRITON_EXPORT const triton::arch::Register & | getRegister (triton::arch::register_e id) const =0 |
Returns register from id. | |
virtual TRITON_EXPORT const triton::arch::Register & | getRegister (const std::string &name) const =0 |
Returns register from name. | |
virtual TRITON_EXPORT const triton::arch::Register & | getProgramCounter (void) const =0 |
Returns the program counter register. | |
virtual TRITON_EXPORT const triton::arch::Register & | getStackPointer (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::uint8 > | getConcreteMemoryAreaValue (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 ®, 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 ®, 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. | |
This interface is used as abstract CPU interface. All CPU must use this interface.
Definition at line 42 of file cpuInterface.hpp.
|
inlinevirtual |
Destructor.
Definition at line 45 of file cpuInterface.hpp.
|
pure virtual |
Clears the architecture states (registers and memory).
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Clears concrete values assigned to the memory cells.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Clears concrete values assigned to the memory cells.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Disassembles the instruction according to the architecture.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns all registers.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Return all memory.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns the concrete value of a memory area.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns the concrete value of memory cells.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns the concrete value of a memory cell.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns the concrete value of a register.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns the kind of endianness as triton::arch::endianness_e.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns parent register from a given one.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns parent register from a given one.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns all parent registers.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns the program counter register.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns register from name.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns register from id.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns the stack pointer register.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns true if the register ID is a flag.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns true if the register ID is a register.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Returns true if the register ID is valid.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
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::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.
|
pure virtual |
Sets CPU state to Thumb mode.
Implemented in triton::arch::arm::aarch64::AArch64Cpu, triton::arch::arm::arm32::Arm32Cpu, triton::arch::riscv::riscv32Cpu, triton::arch::riscv::riscv64Cpu, triton::arch::x86::x8664Cpu, and triton::arch::x86::x86Cpu.