Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Converts a memory address to little endian , useful for exploits and such , also prints the format used in an exploit.
import sys
if len(sys.argv) == 1:
sys.exit(-1)
memAddress = sys.argv[1]#'bffffe65'#
start = len(memAddress)
print(memAddress)
outAddress = ''
hexAddress = ''
for i in range(len(memAddress),0,-2):
start -= 2
outAddress += memAddress[start:i]
hexAddress += '\\x'+ memAddress[start:i]
print(outAddress)
print(hexAddress)
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.