Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Decode base64 and convert to hex format, like shellcode
#!/usr/bin/env python
from base64 import b64decode
from urllib import unquote
base64_strs = ['xU5LNJhXeo9B6o4Ri%2FxFHodARXWqgtNufNrYzqG05nGOLNboDgJtkw%3D%3D',
for bstr in base64_strs:
unquoted_bstr = unquote(bstr)
data = b64decode(unquoted_bstr)
bl = []
for char in data:
mm = int(char.encode('hex'), 16)
print(' '.join(bl))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment