Jump to content
Sign in to follow this  
KashCherry

[ Tutorial ] Plugin support

Recommended Posts

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)

ebkz7FY.png

 

2.) Press SHIFT + F12, you will see all strings

Dtjy8ow.png

 

3.) Now press ALT+T to find public which we want to hook, in our case this will be OnPlayerCommandText

L3gsR75.png

 

4.) Left-click on OnPlayerCommandText string

AT5k5BN.png

 

5.) Double click where it is marked yellow

wvpspMn.png

 

6.) If all is well you must see something like that

4TM731o.png

 

7.) Press F5 and IDA will make pseudocode on C language

HK63m4x.png

 

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

lvlcLeR.png

 

9.) Go to the window "Hex View" and you must see address, which we will be using for Pawn.CMD

RyBhuiz.png

 

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.

  • Like 7

Share this post


Link to post
Share on other sites

Good, thanks 

later i will add compiled files of pawn.cmd :fix:

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)
19 hours ago, 0x452 said:

Good, thanks 

later i will add compiled files of pawn.cmd :fix:

I propose to create a topic in which developers could write unsupported plugins

Edited by KashCherry

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×