Last active
February 18, 2024 20:22
-
-
Save rvrsh3ll/abea05538480db9e41afa3799e5053bb to your computer and use it in GitHub Desktop.
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
import binascii | |
import sys | |
file_name = sys.argv[1] | |
with open (file_name) as f: | |
hexdata = binascii.hexlify(f.read()) | |
hexlist = map(''.join, zip(hexdata[::2], hexdata[1::2])) | |
shellcode = '' | |
for i in hexlist: | |
shellcode += "0x{},".format(i) | |
shellcode = shellcode[:-1] | |
output = open('shellcode.txt', 'w') | |
output.write(shellcode) | |
output.close() | |
print "Shellcode written to shellcode.txt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice one!