Pre-compiler
#21

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.
Reply
#22

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.)
Reply
#23

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.
Reply
#24

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?
Reply
#25

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

And its a user setting.
Reply
#26

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?
Reply
#27

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.
Reply
#28

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.
Reply
#29

Aha! Thanks.

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

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

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..
Reply
#32

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

any updates? are you still working on it?
Reply
#34

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)