Separate the AMX
#22

Quote:
Originally Posted by Y_Leѕѕ
Getting the addresses is quite slow, as is figuring out the parameters as it requires looking into the EXE file and figuring out how bits work (I did used to be on the team, so do have a slight advantage in that I used to have source code access so know how certain parts are done, but they do change).

Getting the addresses of PAWN natives is easy - I've got code to do that for me. Getting the addresses you actually need is harder as the PAWN natives read in the parameters, convert them to a regular format then pass them to other functions.

Also, the PAWN invoke plugin doesn't actually go through PAWN for most calls, it just needs the AMX to exist to load all the function addresses which can then be looked up dynamically. This stage can be improved somewhat to remove the AMX and speed up the lookups (either create a static list with my code or embed the code into the plugin and rebuild the list every time the server starts), which may be a compromise between the two current methods.
I found out how to get the addresses to the functions, well I found that about 2 years ago when I made my wrapper and didn't look at it anymore after it worked.
My own custom wrapper gets and stores all those addresses when it starts as I thought at that time amx_FindNative would probably use a linear search through the table with natives the AMX holds which is very slow and you don't want to be doing that each time you want to call a native.

Those addresses still point to functions with the prototype:
Код:
static cell AMX_NATIVE_CALL Func(AMX*, cell*);
int (*func)(AMX*, cell*);  //Is how my wrapper stores them
So you will still need to convert everything to cells and allocate space in the AMX for strings, arrays and stuff passed by reference.

As far as I know the only way to completely bypass the AMX is when you have the prototypes and addresses for all the native functions, not the ones with the above prototype but the ones they call internally.
Reply


Messages In This Thread
Separate the AMX - by SMX - 28.12.2009, 21:44
Re: Separate the AMX - by cmg4life - 28.12.2009, 22:02
Re: Separate the AMX - by pliva_sb - 28.12.2009, 22:06
Re: Separate the AMX - by Zeex - 28.12.2009, 22:22
Re: Separate the AMX - by Google63 - 28.12.2009, 22:54
Re: Separate the AMX - by SMX - 28.12.2009, 23:11
Re: Separate the AMX - by Striker_Moe - 31.12.2009, 19:49
Re: Separate the AMX - by Calon - 04.01.2010, 07:11
Re: Separate the AMX - by BP13 - 04.01.2010, 07:20
Re: Separate the AMX - by MPKaboose - 04.01.2010, 15:13
Re: Separate the AMX - by SMX - 04.01.2010, 15:53
Re: Separate the AMX - by JernejL - 04.01.2010, 16:01
Re: Separate the AMX - by Burridge - 04.01.2010, 16:16
Re: Separate the AMX - by SMX - 04.01.2010, 21:29
Re: Separate the AMX - by Streetplaya - 05.01.2010, 22:15
Re: Separate the AMX - by SMX - 06.01.2010, 02:54
Re: Separate the AMX - by Streetplaya - 06.01.2010, 07:37
Re: Separate the AMX - by Streetplaya - 06.01.2010, 08:46
Re: Separate the AMX - by Streetplaya - 06.01.2010, 09:35
Re: Separate the AMX - by SMX - 06.01.2010, 13:41
Re: Separate the AMX - by Streetplaya - 06.01.2010, 17:33
Re: Separate the AMX - by SMX - 06.01.2010, 21:54
Re: Separate the AMX - by SMX - 07.01.2010, 02:21
Re: Separate the AMX - by SMX - 07.01.2010, 13:41
Re: Separate the AMX - by Streetplaya - 07.01.2010, 13:46
Re: Separate the AMX - by Google63 - 07.01.2010, 13:52
Re: Separate the AMX - by SMX - 07.01.2010, 14:29
Re: Separate the AMX - by Streetplaya - 07.01.2010, 14:35
Re: Separate the AMX - by SMX - 07.01.2010, 14:43
Re: Separate the AMX - by Streetplaya - 07.01.2010, 14:52
Re: Separate the AMX - by SMX - 07.01.2010, 16:07
Re: Separate the AMX - by SMX - 07.01.2010, 16:43
Re: Separate the AMX - by iLinx - 11.01.2010, 13:53
Re: Separate the AMX - by SMX - 11.01.2010, 20:01
Re: Separate the AMX - by iLinx - 12.01.2010, 20:29
Re: Separate the AMX - by SMX - 12.01.2010, 22:32
Re: Separate the AMX - by Littlejth - 22.01.2010, 03:48
Re: Separate the AMX - by Streetplaya - 22.01.2010, 13:02

Forum Jump:


Users browsing this thread: 1 Guest(s)