Created
December 9, 2017 20:30
-
-
Save Gameye98/6e53a99c8b90cf2d7edd383d6081193e to your computer and use it in GitHub Desktop.
Convert Ascii to Binary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# BinConv (Encoder or Decoder) | |
# Author: DedSecTL | |
# Date: 06-12-2017 (13:04) | |
# Blog: http://droidsec9798-com.mwapblog.com | |
import sys, asciibinary | |
def banner(): | |
print " ___ _ _____ " | |
print " / _ ) (_) ___ / ___/ ___ ___ _ __ " | |
print " / _ | / / / _ \/ /__ / _ \ / _ \| |/ / " | |
print "/____/ /_/ /_//_/\___/ \___//_//_/|___/ " | |
print "[#] Author: DedSecTL | Blackhole Security " | |
if len(sys.argv) != 3: | |
banner() | |
print "Usage: python binconv.py [-e,--encode] <ascii>" | |
print " python binconv.py [-d,--decode] <binary>" | |
sys.exit() | |
codec=sys.argv[1] | |
bincii=sys.argv[2] | |
if codec.strip() in "-e --encode".split(): | |
banner() | |
print "[*] Encode => %s" %bincii | |
encode = asciibinary.encode('%s' %bincii) | |
print "[*] Result => %s" %encode | |
sys.exit() | |
elif codec.strip() in "-d --decode".split(): | |
banner() | |
print "[*] Decode => %s" %bincii | |
decode = asciibinary.decode('%s' %bincii) | |
print "[*] Result => %s" %decode | |
sys.exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment