Skip to content

Instantly share code, notes, and snippets.

@k3170makan
Last active May 25, 2018 06:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k3170makan/7f55d25869f3f812f8c3706089c0a74c to your computer and use it in GitHub Desktop.
Save k3170makan/7f55d25869f3f812f8c3706089c0a74c to your computer and use it in GitHub Desktop.
Simple tool script for building memory corruption payloads for exploit development
import struct
import sys
def encode(byte="41_41_41_41"):
return struct.pack("<I",int(byte.replace("_",""),16))
if __name__=="__main__":
payload = ""
for idx,arg in enumerate(sys.argv[1:]):
payload += encode(arg.split("-")[0])*int(arg.split("-")[1])
print payload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment