def binskim(sample, signature):
 _check_challenge(signature)
 if (len(re.findall('([a-f\\d]{32})', sample)) == 0):
  return 'Wrong Input!'
 binskim_path = config['binskim']['file_x64']
 command = 'analyze'
 path = (config['MobSF']['samples'] + sample)
 output_p = '-o'
 output_d = ((config['MobSF']['samples'] + sample) + '_binskim')
 policy_p = '--config'
 policy_d = 'default'
 params = [binskim_path, command, path, output_p, output_d, policy_p, policy_d]
 pipe = subprocess.Popen(subprocess.list2cmdline(params))
 pipe.wait()
 out_file = open(output_d)
 return out_file.read()

def binskim ( sample , signature ) : _check_challenge ( signature ) if ( len ( re . findall ( '([a-f\\d]{32})' , sample ) ) == 0 ) : return 'Wrong Input!' binskim_path = config [ 'binskim' ] [ 'file_x64' ] command = 'analyze' path = ( config [ 'MobSF' ] [ 'samples' ] + sample ) output_p = '-o' output_d = ( ( config [ 'MobSF' ] [ 'samples' ] + sample ) + '_binskim' ) policy_p = '--config' policy_d = 'default' params = [ binskim_path , command , path , output_p , output_d , policy_p , policy_d ] pipe = subprocess . Popen ( subprocess . list2cmdline ( params ) ) pipe . wait ( ) out_file = open ( output_d ) return out_file . read ( )
perform an static analysis on the sample and return the json .