#include <arch-x86.h>
Public Member Functions | |
| instruction () | |
| instruction (const unsigned char *p, unsigned type, unsigned sz, const unsigned char *op=0) | |
| instruction (const instruction &insn) | |
| COMMON_EXPORT instruction * | copy () const |
| instruction (const void *ptr) | |
| unsigned | setInstruction (const unsigned char *p, Address=0) |
| Address | getTarget (Address addr) const |
| unsigned | size () const |
| COMMON_EXPORT unsigned | spaceToRelocate () const |
| unsigned | type () const |
| const unsigned char * | ptr () const |
| const unsigned char * | op_ptr () const |
| COMMON_EXPORT bool | getUsedRegs (pdvector< int > ®s) |
| bool | isCall () const |
| bool | isCallIndir () const |
| bool | isReturn () const |
| bool | isRetFar () const |
| bool | isCleaningRet () const |
| bool | isJumpIndir () const |
| bool | isJumpDir () const |
| bool | isUncondJump () const |
| bool | isNop () const |
| bool | isIndir () const |
| bool | isIllegal () const |
| bool | isLeave () const |
| bool | isPrivileged () const |
| bool | isMoveRegMemToRegMem () const |
| bool | isXORRegMemRegMem () const |
| bool | isANearBranch () const |
| bool | isTrueCallInsn () const |
| bool | isSysCallInsn () const |
| bool | isCmp () const |
| void | print () |
| int | getStackDelta () |
Static Public Member Functions | |
| static unsigned | maxInterFunctionJumpSize (unsigned addr_width) |
| static COMMON_EXPORT unsigned | jumpSize (Address from, Address to, unsigned addr_width) |
| static COMMON_EXPORT unsigned | jumpSize (long disp, unsigned addr_width) |
| static COMMON_EXPORT unsigned | maxJumpSize (unsigned addr_width) |
| static bool | isAligned (const Address) |
Private Attributes | |
| unsigned | type_ |
| unsigned | size_ |
| const unsigned char * | ptr_ |
| const unsigned char * | op_ptr_ |
Definition at line 774 of file arch-x86.h.
| NS_x86::instruction::instruction | ( | ) | [inline] |
Definition at line 776 of file arch-x86.h.
Referenced by copy().
| NS_x86::instruction::instruction | ( | const unsigned char * | p, | |
| unsigned | type, | |||
| unsigned | sz, | |||
| const unsigned char * | op = 0 | |||
| ) | [inline] |
Definition at line 778 of file arch-x86.h.
| NS_x86::instruction::instruction | ( | const instruction & | insn | ) | [inline] |
| NS_x86::instruction::instruction | ( | const void * | ptr | ) | [inline] |
Definition at line 791 of file arch-x86.h.
References setInstruction().
| instruction * NS_x86::instruction::copy | ( | ) | const |
Definition at line 5704 of file arch-x86.C.
References instruction().
| int NS_x86::instruction::getStackDelta | ( | ) |
Definition at line 5937 of file arch-x86.C.
References e_pop, e_popa, e_popad, e_push, e_pusha, e_pushad, NS_x86::ia32_instruction::getEntry(), NS_x86::ia32_decode(), NS_x86::ia32_entry::id, and ptr().
Definition at line 803 of file arch-x86.h.
References NS_x86::get_target(), ptr_, size_, and type_.
| bool NS_x86::instruction::getUsedRegs | ( | pdvector< int > & | regs | ) |
Definition at line 5828 of file arch-x86.C.
References ia32_locations::address_size, NS_x86::ia32_operand::admet, NS_x86::am_O, NS_x86::am_reg, NS_x86::ia32_instruction::getEntry(), NS_x86::ia32_prefixes::getPrefix(), NS_x86::ia32_instruction::getPrefix(), NS_x86::ia32_decode(), IA32_DECODE_CONDITION, IA32_DECODE_MEMACCESS, ia32_locations::modrm_mod, ia32_locations::modrm_position, ia32_locations::modrm_reg, NS_x86::op_ecxebx, NS_x86::op_edxeax, NS_x86::ia32_entry::operands, NS_x86::ia32_operand::optype, ptr(), NS_x86::REGNUM_R10, NS_x86::REGNUM_R11, NS_x86::REGNUM_R12, NS_x86::REGNUM_R13, NS_x86::REGNUM_R14, NS_x86::REGNUM_R15, NS_x86::REGNUM_R8, NS_x86::REGNUM_R9, NS_x86::REGNUM_RAX, NS_x86::REGNUM_RBP, NS_x86::REGNUM_RBX, NS_x86::REGNUM_RCX, NS_x86::REGNUM_RDI, NS_x86::REGNUM_RDX, NS_x86::REGNUM_RSI, NS_x86::REGNUM_RSP, ia32_locations::rex_byte, and ia32_locations::rex_r.
| static bool NS_x86::instruction::isAligned | ( | const | Address | ) | [inline, static] |
Definition at line 866 of file arch-x86.h.
| bool NS_x86::instruction::isANearBranch | ( | ) | const [inline] |
Definition at line 860 of file arch-x86.h.
References isJumpDir().
| bool NS_x86::instruction::isCall | ( | ) | const [inline] |
Definition at line 835 of file arch-x86.h.
References IS_CALL, and type_.
Referenced by isTrueCallInsn().
| bool NS_x86::instruction::isCallIndir | ( | ) | const [inline] |
Definition at line 836 of file arch-x86.h.
References INDIR, IS_CALL, and type_.
Referenced by isTrueCallInsn().
| bool NS_x86::instruction::isCleaningRet | ( | ) | const [inline] |
Definition at line 839 of file arch-x86.h.
| bool NS_x86::instruction::isCmp | ( | ) | const |
Definition at line 5804 of file arch-x86.C.
References CMP_AL_LB, CMP_EB_GB, CMP_EV_GV, CMP_GB_EB, CMP_GV_EV, CMP_RAX_LZ, and op_ptr_.
| bool NS_x86::instruction::isIllegal | ( | ) | const [inline] |
Definition at line 847 of file arch-x86.h.
| bool NS_x86::instruction::isIndir | ( | ) | const [inline] |
Definition at line 846 of file arch-x86.h.
| bool NS_x86::instruction::isJumpDir | ( | ) | const [inline] |
Definition at line 841 of file arch-x86.h.
References INDIR, IS_JCC, IS_JUMP, and type_.
Referenced by isANearBranch().
| bool NS_x86::instruction::isJumpIndir | ( | ) | const [inline] |
Definition at line 840 of file arch-x86.h.
| bool NS_x86::instruction::isLeave | ( | ) | const [inline] |
Definition at line 848 of file arch-x86.h.
References ptr_.
| bool NS_x86::instruction::isMoveRegMemToRegMem | ( | ) | const [inline] |
Definition at line 850 of file arch-x86.h.
References MOV_R16_TO_RM16, MOV_R32_TO_RM32, MOV_R8_TO_RM8, MOV_RM16_TO_R16, MOV_RM32_TO_R32, MOV_RM8_TO_R8, op_ptr_, and ptr_.
| bool NS_x86::instruction::isNop | ( | ) | const |
Definition at line 5969 of file arch-x86.C.
References NS_x86::decode_SIB(), ia32_locations::disp_position, ia32_locations::disp_size, e_nop, NS_x86::ia32_instruction::getEntry(), NS_x86::ia32_decode(), IA32_FULL_DECODER, NS_x86::ia32_entry::id, IS_NOP, ia32_locations::modrm_mod, ia32_locations::modrm_reg, ia32_locations::modrm_rm, NOP, op_ptr_, ptr(), ptr_, ia32_locations::rex_b, ia32_locations::rex_r, ia32_locations::rex_x, ia32_locations::sib_byte, and type_.
| bool NS_x86::instruction::isPrivileged | ( | ) | const [inline] |
Definition at line 849 of file arch-x86.h.
| bool NS_x86::instruction::isRetFar | ( | ) | const [inline] |
Definition at line 838 of file arch-x86.h.
| bool NS_x86::instruction::isReturn | ( | ) | const [inline] |
Definition at line 837 of file arch-x86.h.
| bool NS_x86::instruction::isSysCallInsn | ( | ) | const [inline] |
Definition at line 863 of file arch-x86.h.
References op_ptr_, and NS_x86::SYSCALL.
| bool NS_x86::instruction::isTrueCallInsn | ( | ) | const [inline] |
Definition at line 862 of file arch-x86.h.
References isCall(), and isCallIndir().
| bool NS_x86::instruction::isUncondJump | ( | ) | const [inline] |
Definition at line 843 of file arch-x86.h.
| bool NS_x86::instruction::isXORRegMemRegMem | ( | ) | const [inline] |
Definition at line 855 of file arch-x86.h.
References op_ptr_, ptr_, XOR_R16_RM16, XOR_R32_RM32, XOR_R8_RM8, XOR_RM16_R16, and XOR_RM32_R32.
| unsigned NS_x86::instruction::jumpSize | ( | long | disp, | |
| unsigned | addr_width | |||
| ) | [static] |
Definition at line 5778 of file arch-x86.C.
References JUMP_SZ.
Definition at line 5784 of file arch-x86.C.
References JUMP_SZ.
| static unsigned NS_x86::instruction::maxInterFunctionJumpSize | ( | unsigned | addr_width | ) | [inline, static] |
Definition at line 826 of file arch-x86.h.
References maxJumpSize().
| unsigned NS_x86::instruction::maxJumpSize | ( | unsigned | addr_width | ) | [static] |
Definition at line 5798 of file arch-x86.C.
References JUMP_SZ.
Referenced by maxInterFunctionJumpSize().
| const unsigned char* NS_x86::instruction::op_ptr | ( | ) | const [inline] |
Definition at line 823 of file arch-x86.h.
References op_ptr_.
| void NS_x86::instruction::print | ( | ) | [inline] |
Definition at line 870 of file arch-x86.h.
| const unsigned char* NS_x86::instruction::ptr | ( | ) | const [inline] |
Definition at line 818 of file arch-x86.h.
References ptr_.
Referenced by NS_x86::get_disp(), NS_x86::get_immediate_operand(), getStackDelta(), getUsedRegs(), and isNop().
| unsigned NS_x86::instruction::setInstruction | ( | const unsigned char * | p, | |
| Address | = 0 | |||
| ) | [inline] |
Definition at line 796 of file arch-x86.h.
References NS_x86::get_instruction(), op_ptr_, ptr_, size_, and type_.
Referenced by instruction().
| unsigned NS_x86::instruction::size | ( | ) | const [inline] |
| unsigned NS_x86::instruction::spaceToRelocate | ( | ) | const |
Definition at line 5710 of file arch-x86.C.
References CALL_RELOC_THUNK, NS_x86::count_prefixes(), IS_CALL, IS_JCC, IS_JUMP, JUMP_ABS32_SZ, JUMP_SZ, REL_B, REL_D, REL_D_DATA, REL_W, size(), and type().
| unsigned NS_x86::instruction::type | ( | ) | const [inline] |
Definition at line 815 of file arch-x86.h.
References type_.
Referenced by NS_x86::get_disp(), and spaceToRelocate().
const unsigned char* NS_x86::instruction::op_ptr_ [private] |
Definition at line 883 of file arch-x86.h.
Referenced by instruction(), isCmp(), isMoveRegMemToRegMem(), isNop(), isSysCallInsn(), isXORRegMemRegMem(), op_ptr(), and setInstruction().
const unsigned char* NS_x86::instruction::ptr_ [private] |
Definition at line 882 of file arch-x86.h.
Referenced by getTarget(), instruction(), isLeave(), isMoveRegMemToRegMem(), isNop(), isXORRegMemRegMem(), print(), ptr(), and setInstruction().
unsigned NS_x86::instruction::size_ [private] |
Definition at line 881 of file arch-x86.h.
Referenced by getTarget(), instruction(), print(), setInstruction(), and size().
unsigned NS_x86::instruction::type_ [private] |
Definition at line 880 of file arch-x86.h.
Referenced by getTarget(), instruction(), isCall(), isCallIndir(), isCleaningRet(), isIllegal(), isIndir(), isJumpDir(), isJumpIndir(), isNop(), isPrivileged(), isRetFar(), isReturn(), isUncondJump(), setInstruction(), and type().
1.6.1