Module analysis :: Class VMAnalysis
[hide private]
[frames] | no frames]

Class VMAnalysis

source code

This class analyses a class file or a dex file

Instance Methods [hide private]
 
__init__(self, _vm, code_analysis=False) source code
 
get_method(self, method)
Return an analysis method
source code
 
get_like_field(self) source code
 
get_init_method(self) source code
 
get_random_integer_value(self, method, descriptor) source code
 
prev_free_block_offset(self, method, idx=0)
Find the previous offset where you can insert a block
source code
 
random_free_block_offset(self, method)
Find a random offset where you can insert a block
source code
 
next_free_block_offset(self, method, idx=0)
Find the next offset where you can insert a block
source code
 
get_tainted_variables(self)
Return the tainted variables
source code
 
get_tainted_packages(self)
Return the tainted packages
source code
 
get_tainted_field(self, class_name, name, descriptor)
Return a specific tainted field
source code
 
get_methods(self)
Return each analysis method
source code
 
get_method_signature(self, method, grammar_type='', options={}, predef_sign='')
Return a specific signature for a specific method
source code
 
get_op(self, op) source code
 
get_ops(self, method) source code
Method Details [hide private]

__init__(self, _vm, code_analysis=False)
(Constructor)

source code 
Parameters:
  • _vm - a JVMFormat or DalvikFormatVM
  • code_analysis - True if you would like to do an advanced analyse of the code (e.g : to search free offset to insert codes
  • _vm - a virtual machine object

get_method(self, method)

source code 

Return an analysis method

Parameters:

prev_free_block_offset(self, method, idx=0)

source code 

Find the previous offset where you can insert a block

Parameters:
  • method - a reference of a method object where you would like the offset
  • idx - the index to start the research

    @rtype : return -1 if an error occured, otherwise the offset

random_free_block_offset(self, method)

source code 

Find a random offset where you can insert a block

Parameters:
  • method - a reference of method object or a string which represents a regexp

    @rtype : return -1 if an error occured, otherwise the offset

next_free_block_offset(self, method, idx=0)

source code 

Find the next offset where you can insert a block

Parameters:
  • method - a reference of a method object where you would like the offset
  • idx - the index to start the research

    @rtype : return -1 if an error occured, otherwise the offset

get_tainted_variables(self)

source code 

Return the tainted variables

@rtype : TaintedVariables

get_tainted_packages(self)

source code 

Return the tainted packages

@rtype : TaintedPackages

get_tainted_field(self, class_name, name, descriptor)

source code 

Return a specific tainted field

Parameters:
  • class_name - the name of the class
  • name - the name of the field
  • descriptor - the descriptor of the field

    @rtype : TaintedVariable

get_methods(self)

source code 

Return each analysis method

@rtype : MethodAnalysis

get_method_signature(self, method, grammar_type='', options={}, predef_sign='')

source code 

Return a specific signature for a specific method

Parameters:
  • method - a reference to method from a vm class
  • grammar_type - the type of the signature
  • options - the options of the signature
  • predef_sign - used a predefined signature

    @rtype : Sign