[code autolinks=”false”]
##################################################################
# Python script to decode base64 input (file or standard input). #
# #
# Usage: #
# python b64decode.py [<filename>] #
# #
# Will decode <filename>. If no filename is given, then the #
# script will read from standard input. #
# Decoded output will be written to standard output. #
# #
# #
# b64decode.py v2015.01.17 #
# http://malwaremusings.com/supporting-files/b64decode-py/ #
##################################################################
import sys
import base64
if (len(sys.argv) > 1):
f = open(sys.argv[1],"r")
else:
f = sys.stdin
d = f.read()
f.close()
print base64.b64decode(d)
[/code]