PDA

View Full Version : How To Noobishly Authorize



A G E N T
06-07-2007, 08:15 PM
Hi, I was kind of bored today and thought I'd make this tutorial. Hopefully someone will enjoy it somewhat and make it not completely useless.

So in case you did not know, 'auths' or 'authorizing' is a way of making sure that only people who the maker of the script wants to use said script may use it. For example I want Bob to be able to use it because he paid me for it but not Jim because he is a big bully or something. Anyway, this is not the place to get into auths too much.

The (very noob-like) technique of authorizing I am going to show you today makes use of the following three things:

The ReadLN function. (See http://www.villavu.com/forum/showthread.php?t=8544 if you are not familiar.
The fact that SCAR does not set any margin limits.
The fact that making a new line for each statement is NOT necessary.


So, let's get started. Here is what SCAR looks like when you first open it:
program New;
begin
end.
Often times, the space between program New; and begin is used to put in notes (green text) in // or {} format. For our purposes, we have to use {} format so that the whole line is not noted. So we put this:
program New;
{Your notes here, possibly your name.}
{Maybe some more notes. Feel free to continue notes down.}
begin
end.
Next, you need the actual authorization code. Here is an example of what to use:function GetNames:boolean;
var Name,Pass:string;
begin
Name:=Readln('Username?');
Pass:=Readln('Pass?');
if((Name='A83')and(Pass='A84'))then
Result:=True;
end;
This will put up a prompt box then check to see if what the user inputted matches with what you have set as "correct" (In my case, Username A83, password A84.). However, in order to hide this line so that sneaky people can't change it around. So we condense it all into one line, separating lines and statements with semicolons.function GetNames:boolean;var Name,Pass:string;begin Name:=Readln('Username?');Pass:=Readln('Pass?');if ((Name='A83')and(Pass='A84'))then Result:=True;end; You then paste this on the same line as your notes, but really far into the margin (i.e starting at column 870). This is what our script looks like now.
program New;
{Here are some notes.} function GetNames:boolean;var Name,Pass:string;begin Name:=Readln('Username?');Pass:=Readln('Pass?');if ((Name='A83')and(Pass='A84'))then Result:=True;end ;
begin
end. If you scroll way over, you can see the GetNames. After the notes, you are free to put in your script. I will put in a useless one for our example, then include it in the main line.
program New;
{By: Agent 83} function GetNames:boolean;var Name,Pass:string;begin Name:=Readln('Username?');Pass:=Readln('Pass?');if ((Name='A83')and(Pass='A84'))then Result:=True;end;
procedure ScriptIt;
begin
//Do stuff here...
end;

begin
ScriptIt;
end;
Now to make the GetNames function work, we simply have to put a few statements far into the margins of the same line as ScriptIt, in the main loop.
The code is as follows, condensed, again, into one line:

if not(GetNames)then Writeln('Your cheeky message telling them they are unauthorized goes here.');TerminateScript;
So we paste that into the margins, and the finished product looks like this:

program New;
{By: Agent 83} function GetNames:boolean;var Name,Pass:string;begin Name:=Readln('Username?');Pass:=Readln('Pass?');if ((Name='A83')and(Pass='A84'))then Result:=True;end;
procedure ScriptIt;
begin
//Do stuff here...
end;

begin
ScriptIt; if not(GetNames)then Writeln('Your cheeky message telling them they are unauthorized.');TerminateScript;
end.


I hope this tutorial wasn't too wordy, but I wanted to be clear...I have attached a working example, enjoy! :)

Dan Cardin
06-07-2007, 08:40 PM
u could also do this

function GetNames:boolean;
var Name,Pass:string;
begin
Name:=Readln('Username?');
Pass:=Readln('Pass?');
if((Name='A83')and(Pass='A84'))then
Result:=True;
end;

Buckleyindahouse
06-07-2007, 08:40 PM
Well, Thats pretty nice. It had me for a min until I saw how far I could scroll the bar over and saw that small function at the top. This could be nice for noob auths. Nice Job.

Dan Cardin
06-07-2007, 10:12 PM
even better

function GetNames:boolean;
var Name,Pass:string;
begin
Name:=Readln('Username?');
Pass:=Readln('Pass?'); if((Name='A83')and(Pass='A84'))then
Result:=True;
end;

and theres no way to check....if its there....That pwns!!! cuz that will compile...u can have more than 1 procedure on a line like that

alach11
06-07-2007, 11:58 PM
Wow, this is great for pay scripts.

Dan Cardin
06-08-2007, 12:14 AM
or when you just want people to help you with your script...to keep them from leeching

Smartzkid
06-08-2007, 12:27 AM
:p Sorry to disagree with you again (in one week, too), but if you're asking for help from someone, they'd be a pretty smart person, right?

This really isn't hard at all to get past, so it wouldn't stop them from using it.

And if you protected it really heavily (like Star's essence miner), they wouldn't be able to help you, because they wouldn't be able to follow your code, or test it, etc...

alach11
06-08-2007, 12:34 AM
Any authing in scar is kinda limited though right? Because they can simply edit it out. The only method of prevention is making it really hard to edit out, which just depends on how determined the person is to edit the script.

Buckleyindahouse
06-08-2007, 01:57 AM
Any authing in scar is kinda limited though right? Because they can simply edit it out. The only method of prevention is making it really hard to edit out, which just depends on how determined the person is to edit the script.

If you obfus it and have it like star's then its not really limited.

Jason2gs
06-08-2007, 02:19 AM
How is Star's obfuscated?

Dan Cardin
06-08-2007, 11:31 AM
Sorry to disagree with you again (in one week, too), but if you're asking for help from someone, they'd be a pretty smart person, right?

This really isn't hard at all to get past, so it wouldn't stop them from using it.

And if you protected it really heavily (like Star's essence miner), they wouldn't be able to help you, because they wouldn't be able to follow your code, or test it, etc...

well if i really didnt want you to find my auths, i would have more than one throughout the script. and since you can have more than one procedure on a line....u can do function GetNames:boolean;
var Name,Pass:string;
begin
Name:=Readln('Username?');
Pass:=Readln('Pass?'); if((Name='A83')and(Pass='A84'))then
Result:=True;
end; and it works...so just have them randomly placed throughout a 600-2000 line script...kinda hard...plus they would be in the margin ...so you'd have to look at all the lines and scroll all the way over to the end.

as to helping....most of they problems i have, i dont need people to help me test...they just have to look at a few things, and they can figure it out

GoF
06-08-2007, 02:16 PM
This isn't too "great" :p You can just search the script and change those..

@Alach just make a online auth system or whatever they're called and get your script encrypted..

Starblaster100
06-08-2007, 05:05 PM
How is Star's obfuscated?


Try cracking my Script then.

Half of the auth is in a plugin, half is in the script.
Half of the authorization connects to the web, half checks in the script internally.
Bitmaps / DTMs are downloaded only on Successful Authorization which are necessary for the script to run
Strings are encrypted with my 2 line encryption procedure, and decrypted with my 2 line decryption procedure.
Obfuscated script, and encrypted.
Harsh consequences if the script realizes you are cracking it (And yes, it can realize you are cracking it)


Strings are converted like so:


Normal String:
Starblaster100

Encrypted Strings:(There are endless possibilities to what it can be encrypted to)
î(0^m˜°ç)aM{¬
ï)1_n™±è*bN|*
8$޾\&鵟=
etc...


Thank you.

There we go

Hugolord
06-08-2007, 05:39 PM
There we go

holy!

i dont get it tho you know on ur encryption Star do you put

const a = %; ?

Jason2gs
06-08-2007, 05:43 PM
@ Star

Wow, that's... Amazing...

I saw the screen shot where you had part of the script in the background, and it was just a bunch of random characters, it seemed. I didn't know that it was the actual script. I thought it was just for show :)

What's your "two line encrypt/decrypt"?

Edit: Oh, what'd happen should the hosting site you connect to ever goes offline?

Starblaster100
06-08-2007, 06:42 PM
@hugolord - No, its an algorithm
@Jason2gs - Thanks, its taken me some time to do. 2 line encrypter / decrypter is exactly as it sounds. 1 Procedure (which is 1 line long) to encrypt a string, and 1 Procedure (which is 1 line long) to decrypt the encrypted string.

I.E


Function Encrypt(S: String): String;
Begin
//Encryption here;
end;

gsquare567
06-08-2007, 08:46 PM
where is the script decrypted so scar can read it and people cant find it and crack your script?

also, how does a plugin work? is it just some code called by your script that calls the rest of your script?

Markus
06-10-2007, 09:58 PM
script is encrypted by freddy, and decrypted by scar when you run the script.
And a plugin is dll file that will add functions to scar without the need of an include. Since a plugin is compiled you can't view the source of it without a decompiler.

A G E N T
06-27-2007, 02:41 AM
This isn't too "great" :p You can just search the script and change those..



In that case, get rid of the cheeky message and leave the b*ggers wondering why the script isn't working :stirthepot: