Package pida :: Module instruction :: Class instruction
[show private | hide private]
[frames | no frames]

Class instruction


Method Summary
  __init__(self, ea, analysis, basic_block)
Analyze the instruction at ea.
Integer flag_dependency(first_instruction, second_instruction)
Determine if one instruction can affect flags used by the other instruction.
String get_disasm(self, ea)
A GetDisasm() wrapper that strips comments and extraneous whitespace.
Mixed get_string_reference(self, ea)
If the specified instruction references a string, get and return the contents of that string.
Boolean is_conditional_branch(self)
Check if the instruction is a conditional branch.
Boolean overwrites_register(self, register)
Indicates if the given register is modified by this instruction.

Class Variable Summary
NoneType analysis = None                                                                  
NoneType basic_block = None                                                                  
list bytes = []
str comment = ''
NoneType disasm = None                                                                  
NoneType ea = None                                                                  
dict ext = {}
dict FLAGGED_OPCODES = {'jns': 4096, 'rol': 327680, 'lsl': 13...
NoneType mnem = None                                                                  
NoneType op1 = None                                                                  
NoneType op2 = None                                                                  
NoneType op3 = None                                                                  
NoneType refs_api = None                                                                  
NoneType refs_arg = None                                                                  
NoneType refs_constant = None                                                                  
NoneType refs_string = None                                                                  
NoneType refs_var = None                                                                  

Method Details

__init__(self, ea, analysis=0, basic_block=None)
(Constructor)

Analyze the instruction at ea.
Parameters:
ea - Effective address of instruction to analyze
           (type=DWORD)
analysis - (Optional, Def=ANALYSIS_NONE) Which extra analysis options to enable
           (type=Integer)
basic_block - (Optional, Def=None) Pointer to parent basic block container
           (type=pgraph.basic_block)

See Also: defines.py

flag_dependency(first_instruction, second_instruction)

Determine if one instruction can affect flags used by the other instruction.
Parameters:
first_instruction - The first instruction to check
           (type=instruction)
second_instruction - The second instruction to check
           (type=instruction)
Returns:
0 for no effect, 1 for first affects second, 2 for second affects first, 3 for both can affect
           (type=Integer)

Author: Cameron Hotchkies

get_disasm(self, ea)

A GetDisasm() wrapper that strips comments and extraneous whitespace.
Parameters:
ea - Effective address of instruction to analyze
           (type=DWORD)
Returns:
Sanitized disassembly at ea.
           (type=String)

get_string_reference(self, ea)

If the specified instruction references a string, get and return the contents of that string. Currently supports:
Parameters:
ea - Effective address of instruction to analyze
           (type=DWORD)
Returns:
ASCII representation of string referenced from ea if found, None otherwise.
           (type=Mixed)

To Do: XXX - Add more supported string types.

is_conditional_branch(self)

Check if the instruction is a conditional branch. (x86 specific)
Returns:
True if the instruction is a conditional branch, False otherwise.
           (type=Boolean)

Author: Cameron Hotchkies

overwrites_register(self, register)

Indicates if the given register is modified by this instruction. This does not check for all modifications, just lea, mov and pop into the specific register.
Parameters:
register - The text representation of the register
           (type=String)
Returns:
True if the register is modified
           (type=Boolean)

Author: Cameron Hotchkies


Class Variable Details

analysis

Type:
NoneType
Value:
None                                                                  

basic_block

Type:
NoneType
Value:
None                                                                  

bytes

Type:
list
Value:
[]                                                                     

comment

Type:
str
Value:
''                                                                     

disasm

Type:
NoneType
Value:
None                                                                  

ea

Type:
NoneType
Value:
None                                                                  

ext

Type:
dict
Value:
{}                                                                     

FLAGGED_OPCODES

Type:
dict
Value:
{'arpl': 131072,
 'clc': 16777216,
 'cld': 134217728,
 'imul': 327680,
 'jno': 1024,
 'jns': 4096,
 'lsl': 131072,
 'rol': 327680,
...                                                                    

mnem

Type:
NoneType
Value:
None                                                                  

op1

Type:
NoneType
Value:
None                                                                  

op2

Type:
NoneType
Value:
None                                                                  

op3

Type:
NoneType
Value:
None                                                                  

refs_api

Type:
NoneType
Value:
None                                                                  

refs_arg

Type:
NoneType
Value:
None                                                                  

refs_constant

Type:
NoneType
Value:
None                                                                  

refs_string

Type:
NoneType
Value:
None                                                                  

refs_var

Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.1 on Fri Jun 16 17:16:25 2006 http://epydoc.sf.net