Package IDAscope :: Package idascope :: Package core :: Module DocumentationHelper :: Class DocumentationHelper
[hide private]
[frames] | no frames]

Class DocumentationHelper

source code

This class handles instruction coloring.

Instance Methods [hide private]
 
__init__(self, config_filename) source code
 
load_config(self, config_filename)
Loads a semantic configuration file and generates a color map from the contained information.
source code
 
_generate_color_map_from_definitions(self, definitions)
Internal function to generate a color map from a semantic definitions config file.
source code
 
uncolor_all(self)
Uncolors all instructions of all segments by changing their color to white.
source code
 
color_instruction(self, address, color, refresh=True)
Colors the instruction at an address with the given color code.
source code
 
color_basic_block(self, address, color, refresh=True)
Colors the basic block containing a target address with the given color code.
source code
 
get_next_color_scheme(self)
get the next color scheme in the three-cycle "individual/mono/uncolored", where individual is semantic coloring
source code
 
select_highlight_color(self, tag)
automatically chooses the highlight color for a tag based on the current color scheme
source code
 
select_base_color(self, tagged_addresses_in_block)
automatically chooses the base color for a block based on the current color scheme
source code
 
colorize(self, scan_result)
perform coloring on the IDB, based on a scan performed by SemanticIdentifier
source code
 
get_next_non_func_instruction(self, addr) source code
 
convert_non_function_code(self) source code
Class Variables [hide private]
  layout_color_map = {"tag": {"base_color": 0x112233, "highlight...
Method Details [hide private]

load_config(self, config_filename)

source code 

Loads a semantic configuration file and generates a color map from the contained information.

Parameters:
  • config_filename (str) - filename of a semantic configuration file

_generate_color_map_from_definitions(self, definitions)

source code 

Internal function to generate a color map from a semantic definitions config file.

Parameters:
  • definitions (dict) - the defintions part of a semantic definitions config file.
Returns:
a dictionary of a color map, see layout_color_map for a reference

color_instruction(self, address, color, refresh=True)

source code 

Colors the instruction at an address with the given color code.

Parameters:
  • address (int) - address of the instruction to color
  • color (int (0xBBGGRR)) - color-code to set for the instruction
  • refresh (boolean) - refresh IDA view to ensure the color shows directly, can be omitted for performance.

color_basic_block(self, address, color, refresh=True)

source code 

Colors the basic block containing a target address with the given color code.

Parameters:
  • address (int) - address an instruction in the basic block to color
  • color (int (0xBBGGRR)) - color-code to set for the instruction
  • refresh (boolean) - refresh IDA view to ensure the color shows directly, can be omitted for performance.

get_next_color_scheme(self)

source code 

get the next color scheme in the three-cycle "individual/mono/uncolored", where individual is semantic coloring

Returns:
next state

select_highlight_color(self, tag)

source code 

automatically chooses the highlight color for a tag based on the current color scheme

Returns:
(int) a color code

select_base_color(self, tagged_addresses_in_block)

source code 

automatically chooses the base color for a block based on the current color scheme

Parameters:
  • tagged_addresses_in_block (a list of tuples (int, str) containing pairs of instruction addresses and tags) - all tagged addresses in a basic block for which the color shall be chosen
Returns:
(int) a color code

colorize(self, scan_result)

source code 

perform coloring on the IDB, based on a scan performed by SemanticIdentifier

Parameters:
  • scan_result (a dictionary with key/value entries of the following form: (address, [FunctionContext])) - result of a scan as performed by SemanticIdentifier

Class Variable Details [hide private]

layout_color_map

Value:
{"tag": {"base_color": 0x112233, "highlight_color": 0x445566}}