def exec_payload(shell_obj, payload_name, args=(), use_api=False):
 payload_inst = get_payload_instance(payload_name, shell_obj)
 if use_api:
  result = payload_inst.run_api(*args)
 else:
  result = payload_inst.run(*args)
 return result

def exec_payload ( shell_obj , payload_name , args = ( ) , use_api = False ) : payload_inst = get_payload_instance ( payload_name , shell_obj ) if use_api : result = payload_inst . run_api ( * args ) else : result = payload_inst . run ( * args ) return result
now i execute the payload .