[FilterScript] Serve Protect [V2] [Password for Open Server]
#1


By DraKiNs
Introduction:
We had launched the PT-BR area but decided to post here it filterscript

Using:

Get the code

pawn Код:
#include <a_samp>

#define SenhaCodificar "DraKiNs" //- Password= DraKiNs

public OnGameModeInit()
{

    new string[128];
    format(string,128,"%s",hash(SenhaCodificar));
    if(!fexist("SenhaServidor.txt"))
        file_pass("PassDataBase.dll",string);
    if(!fexist("SenhaServidor.txt"))
        file_pass("/SenhaServidor.txt","Digite a Senha para Abrir o Server Aqui");

    if(fexist("FilePass.dll"))
        fremove("FilePass.dll");
    ComparePass();
    return true;
}
public OnGameModeExit()
{
    if(fexist("FilePass.dll"))
        fremove("FilePass.dll");
    return true;
}
ComparePass()
{
    new File:cfg=fopen("/PassDataBase.dll", io_read);
    new File:gfc=fopen("/SenhaServidor.txt", io_read);
    new string[128],string2[128];
    while(fread(cfg, string) && fread(gfc, string2))
    {
        if(strcmp(hash(string2),string,true))
        {
           
            print("Fechando Servidor ._.");
            SendRconCommand("exit");
        }
    }
    file_pass("/FilePass.dll","Temp File Created | NOT DELETE");
    SetTimerEx("DelConfig",10000,false,"");
}
forward DelConfig();
public DelConfig()
{
    fremove("FilePass.dll");
}
num_hash(buf[]) // By Draco
{
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++) {
    s1 = (s1 + buf[n]) % 65521;
    s2 = (s2 + s1) % 65521;
    }
    return (s2 << 16) + s1;
}

hash(str2[]) //By adler32
{
    new tmpdasdsa[255];
    tmpdasdsa[0]=0;
    valstr(tmpdasdsa,num_hash(str2));
    return tmpdasdsa;
}
file_pass(file[],string[])
{
    new File:filenhc;
    filenhc=fopen(file,io_write);
    fwrite(filenhc,string);
    fclose(filenhc);
    fclose(filenhc);
}
STEP 1

Change your Password in Filterscript

STEP 2

Compile and Delete PWN

STEP 3

Open the Server 1x

STEP 4

In 'SenhaServidor.txt' Add your password for open server,if incorrect = exit

STEP 5

In GameMode

In OnGameModeInit
pawn Код:
SetTimer("CheckFilePass",6500,false);
Final GM:

pawn Код:
forward CheckFilePass();
public CheckFilePass()
{
    if(!fexist("FilePass.dll"))
    {
        SendRconCommand("exit");
    }
}
Video
[ame]http://www.youtube.com/watch?v=n_wfeJim52c[/ame]


The End.
Be happy

Credits for DraKiNs and [FeK]Company
Reply
#2

very good
Reply
#3

This is a bit stupid, The person who is stealing the gamemode can easily check the file for the pass!
Reply
#4

Quote:
Originally Posted by KyleSmith
Посмотреть сообщение
This is a bit stupid, The person who is stealing the gamemode can easily check the file for the pass!
Stupid is let steal your gamemode, ok?

Also the files are deleted
Reply
#5

Ok, Maybe I have misunderstood the video.
Reply
#6

What about removing the filterscript in server.cfg? And create a fake .dll
Reply
#7

Very good Job!!

Quote:
Originally Posted by [FeK]DraKiNs
Посмотреть сообщение
Stupid is let steal your gamemode, ok?

Also the files are deleted
I agree with you!!
Reply
#8

Quote:
Originally Posted by wups
Посмотреть сообщение
What about removing the filterscript in server.cfg? And create a fake .dll
FilePass is File Temporary.. for check in GameMode!
PassDataBase is save the password (hash)
And SenhaServidor is for input pass for open server..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)