On start the menu provides us with a couple of options.
To exploit this we only need to know about `c) create heap object’, ‘a) read type a into object’, ‘b) read type b into object’ and ‘e) run object function’.
Create heap object
It constructs a class with a single method and a char buffer on the heap.
The class has the following structure.
Read type a/b into object
Read a reads 35 bytes input via scanf and stores them into object->data.
Read b however, does the same thing as read_a but using
getchar in a do while loop with no bound checking.
Run object option from the main menu executes a method in a provided class id.
Since it’s a 50 pts task, the organizers have provided us with a win function.
So, what we need to do is. Allocate 2 classes and overflow class 0->data into class 1->method with the address of
win() and then call class 1’s method.