You can do it in 2 ways.
1. The normal way
- We use the MessageBoxA function that is provided for us by microsoft.
- We simply check if we are ingame, this can be done in several ways; Checking the playerpointer, checking your current position (its forced to zero(0) when we enter the game and only changes when you spawn, etc..
- We can use the code like this:
Code:
if(adress > 0) //if we use the position check (uses size)
{
MessageBoxA(NULL, "TEXT", "TEXT", NULL); //<-NULL = Type
}
- This code will display the MessageBox as a default messagebox
2. Inline assembly
- We make and use our own generated code to display a messagebox that uses an adress.
- This code is not pre-programmed by microsoft and this will display a messagebox in the style used by the engine(WarRock, Crossfire, ..)
- We also have to use a check for this one, im going to use the same as in the previous function with the location
Code:
if(adress > 0) //if we use the position check (uses size
{
__asm
{
push text ;We push the text to the engine
call ADR_MessageBox ;We call the adress of the engine messagebox
pop ecx ;Pop sets the operand to the value on the stack
}
}
- This will display a messagebox that looks exactly the same as the one used by the game itself
* Remember to stop it from looping *
I hope this helps