def execute(self, input_data):

        ''' Process the input bytes with pefile '''
        raw_bytes = input_data['sample']['raw_bytes']

        # Have the PE File module process the file
        pefile_handle, error_str = self.open_using_pefile('unknown', raw_bytes)
        if not pefile_handle:
            return {'error': error_str, 'dense_features': [], 'sparse_features': []}

        # Now extract the various features using pefile
        dense_features, sparse_features = self.extract_features_using_pefile(pefile_handle)

        # Okay set my response
        return {'dense_features': dense_features, 'sparse_features': sparse_features, 'tags': input_data['tags']['tags']}
def execute ( self , input_data ) : raw_bytes = input_data [ 'sample' ] [ 'raw_bytes' ] pefile_handle , error_str = self . open_using_pefile ( 'unknown' , raw_bytes ) if not pefile_handle : return { 'error' : error_str , 'dense_features' : [ ] , 'sparse_features' : [ ] } dense_features , sparse_features = self . extract_features_using_pefile ( pefile_handle ) return { 'dense_features' : dense_features , 'sparse_features' : sparse_features , 'tags' : input_data [ 'tags' ] [ 'tags' ] }
Process the input bytes with pefile