I think many have a question "Does RW-MP support plugins from SA-MP?". I also asked myself this question recently, so I decided to check.
And what you think? Many plugins worked perfectly fine. But of course there were some that didn't work, these were plugins that worked through memory hacking. And I think for obvious reasons (It is enough to compile server using a different version of MSVC++ or GCC).
But how to make support for RW-MP? You can create issue on GitHub and wait until the author updates the plugin. But what if the time has passed and the author doesn't update the plugin? That's what I wrote in this tutorial.
I decided to try myself to update the unsupported RW-MP plugin. My choice was Pawn.CMD. First of all, I read this tutorial. But there were not exactly those addresses that are used in Pawn.CMD. Then I decided to ask ziggi. And now I am ready to share with you. Let's start!
1.) Open RW-MP server in IDA PRO (You can download this on the internet)
2.) Press SHIFT + F12, you will see all strings
3.) Now press ALT+T to find public which we want to hook, in our case this will be OnPlayerCommandText
4.) Left-click on OnPlayerCommandText string
5.) Double click where it is marked yellow
6.) If all is well you must see something like that
7.) Press F5 and IDA will make pseudocode on C language
8.) Where is marked yellow - address of function, you must remember it, now go to the window "IDA View-A" and scroll to the address we remembered
9.) Go to the window "Hex View" and you must see address, which we will be using for Pawn.CMD
We got address of OnPlayerCommandText in RW-MP server. Now we should replace address in Pawn.CMD with the one we found:
const char *pattern =
"\x55\x8B\xEC" /*sub esp,0x8*/ \
"\x83" /*push ebx*/ \
"\xEC\x0C\x53\x8B" /*mov ebx,DWORD PTR [esp+0x14]*/ \
"\x5D" /*push ebp*/ \
"\x0C\x56\x57\x8B" /*mov ebp,DWORD PTR [esp+0x14]*/ \
"\xF9" /*push esi*/ \
"\xC7\x45" /*xor esi,esi*/ \
"\xFC" /*push edi*/ \
"\x00\x00" /*mov edi,ecx*/ \
"\x00\x00\x33\xF6" /*mov DWORD PTR [esp+0x10],esi*/ \
"\x8B\x04\xB7" /*mov eax,DWORD PTR [edi+esi*4]*/ \
"\x85\xC0"; /*test eax,eax*/
But I think that you can do it yourself. Just download source code from this repo and compile with this address.
For Linux you must do the same thing.
I hope my tutorial helped you.