#!/usr/bin/env python
from pwn import *

GDB_OFF = 0x555555554000
IP = '{ip}'
PORT = {port}
BINARY = '{binary}'
ARGS = []
ENV = {env}
GDB = f"""
set follow-fork-mode parent

c"""

context.binary = exe = ELF(BINARY, checksec=False)
# libc = ELF('{libc}', checksec=False)
context.aslr = False

{aliases}

def get_target(**kw):

  if args.GDB:
    return gdb.debug([exe.path] + ARGS, env=ENV, gdbscript=GDB, **kw)

  # context.log_level = 'debug'
  if args.REMOTE:
    return remote(IP, PORT)

  return process([exe.path] + ARGS, env=ENV, **kw)




t = get_target()

it() # or t.interactive()
