mirror of
https://github.com/JonathanSalwan/ROPgadget
synced 2026-06-08 11:25:23 +00:00
Small cleanup on makex64gadgets.py
This commit is contained in:
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user