(self, seq)
Search for nodes that look like switch-cases and convert them to switch cases.

        :param seq:     The Sequence node.
        :return:        None
Search for nodes that look like switch-cases and convert them to switch cases.
Search for nodes that look like switch - cases and convert them to switch cases .
def _make_switch_cases(self, seq):
        """
        Search for nodes that look like switch-cases and convert them to switch cases.

        :param seq:     The Sequence node.
        :return:        None
        """

        jump_tables = self.kb.cfgs['CFGFast'].jump_tables

        addr2nodes = dict((node.addr, node) for node in seq.nodes)

        while True:
            for i in range(len(seq.nodes)):

                node = seq.nodes[i]

                # Jumptable_AddressLoadedFromMemory
                r = self._make_switch_cases_address_loaded_from_memory(seq, i, node, addr2nodes, jump_tables)
                if r:
                    # we found a node that looks like a switch-case. seq.nodes are changed. resume to find the next such
                    # case
                    break

                # Jumptable_AddressComputed
                r = self._make_switch_cases_address_computed(seq, i, node, addr2nodes, jump_tables)
                if r:
                    break

            else:
                # we did not find any node that looks like a switch-case. exit.
                break
def _make_switch_cases ( self , seq ) : jump_tables = self . kb . cfgs [ 'CFGFast' ] . jump_tables addr2nodes = dict ( ( node . addr , node ) for node in seq . nodes ) while True : for i in range ( len ( seq . nodes ) ) : node = seq . nodes [ i ] # Jumptable_AddressLoadedFromMemory r = self . _make_switch_cases_address_loaded_from_memory ( seq , i , node , addr2nodes , jump_tables ) if r : # we found a node that looks like a switch-case. seq.nodes are changed. resume to find the next such # case break # Jumptable_AddressComputed r = self . _make_switch_cases_address_computed ( seq , i , node , addr2nodes , jump_tables ) if r : break else : # we did not find any node that looks like a switch-case. exit. break