Small cleanup on makex64gadgets.py

This commit is contained in:
Allan Wirth
2013-02-05 23:12:44 -05:00
parent e76f0a971b
commit cbc11496a5
+1 -5
View File
@@ -29,7 +29,6 @@ def assemble(atts):
temp = tempfile.NamedTemporaryFile(suffix=".o")
f = "\n".join(atts) + "\n"
# f = att + "\n"
s = subprocess.Popen(["as", "--64", "-o", temp.name], stdin=subprocess.PIPE)
err = s.communicate(f.encode("ascii"))[1]
@@ -39,10 +38,6 @@ def assemble(atts):
s3 = subprocess.Popen(["objdump", "-d", temp.name, "-M", "intel"],
stdout=subprocess.PIPE)
dump = s3.communicate()[0].decode("ascii").split("\n")[7:]
# is there a better match to do here?
# while not b"<.text>" in dump[0]:
# dump.pop(0)
# dump.pop(0)
bins = []
intels = []
for line in dump:
@@ -79,6 +74,7 @@ def inst_iter(it, dontuse = (), gpz = None):
gp_registers = (
"%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi", "%rbp", "%rsp",
# If I were to generate all of these it would be very large.
# "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
)