[Plugin] Squirrel in SA:MP
#5

I didn't meant you were implying me for using your plugin too, I'm just thanking you for giving us your useful codes, they really helped me a lot with my learning in hooks, etc.

giovanni94m, Aztecking and joemomma53, thanks!

EDIT: I kinda used this pointer method with the natives array, but I was just wondering that it is very hard to do with methods I don't know, for example... I don't know the SA:MP structure, I can't even imagine in what class are some function, in what address are this function, etc, so I just hooked a array with no class.

The problem is that this array contains the native functions made for Pawn VM, so I have to make its parameters, etc. So I decided to look at a disassembled native function, trying to find out if this function, being used for Pawn VM, calls another function, that are the function which make all the things. For example, I was trying to find if the functions on the SA:MP Server are made like this:

Code:
cell AMX_NATIVE_CALL n_GivePlayerMoney(AMX *amx, cell *params)
{
    //some code to check some things...
    return GivePlayerMoney(params[1], params[2]);
}
Or like this:

Code:
cell AMX_NATIVE_CALL n_GivePlayerMoney(AMX *amx, cell *params)
{
    //all the code that must be in the "GivePlayerMoney" called in the code above
    //that means... the RakNet things, send the packet, etc.
}
If the source is something like the first example, it will be easier to call a function with the maximum speed we can reach...

But if it is like the second example, we will have to pass through the AMX VM to call the function we wanna call. And that's what I'm doing for now, because I don't now if it's like the first or the second example. Assuming that the second example is more easy to call, and we have to use only one memory address pointing to the natives list, I used that. But even if with the first method we'd have to use several memory addresses (one for each function), I'd use it. Because it's more efficient.
Reply


Messages In This Thread
Squirrel in SA:MP - by Toribio - 12.08.2010, 23:15
Re: Squirrel in SA:MP - by giovanni94m - 12.08.2010, 23:22
Re: Squirrel in SA:MP - by Toribio - 12.08.2010, 23:47
Re: Squirrel in SA:MP - by joemomma53 - 12.08.2010, 23:49
Re: Squirrel in SA:MP - by Toribio - 12.08.2010, 23:55
Re: Squirrel in SA:MP - by Zeex - 13.08.2010, 01:36
Re: Squirrel in SA:MP - by Toribio - 13.08.2010, 01:43
Re: Squirrel in SA:MP - by Zeex - 13.08.2010, 01:51
Re: Squirrel in SA:MP - by Toribio - 13.08.2010, 01:56
Re: Squirrel in SA:MP - by joemomma53 - 13.08.2010, 02:10
Re: Squirrel in SA:MP - by Calgon - 13.08.2010, 10:43
Re: Squirrel in SA:MP - by Toribio - 13.08.2010, 16:56
Re: Squirrel in SA:MP - by Toni - 13.08.2010, 17:29
Re: Squirrel in SA:MP - by Toribio - 13.08.2010, 17:49
Re: Squirrel in SA:MP - by Souvlaki - 14.08.2010, 17:21
Re: Squirrel in SA:MP - by hencz - 14.08.2010, 20:05
Re: Squirrel in SA:MP - by [SF]RobMob - 18.08.2010, 22:37
Re: Squirrel in SA:MP - by iLinx - 18.08.2010, 22:51
Re: Squirrel in SA:MP - by DiddyBop - 19.08.2010, 03:04
Re: Squirrel in SA:MP - by [ESC]Walter_Wolf - 25.02.2014, 07:30
Re: Squirrel in SA:MP - by VIRUXE - 25.02.2014, 17:51
Re: Squirrel in SA:MP - by ManGoe - 27.04.2014, 10:15
Re: Squirrel in SA:MP - by GWMPT - 27.04.2014, 10:57

Forum Jump:


Users browsing this thread: 1 Guest(s)