NS_x86::instruction Class Reference

#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 instructioncopy () 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 > &regs)
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_

Detailed Description

Definition at line 774 of file arch-x86.h.


Constructor & Destructor Documentation

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]

Definition at line 781 of file arch-x86.h.

References op_ptr_, ptr_, size_, and type_.

NS_x86::instruction::instruction ( const void *  ptr  )  [inline]

Definition at line 791 of file arch-x86.h.

References setInstruction().


Member Function Documentation

instruction * NS_x86::instruction::copy (  )  const

Definition at line 5704 of file arch-x86.C.

References instruction().

int NS_x86::instruction::getStackDelta (  ) 
Address NS_x86::instruction::getTarget ( Address  addr  )  const [inline]

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

References IS_RETC, and type_.

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.

References ILLEGAL, and type_.

bool NS_x86::instruction::isIndir (  )  const [inline]

Definition at line 846 of file arch-x86.h.

References INDIR, and type_.

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.

References INDIR, IS_JUMP, and type_.

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]
bool NS_x86::instruction::isNop (  )  const
bool NS_x86::instruction::isPrivileged (  )  const [inline]

Definition at line 849 of file arch-x86.h.

References PRVLGD, and type_.

bool NS_x86::instruction::isRetFar (  )  const [inline]

Definition at line 838 of file arch-x86.h.

References IS_RETF, and type_.

bool NS_x86::instruction::isReturn (  )  const [inline]

Definition at line 837 of file arch-x86.h.

References IS_RET, IS_RETF, and type_.

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.

References IS_JCC, IS_JUMP, and type_.

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.

unsigned NS_x86::instruction::jumpSize ( Address  from,
Address  to,
unsigned  addr_width 
) [static]

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.

References fprintf, ptr_, and size_.

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]

Definition at line 808 of file arch-x86.h.

References size_.

Referenced by spaceToRelocate().

unsigned NS_x86::instruction::spaceToRelocate (  )  const
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().


Field Documentation

const unsigned char* NS_x86::instruction::op_ptr_ [private]
const unsigned char* NS_x86::instruction::ptr_ [private]
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]

The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1