Created
December 5, 2013 12:56
-
-
Save RC1140/7804728 to your computer and use it in GitHub Desktop.
Converts a memory address to little endian , useful for exploits and such , also prints the format used in an exploit.
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 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