#!/usr/bin/env python from pwn import * def connect(): global p p = remote("babytrace.quals2019.oooverflow.io", 5000) def add_constrained(name, contents): p.sendlineafter("Choice: ", "2") # Constrained p.sendlineafter("name: ", name) # Name p.sendlineafter("(in hex): ", contents) # Contents def add_unconstrained(name, num_bytes): p.sendlineafter("Choice: ", "1") # Unconstrained input p.sendlineafter("name: ", name) # Name p.sendlineafter("(in bytes): ", str(num_bytes)) # Bytes def add_concrete(inp): p.sendlineafter("Choice: ", "3") # Concrete input p.sendlineafter(" (in hex): ", inp) # Concrete input def symbolize_reg(reg): p.sendlineafter("Choice: ", "6") p.sendlineafter("Register name? ", reg) def read_reg_val(reg): symbolize_reg(reg) p.sendlineafter("Choice: ", "7") p.recvuntil("CONSTRAINTS: [