Generic modification API
[INS: Instruction Object]


Functions

BOOL LEVEL_PINCLIENT::INS_RewriteMemoryAddressingToBaseRegisterOnly (INS ins, MEMORY_TYPE mtype, REG newBase)
VOID LEVEL_PINCLIENT::INS_InsertIndirectJump (INS ins, IPOINT ipoint, REG reg)
VOID LEVEL_PINCLIENT::INS_InsertDirectJump (INS ins, IPOINT ipoint, ADDRINT tgt)
VOID LEVEL_PINCLIENT::INS_Delete (INS ins)

Detailed Description

Use these functions to modify instructions. They work for all instruction sets. For experts only!

Availability:
Mode: JIT & Probe
O/S: Linux & Windows
CPU: All

Function Documentation

VOID LEVEL_PINCLIENT::INS_Delete INS  ins  ) 
 

Delete the instruction

Availability:
Mode: JIT
O/S: Linux, Windows & MacOS
CPU: All

VOID LEVEL_PINCLIENT::INS_InsertDirectJump INS  ins,
IPOINT  ipoint,
ADDRINT  tgt
 

Insert direct jump instruction relative to the given instruction When used with INS_Delete it can be used to emulate control transfer instructions.

Parameters:
[in] ins input instruction
[in] ipoint location relative to ins (only IPOINT_BEFORE and IPOINT_AFTER are supported)
[in] tgt absolute address of the target
Availability:
Mode: JIT
O/S: Linux, Windows & MacOS
CPU: IA-32 and Intel(R) 64 architectures

VOID LEVEL_PINCLIENT::INS_InsertIndirectJump INS  ins,
IPOINT  ipoint,
REG  reg
 

Insert indirect jump instruction relative to the given instruction. When used with INS_Delete it can be used to emulate control transfer instructions.

Parameters:
[in] ins input instruction
[in] ipoint location relative to ins (only IPOINT_BEFORE and IPOINT_AFTER are supported)
[in] reg register holding the target
Availability:
Mode: JIT
O/S: Linux, Windows & MacOS
CPU: IA-32 and Intel(R) 64 architectures

BOOL LEVEL_PINCLIENT::INS_RewriteMemoryAddressingToBaseRegisterOnly INS  ins,
MEMORY_TYPE  mtype,
REG  newBase
 

Change this memory access instruction to reference the virtual memory location contained in the given register.

On IA-32 and Intel64, the modified operand uses only base register addressing with the new base register newBase. Any index, scale, or offset fields from that operand in the original instruction are removed. In addition, if the original instruction's operand uses a segment override, the instruction is changed to use the default segment.

A memory operand can't be rewritten when:

  • the operand is implicit, but string operations are allowed
  • write operand has the same base regiser as read
  • some implicit stack operations (associated w/call,ret)

Parameters:
[in] ins input instruction
[in] mtype contols which operand to rewrite (read, write or second read operand)
[in] newBase register used as the new memory base address
Availability:
Mode: JIT
O/S: Linux, Windows & MacOS
CPU: IA-32 and Intel(R) 64 architectures


Generated on Mon Oct 6 20:13:17 2008 for Pin by  doxygen 1.4.6