Skip to content

Instantly share code, notes, and snippets.

Embed
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',
'%2BjAd73J7RAZgLxAUkIG5l0cMPLQEBAtZRMP3WdXr1%2BMYdrg2cZKaow%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)
bl.append(hex(mm))
print(' '.join(bl))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.