Basic template for injecting into applications, calling a function with a known location.
Used a particular popular MOBA game for this demo, which will remain un-named for the longevity of my github account.
Using a debugger and comparing with MSDN's Calling Convention page can work but IDA's decompiler makes this job very easy.
- Find the address of your target function. (For me this was found at (BaseAddress + 0x599D90))
- Find the function in IDA (rebasing to 0x0 is helpful)
- Decompile the function (F5)
Calling convention with arguments in seconds
For this function we have a this*, which we can pass (NULL) too, a const char* text, and the last integer parameter is just for color + the option to prepend the gametime with the message. (For example 5 is White Text, and 6 is White Text with the time)