This binary was different than the other binaries we have seen so far, this one had 2 inputs to play with, as it involved pivoting. So the second buffer was the short buffer for pivoting and the first buffer was for bigger exploits chains.
The first buffer was there just to execute the pivoting as it only had space for 3 gadgets in total, which is very tight to play with, however we had gadgets to make it work.
Another catch in this binary was that we were supposed to call a function from an external library, the function itself was not present in the binary however one of the function was, which was enough to jump to the other function we wanted to i.e. ret2win.
The method we used to solve this one was same for both architectures -
Pivot to bigger space
Call the foot_hold function, to resolve the address for GOT
Get offset for the desired function
Add the offset to the foot_hold function GOT value