I am practicing buffer overflow and assembly coding. Right now I am able to find return address, and jump to anywhere inside the program itself. However, I want to do more than just jump to itself, I want to display some string that I sent to the program buffer (the string is not included in the program, but it's an input I sent with my exploit). Lets say I want to display "you are hacked!", how can I do that?
I understand to display something, I need to call prints() function inside the program itself, and assign the address value to $a0, which is the argument passing into prints() and prints() will print anything in that address out. However, my input string is not included in the program, I have no way to display my own message but only the data in program itself. How can I do that?