Full instructions, I sent a message
1. Step ( Searching function )
1.1
For example, I find the function "print_center"
To begin, I started looking for any message that use in "print_center", I chose "World triggered \" Round_End \ "\ n"
CTRL + F looking
sub_100CFCD0
1.2
Leafing slightly up and get the body functions (
sub_10093C70 )
1.3
Searching this function (
sub_10093C70 )
int __cdecl sub_10093C70(int
a1, int
a2);
a1 = Arg1
a2 = Arg2
2.0 ( Creating C++ code )
Obtain real offsets
sub_10093C70 = 093C70 = 0x093C70
Full code:
PHP Code:
#include "amxxmodule.h"
void *base;
void Message(char *Message);
void FN_ClientCommand(edict_t *pEntity) {
const char* cmd = CMD_ARGV(0);
if (strcmp(cmd, "test") == 0) {
Message("Alexander.3 watching you");
RETURN_META(MRES_SUPERCEDE);
}
RETURN_META(MRES_IGNORED);
}
int DispatchSpawn( edict_t *pEdict ) {
base = GetModuleHandleA("mp.dll");
return 0;
}
void Message(char *Message) {
typedef void (*FN_Msg)(int v);
FN_Msg MessageCenter = (FN_Msg)((DWORD)base + 0x093C70);
MessageCenter((int)Message);
}
Screenshot:
Arg2 not used.. I wonder why is it used?