Pin
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Macros | Functions | Variables
ins_ia32.cpp File Reference
#include "level_base_with_ia32_ins.H"
#include "level_core_with_ia32_ins.H"
#include "xed-common-defs.h"
#include <sstream>
#include <iomanip>
#include <set>
#include <sys/syscall.h>

Macros

#define LOG_ENCODING(message)   QMESSAGE(MessageTypeLogEncoding, string("") + message)
 

Functions

LOCALTYPE BOOL LEVEL_CORE::operator< (const ENCODING_ADDRESS_RANGE_KEY &left, const ENCODING_ADDRESS_RANGE_KEY &right)
 
LOCALVAR MESSAGE_TYPE LEVEL_CORE::MessageTypeLogEncoding ("log_encoding","", false, false, false, true, LOGTYPE_LOGFILE,"pin log: encodings")
 
VOID LEVEL_CORE::ThreadAwareMemcpy (VOID *dst, const VOID *src, USIZE size)
 
USIZE LEVEL_CORE::ThreadAwareInsEncoder (INS ins, ADDRINT address)
 
LOCALFUN BOOL LEVEL_CORE::BranchDisplacementFits (INS ins, INT64 delta)
 
LOCALFUN char LEVEL_CORE::NibbleToAsciHex (UINT8 i)
 
LOCALFUN void LEVEL_CORE::PrintHexLine (char *buf, const UINT8 *array, const int length)
 
LOCALFUN string LEVEL_CORE::Disassemble (ADDRINT start, ADDRINT stop)
 
BBL LEVEL_CORE::SimulateRetPush (INS call)
 
USIZE LEVEL_CORE::INS_MaxProbeSize (BOOL requestRipAndAddrProbe)
 
BBL LEVEL_CORE::SimulateRetPopToMem (INS ret, ADDRINT offset)
 
USIZE LEVEL_CORE::INS_EncodeAtAddr (INS ins, ADDRINT address)
 
VOID LEVEL_CORE::INS_InitBranch (INS ins, BBL target)
 
UINT32 LEVEL_CORE::INS_MaxNumRRegs (INS x)
 
UINT32 LEVEL_CORE::INS_MaxNumWRegs (INS x)
 
BOOL LEVEL_CORE::INS_RegRContain (const INS ins, const REG reg)
 
BOOL LEVEL_CORE::INS_RegWContain (const INS ins, const REG reg)
 
BOOL LEVEL_CORE::INS_FullRegRContain (const INS ins, const REG reg)
 
BOOL LEVEL_CORE::INS_FullRegWContain (const INS ins, const REG reg)
 
BOOL LEVEL_CORE::BBL_TypeIsSane (BBL bbl)
 
VOID LEVEL_CORE::SetDecoderExceptionInfo (EXCEPTION_INFO *pExceptInfo, EXCEPTION_CODE exceptCode, ADDRINT addr, size_t size)
 
INSDECODE LEVEL_CORE::INS_DecodeIns (INS ins, const VOID **address, UINT32 size, EXCEPTION_CODE *excCode)
 
BOOL LEVEL_CORE::INS_InitOriginalIns (INS ins, const VOID **address, EXCEPTION_INFO *pExceptInfo=0)
 
template<typename FETCHER_ >
GLOBALTEMPLATEFUN BOOL LEVEL_CORE::INS_Fetch (INS ins, const VOID **address, const FETCHER_ &insBytesFetcher, EXCEPTION_INFO *pExceptInfo=0)
 
int LEVEL_CORE::INS_MaxDecodedBytes ()
 
BOOL LEVEL_CORE::INS_ValidateEncoding (const INS ins)
 
IADDR LEVEL_CORE::INS_CallRetIaddr (INS ins)
 
VOID LEVEL_CORE::INS_Check (INS ins)
 
VOID LEVEL_CORE::BBL_Check (BBL bbl)
 
LOCALFUN VOID LEVEL_CORE::OverwriteDisplacement (INS ins, INT64 value, UINT32 valueLen)
 
LOCALFUN VOID LEVEL_CORE::ApplyPcRelRelocation (INS ins, REL rel, IMG img)
 
LOCALFUN VOID LEVEL_CORE::ApplyImmRelocation (INS ins, REL rel, IMG img)
 
LOCALFUN VOID LEVEL_CORE::ApplyRelocation (INS ins, IMG img)
 
VOID LEVEL_CORE::SEC_ComputeNewSecDataExec (SEC sec, VOID *data)
 
string LEVEL_CORE::SEC_StringDis (SEC sec)
 
BOOL LEVEL_CORE::INS_Equal (INS ins, INS ins2)
 
USIZE LEVEL_CORE::INS_SizeOfDirectJmp ()
 
USIZE LEVEL_CORE::INS_SizeOfIpRelativeMemJmp ()
 
USIZE LEVEL_CORE::INS_InitDirectJmp (INS ins, ADDRINT brAddr, ADDRINT tgtAddr)
 
BOOL LEVEL_CORE::INS_IsMTSafeToPatch (ADDRINT addr, USIZE size)
 
ADDRINT LEVEL_CORE::INS_GetMTSafePatchLocation (ADDRINT addr, USIZE size)
 
LOCALFUN BOOL LEVEL_CORE::INS_MTSafeOverwrite (INS ins, ADDRINT addr, USIZE size)
 
LOCALFUN BOOL LEVEL_CORE::INS_MTSafeOverwriteDisplacement (INS ins, ADDRINT addr, USIZE size, UINT curDisplacementBytes, UINT newDisplacementBytes, ADDRDELTA displacement)
 
LOCALVAR STAT_UINT64 LEVEL_CORE::PinPatchedInssStat ("pin","insts","fetched_for_patch","")
 
BOOL LEVEL_CORE::INS_MTSafePatchBranch (OADDR brAddr, OADDR tgtAddr)
 
LOCALVAR STAT_UINT64 LEVEL_CORE::PinOverwriteWithJmpInssStat ("pin","insts","fetched_for_jmp_overwrite","")
 
BOOL LEVEL_CORE::INS_MTSafeWriteJmp (OADDR insAddr, OADDR tgtAddr)
 
OADDR LEVEL_CORE::INS_NextInsOaddr (INS ins, OADDR addr)
 
IADDR LEVEL_CORE::INS_NextInsIaddr (INS ins)
 
ADDRDELTA LEVEL_CORE::SignedOffset (ADDRINT imm)
 
IADDR LEVEL_CORE::INS_DirectBranchOrCallTargetIaddr (INS ins, IADDR iaddr)
 
IADDR LEVEL_CORE::INS_DirectBranchOrCallTargetIaddr (INS ins)
 
OADDR LEVEL_CORE::INS_DirectBranchOrCallTargetOaddr (INS ins, OADDR oaddr)
 
IADDR LEVEL_CORE::INS_IpRelTargetIaddr (INS ins)
 
BOOL LEVEL_CORE::INS_IsStackRead (const INS ins)
 
BOOL LEVEL_CORE::INS_IsStackWrite (const INS ins)
 
BOOL LEVEL_CORE::INS_IsIpRelRead (const INS ins)
 
BOOL LEVEL_CORE::INS_IsIpRelWrite (const INS ins)
 
BOOL LEVEL_CORE::INS_IsPredicated (INS ins)
 
BOOL LEVEL_CORE::INS_HasRealRep (INS ins)
 
REL_TYPE LEVEL_CORE::REL_AddrintRel ()
 
VOID LEVEL_CORE::INS_InitEncodeDecoder ()
 
VOID LEVEL_CORE::SEC_CreateOriginalIns (SEC sec)
 
VOID LEVEL_CORE::IMG_ConvertWeirdBranches (IMG img)
 
LOCALFUN string LEVEL_CORE::INS_RawInstBytes (INS ins)
 
LOCALVAR KNOB< BOOL > LEVEL_CORE::KnobPrintRawInstruction (KNOB_MODE_WRITEONCE,"supported","rawinst","0","Print raw instruction encoding in string conversions")
 
LOCALVAR KNOB< BOOL > LEVEL_CORE::KnobPrintPinRegs (KNOB_MODE_WRITEONCE,"supported","printpinreg","0","Print Pin registers in disassembly")
 
LOCALVAR KNOB< BOOL > LEVEL_CORE::KnobPrintBranch (KNOB_MODE_WRITEONCE,"supported","printbr","0","Print branch information in disassembly")
 
LOCALFUN string LEVEL_CORE::INS_RegsRead (INS ins)
 
LOCALFUN string LEVEL_CORE::INS_RegsWritten (INS ins)
 
string LEVEL_CORE::INS_StringShorter (INS ins)
 
string LEVEL_CORE::INS_StringShort (INS ins)
 
BOOL LEVEL_CORE::INS_IsOriginal (INS ins)
 
string LEVEL_CORE::INS_Disassemble (INS ins)
 
string LEVEL_CORE::INS_StringShortFancy (INS ins)
 
string LEVEL_CORE::INS_StringLong (INS ins)
 
BOOL LEVEL_CORE::INS_IsSimpleStackOffsetRead (INS ins, INT32 *offset)
 
BOOL LEVEL_CORE::INS_IsSimpleStackOffsetWrite (INS ins, INT32 *offset)
 
BOOL LEVEL_CORE::INS_IsPatchable (INS ins)
 
REG LEVEL_CORE::REG_RenameAppReg (const REG reg)
 
REG LEVEL_CORE::REG_RenamePinReg (const REG reg)
 
BOOL LEVEL_CORE::REG_ShouldBeRenamed (CALLING_STANDARD std, REG reg)
 
VOID LEVEL_CORE::INS_RenameRegsForInlining (CALLING_STANDARD std, INS ins)
 
PIN_DEPRECATED_API ADDRINT LEVEL_CORE::INS_MemoryOffset (INS ins)
 
ADDRDELTA LEVEL_CORE::INS_MemoryDisplacement (INS ins)
 
PIN_DEPRECATED_API ADDRDELTA LEVEL_CORE::INS_MemoryDisplacementSigned (INS ins)
 
REG LEVEL_CORE::INS_MemoryBaseReg (INS ins)
 
REG LEVEL_CORE::INS_MemoryIndexReg (INS ins)
 
UINT32 LEVEL_CORE::INS_MemoryScale (INS ins)
 
BOOL LEVEL_CORE::INS_ChangeReg (const INS ins, const REG old_reg, const REG new_reg, const BOOL as_read)
 
REG LEVEL_CORE::INS_ChangeToPinFlagsReg (const INS ins, const BOOL as_read)
 
LOCALFUN VOID LEVEL_CORE::ChangeStackPtr (INS ins, UINT32 num, BOOL read, BOOL *changed)
 
BOOL LEVEL_CORE::INS_ChangeStackPtr (INS ins)
 
BOOL LEVEL_CORE::INS_ChangeToUsePinFlags (const INS ins)
 
BOOL LEVEL_CORE::INS_RegsReadBeforeWritten (INS ins)
 
BOOL LEVEL_CORE::INS_ReadsAndWritesDestReg (INS ins)
 

Variables

GLOBALCONST UINT32 LEVEL_CORE::MAX_INSTRUCTION_SIZE = 15
 
GLOBALCONST USIZE LEVEL_CORE::SIZE_OF_RIP_AND_ADDR_PROBE = 14
 
GLOBALCONST USIZE LEVEL_CORE::SIZE_OF_RIP_PROBE = 6
 
GLOBALCONST USIZE LEVEL_CORE::SIZE_OF_MEMOFFSET_PROBE = 7
 
GLOBALCONST USIZE LEVEL_CORE::SIZE_OF_OFFSET_PROBE = 5
 
LOCALTYPE set
< ENCODING_ADDRESS_RANGE_KEY > 
LEVEL_CORE::_dir
 
LOCALVAR USIZE LEVEL_CORE::sizeOfDirectJmp = 0
 
LOCALVAR USIZE LEVEL_CORE::sizeOfIpRelativeMemJmp = 0
 
GLOBALCONST USIZE LEVEL_CORE::INS_PATCH_UNIT = 8
 

Detailed Description

ELF specific stuff related to INS