SA-MP Forums Archive
Pre-compiler - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Discussion (https://sampforum.blast.hk/forumdisplay.php?fid=84)
+---- Thread: Pre-compiler (/showthread.php?tid=418838)

Pages: 1 2


Re: Pre-compiler - steki. - 28.02.2013

Quote:
Originally Posted by Y_Less
Посмотреть сообщение
That's pretty much because I know a lot of that exact compiler version's corner cases and exploit them extensively.
That is a bit freaky.

Anyways, that is a great idea and shouldn't be hard to make it accomplished, but seems to be kinda painful. I'll be definitely using this.


Re: Pre-compiler - RajatPawar - 28.02.2013

Quote:
Originally Posted by Y_Less
Посмотреть сообщение
Where did you do that? And have you actually read the documentation?
I did it at the top, where every other declaration goes? And I am on the 14th or something page of the document, took it up last week (I read two pages or so a day, whenever I get time.)


Re: Pre-compiler - Y_Less - 28.02.2013

References like that aren't even valid in a global scope in C++ unless you declare and define them at the same time (even them I'm not sure), and you can't define things that might be referenced like that globally in PAWN anyway. Those are just for function parameters.


Re: Pre-compiler - RajatPawar - 28.02.2013

Oh cool, and yes, my mistake, I should have tried to &My_Var in a function or something. So, PAWN supports reference variables, but is it of any other use except for call by reference (thingy)? I mean I can't think of the requirement of a &e_Var for SA-MP scripts. OFF TOPIC: Why do appear offline even when you are online, is it your mod tweak thingy?


Re: Pre-compiler - Y_Less - 28.02.2013

Call by reference IS the requirement and very useful (think "GetPlayerPos").

And its a user setting.


Re: Pre-compiler - RajatPawar - 28.02.2013

So, you could actually exploit the use of reference vars, don't you think? I saw this program online, which tracks the memory locations being accessed by a program, and from where they are being accessed(Not sure of it's name)! You type in a certain value/string, and it looks for the line/memory address/line in the program that is being accessed. You know the max players in a server, so while a player connects, I am sure it checks if the max_player_count < players on server, you could type in the MAX_PLAYER_VALUE (500, etc) and it would bring you the location, and you just reference var it, so you could basically do a lot of harm, right?
Or am I wrong in some of my assumptions regarding the security SA-MP has, etc?

ALSO, aren't we going a bit off topic?


Re: Pre-compiler - Y_Less - 28.02.2013

We are talking about PAWN, not the server itself. PAWN is in a sandbox so you can only reference things within it's memory space (in theory, this encapsulation has been broken). However, there is no single place where "MAX_PLAYERS" is defined in the compiled server so you can't change it. Like a mode using "gVar[MAX_PLAYERS]" in multiple places, once the mode is compiled you would have to alter everything to increase that array.


Re: Pre-compiler - RajatPawar - 28.02.2013

MAX_PLAYERS is just something I am using as an example. Admittedly, searching for locations being accessed for the value '500' would return tons of line, but if it was a lot more unique than that, IsValidNick or so.
And about the sandbox, you yourself said, the box has been broken out of.


Re: Pre-compiler - Slice - 05.03.2013

Aha! Thanks.

This is what the pre-preprocessing stage files look like: flattened.zip


Re: Pre-compiler - Y_Less - 05.03.2013

That's, erm, quite horrendous! But awesome at the same time - nice.


Re: Pre-compiler - Slice - 12.03.2013

The pre-pre, post-pre, and compilation stages are working now! It should be able to compile anything not utilizing the 2nd pre-compilation pass.

And if anyone has a better name for pre-preprocessing, I'm all ears..


Re: Pre-compiler - fiki574 - 12.03.2013

Quote:
Originally Posted by Slice
Посмотреть сообщение
And if anyone has a better name for pre-preprocessing, I'm all ears..
b4-preprocessing :P


Re: Pre-compiler - zgintasz - 25.03.2013

any updates? are you still working on it?


Re: Pre-compiler - Slice - 25.03.2013

Quote:
Originally Posted by zgintasz
Посмотреть сообщение
any updates? are you still working on it?
Yes. You can follow and contribute here: https://github.com/oscar-broman/Prawn