Пример #1
0
    def __init__(self, function):
        """

        @param function: a
        @raise TypeError:
        """

        self.logger = logging.getLogger(__name__)
        self.dataParser = DataParser.getParser(
        )  # Data Parser (ParserDataPlugin Manager) instance

        self.__func_args = {
        }  # A dictionary with the argument index as key. the dictionaries value is an array
        # who`s first element is the relevant data parser, and second element is the data
        # parsers (optional) arguments.
        #
        #        /- Arg Index -\ /- DataParser -\ /- Optional Params -\
        #        |      0      | | StringParser | |      (None)       |
        #        |      3      | | HandleParser | |     (16,0x2)      |
        #        |     ...     | |     ...      | |       ...         |
        #        \             / \              / \                   /
        #
        # If an argument index exist in this list, it will be parsed using the
        # defined DataParser only.
        # If an argument index does not exist, or doesnt have any DataParser
        # assigned, Standard DataParser lookup will take place in order to parse it.

        if not isinstance(function, Function):
            raise TypeError("Expected function instance, received %s",
                            function.__class__)

        self.function = function  # The function to be parsed
Пример #2
0
    def __init__(self, function):
        """

        @param function: a
        @raise TypeError:
        """

        self.logger = logging.getLogger(__name__)
        self.dataParser = DataParser.getParser()    # Data Parser (ParserDataPlugin Manager) instance

        self.__func_args = {}          # A dictionary with the argument index as key. the dictionaries value is an array
                                       # who`s first element is the relevant data parser, and second element is the data
                                       # parsers (optional) arguments.
                                       #
                                       #        /- Arg Index -\ /- DataParser -\ /- Optional Params -\
                                       #        |      0      | | StringParser | |      (None)       |
                                       #        |      3      | | HandleParser | |     (16,0x2)      |
                                       #        |     ...     | |     ...      | |       ...         |
                                       #        \             / \              / \                   /
                                       #
                                       # If an argument index exist in this list, it will be parsed using the
                                       # defined DataParser only.
                                       # If an argument index does not exist, or doesnt have any DataParser
                                       # assigned, Standard DataParser lookup will take place in order to parse it.

        if not isinstance(function, Function):
            raise TypeError("Expected function instance, received %s", function.__class__)

        self.function = function    # The function to be parsed
Пример #3
0
    def OnCreate(self, form):
        """
        Called when the view is created
        """
        self.data_parser = DataParser.getParser()
        self.ptable_widget = QtWidgets.QTreeWidget()

        # Get parent widget
        self.parent = form_to_widget(form)

        self._add_parser_data()

        layout = QtWidgets.QGridLayout()
        layout.addWidget(self.ptable_widget)

        self.parent.setLayout(layout)
Пример #4
0
    def OnCreate(self, form):
        """
        Called when the view is created
        """
        self.data_parser = DataParser.getParser()
        self.ptable_widget = QtGui.QTreeWidget()

        # Get parent widget
        self.parent = self.FormToPySideWidget(form)

        self._add_parser_data()

        layout = QtGui.QGridLayout()
        layout.addWidget(self.ptable_widget)

        self.parent.setLayout(layout)
Пример #5
0
    def __init__(self,
                 storeType,
                 loc,
                 type="",
                 name="",
                 referringValue=None,
                 deref_depth=None,
                 custom_parser=None):
        """
        Ctor
        """
        self.logger = logging.getLogger(__name__)
        self.config = DieConfig.get_config()

        self.storetype = storeType  # Value store location (memory\register)
        self.type = type  # tinfo_t object.
        self.name = name  # Value name
        self.loc = loc  # Value location (if REG_VAL - register name, if MEM_VAL - memory address)
        self.rawValue = None  # Raw value at address

        self.parsedValues = []  # Possible value data list
        self.nestedValues = []  # Nested DebugValue(s) (if struct/union etc.)

        # Custom parser plugin for this value - if this value is set, no other parser will be attempted to parse
        # this value.
        self.custom_parser = custom_parser

        self.reference_flink = None  # For reference values, a pointer to the referred value.
        self.reference_blink = referringValue  # For reference values, a pointer to the referring value.

        # Set current maximal dereference depth for this argument.
        if deref_depth is None:
            self.derefrence_depth = self.config.debugging.max_deref_depth
        else:
            self.derefrence_depth = deref_depth  # de-reference depth

        try:
            # Collect runtime values!
            self.dataParser = DataParser.getParser()
            self.getRunetimeValues()

        except Exception as ex:
            self.logger.exception("Error while collecting runtime values: %s",
                                  ex)
Пример #6
0
    def __init__(self,
                 storeType,
                 loc,
                 type="",
                 name="",
                 referringValue=None,
                 deref_depth=None,
                 custom_parser=None):
        """
        Ctor
        """
        self.logger = logging.getLogger(__name__)
        self.config = DieConfig.get_config()

        self.storetype = storeType  # Value store location (memory\register)
        self.type = type  # tinfo_t object.
        self.name = name  # Value name
        self.loc = loc  # Value location (if REG_VAL - register name, if MEM_VAL - memory address)
        self.rawValue = None  # Raw value at address

        self.parsedValues = []  # Possible value data list
        self.nestedValues = []  # Nested DebugValue(s) (if struct/union etc.)

        # Custom parser plugin for this value - if this value is set, no other parser will be attempted to parse
        # this value.
        self.custom_parser = custom_parser

        self.reference_flink = None  # For reference values, a pointer to the referred value.
        self.reference_blink = referringValue  # For reference values, a pointer to the referring value.

        # Set current maximal dereference depth for this argument.
        if deref_depth is None:
            self.derefrence_depth = self.config.debugging.max_deref_depth
        else:
            self.derefrence_depth = deref_depth  # de-reference depth

        try:
            # Collect runtime values!
            self.dataParser = DataParser.getParser()
            self.getRunetimeValues()

        except Exception as ex:
            self.logger.exception("Error while collecting runtime values: %s", ex)