(self)
return functions
parse the import entries for functions.
        useful for recovering function names.

        Returns:
          Dict[int, Dict[str, any]]: from function index to dict with keys `index`, `module`, and `name`.
parse the import entries for functions.
        useful for recovering function names.
parse the import entries for functions . useful for recovering function names .
def _parse_imported_functions(self):
        '''
        parse the import entries for functions.
        useful for recovering function names.

        Returns:
          Dict[int, Dict[str, any]]: from function index to dict with keys `index`, `module`, and `name`.
        '''
        functions = {}
        import_section = self._get_section(wasm.wasmtypes.SEC_IMPORT)
        type_section = self._get_section(wasm.wasmtypes.SEC_TYPE)

        function_index = 0
        for entry in import_section.data.payload.entries:
            if entry.kind != idawasm.const.WASM_EXTERNAL_KIND_FUNCTION:
                continue

            type_index = entry.type.type
            ftype = type_section.data.payload.entries[type_index]

            functions[function_index] = {
                'index': function_index,
                'module': entry.module_str.tobytes().decode('utf-8'),
                'name': entry.field_str.tobytes().decode('utf-8'),
                'type': idawasm.common.struc_to_dict(ftype),
                'imported': True,
                # TODO: not sure if an import can be exported.
                'exported': False,
            }

            function_index += 1

        return functions
def _parse_imported_functions ( self ) : functions = { } import_section = self . _get_section ( wasm . wasmtypes . SEC_IMPORT ) type_section = self . _get_section ( wasm . wasmtypes . SEC_TYPE ) function_index = 0 for entry in import_section . data . payload . entries : if entry . kind != idawasm . const . WASM_EXTERNAL_KIND_FUNCTION : continue type_index = entry . type . type ftype = type_section . data . payload . entries [ type_index ] functions [ function_index ] = { 'index' : function_index , 'module' : entry . module_str . tobytes ( ) . decode ( 'utf-8' ) , 'name' : entry . field_str . tobytes ( ) . decode ( 'utf-8' ) , 'type' : idawasm . common . struc_to_dict ( ftype ) , 'imported' : True , # TODO: not sure if an import can be exported. 'exported' : False , } function_index += 1 return functions