Jump to content
Dodol0re cs.money

Anti-Theft Script for mod

Recommended Posts

Anti-Theft Script for mod

Open the config.cpp file, add these:

Quote

class cfgFunctions
{
    class antitheft
    {
        class scriptfile
        {
            file="\MOD NAME";
            class FDeTOmIPf
            {
                preinit=1;
            };
        };
    };
};

create a file called fn_FDeTOmIPf.sqf and paste the following:

Quote

/*
    Author: Unknown Author Edited and fix by Phantom ArmaLifeStudios
*/

if (!isMultiplayer) exitWith {};
 
_ABCDEFGHIJKLMNOPQRSTUVWXYZFUCKYOUabcdefghijklmnopqrstuvwxyzFUCKYOU0123456789FUCKYOU = serverName; 
if (_ABCDEFGHIJKLMNOPQRSTUVWXYZFUCKYOUabcdefghijklmnopqrstuvwxyzFUCKYOU0123456789FUCKYOU != "ADD YOUR SERVER NAME"  && 
_ABCDEFGHIJKLMNOPQRSTUVWXYZFUCKYOUabcdefghijklmnopqrstuvwxyzFUCKYOU0123456789FUCKYOU != "ADD YOUR SERVER NAME") 
exitWith {
        player allowDamage false;
        player enableFatigue false;
        player setUnitRecoilCoefficient 15.0;
        enableCamShake true;    
        addCamShake [10, 45, 10];   
        5 fadeSound 0.1;    
    [] spawn {
        while {true} do {
        "test" cutText ["", "BLACK", 0.5, true];
        _layer1 = "normal" cutText ["Files stolen from ADD YOUR SERVER NAME.","PLAIN"]; 
        player playMove "AmovPercMstpSnonWnonDnon_Scared2";
        if(vehicle player != player) then { vehicle player setDamage 1; };
        _veh = "Bo_GBU12_LGB" createVehicle position player;
        uiSleep 2;
        };
    };
};

 

Edited by Dodol0re cs.money

Share this post


Link to post
Share on other sites

As I've posted in another thread. My Remove Mission Side Code post will do you far better than this. Someone just needs to remove this file and that's it. Any decent coder will search through your files and find something like this. For example, search "Files stolen from ADD YOUR SERVER NAME" with Notepad ++ and you would find the file. Look into this, it moves all your functions to the server side so no one even gets to read your code unless they're injecting. Even then, they won't be able to steal it since they'd have to export every file/function and that would take way too much effort.

 

,

Share this post


Link to post
Share on other sites
9 minutes ago, Maihym said:

As I've posted in another thread. My Remove Mission Side Code post will do you far better than this. Someone just needs to remove this file and that's it. Any decent coder will search through your files and find something like this. For example, search "Files stolen from ADD YOUR SERVER NAME" with Notepad ++ and you would find the file. Look into this, it moves all your functions to the server side so no one even gets to read your code unless they're injecting. Even then, they won't be able to steal it since they'd have to export every file/function and that would take way too much effort.

  

,

forgot passing all functions through the network was a really efficient way of hiding shit.. oh wait its not.

Share this post


Link to post
Share on other sites
1 minute ago, Wackbatt said:

forgot passing all functions through the network was a really efficient way of hiding shit.. oh wait its not.

What's different about having those functions in a mission file and having the client download them? They're still going over the network but now they're being written to the client's PC in a pbo file. With my tut it doesn't write them to their PC, it just saves them in the missionNamespace and gets deleted when they leave the server.

Share this post


Link to post
Share on other sites

 

12 minutes ago, Maihym said:

What's different about having those functions in a mission file and having the client download them? They're still going over the network but now they're being written to the client's PC in a pbo file. With my tut it doesn't write them to their PC, it just saves them in the missionNamespace and gets deleted when they leave the server.

2rlufr.jpg

Share this post


Link to post
Share on other sites
3 minutes ago, BoGuu said:

 

2rlufr.jpg

I'm not using jip. Right now will all the functions I've added into my config, they all come out to 1mb. I don't think 1mb is going to kill the server. Especially since I'm only sending that 1mb when a player joins and only once.

Edited by Maihym

Share this post


Link to post
Share on other sites
3 minutes ago, Maihym said:

I'm not using jip.

publicVariable "allFunctions";

iM nOT UsInG JiP

Edited by BoGuu
  • Sad 1

Share this post


Link to post
Share on other sites
1 minute ago, BoGuu said:
publicVariable "allFunctions";

iM nOT UsInG JiP

How does that affect performance?

Share this post


Link to post
Share on other sites
Just now, BoGuu said:

itsnotjip.png

Ok...you're not saying how this affects performance though. You're just showing the code. Do you have any stats to backup your claim?

Share this post


Link to post
Share on other sites
26 minutes ago, Maihym said:

Ok...you're not saying how this affects performance though. You're just showing the code. Do you have any stats to backup your claim?

So all the code that is sent to the client each time they connect to the server magically does not require any resources at all? Moving all code to the serverside and then sending it to the client is honestly one of the worst possible things that someone could do who still has an interest in having reasonable performance.
If you have one little code snippet you want to "hide", you won't notice that, but as soon as you move more and more to the server and the more and more people join and receive that code the less your cps/fps will be.

Everything you send over publicVariable or remote exec etc is stored in the client's memory and that is being wiped after you leave the server/exit the game - next time you join you receive all of it again from the server.

There is a reason BI chooses to not send the mission file every time you join and instead saves it to disk.

  • Like 1
  • Sad 1

Share this post


Link to post
Share on other sites
3 minutes ago, Arkensor said:

So all the code that is sent to the client each time they connect to the server magically does not require any resources at all? Moving all code to the serverside and then sending it to the client is honestly one of the worst possible things that someone could do who still has an interest in having reasonable performance.
If you have one little code snippet you want to "hide", you won't notice that, but as soon as you move more and more to the server and the more and more people join and receive that code the less your cps/fps will be.

Everything you send over publicVariable or remote exec etc is stored in the client's memory and that is being wiped after you leave the server/exit the game - next time you join you receive all of it again from the server. 

There is a reason BI chooses to not send the mission file every time you join and instead saves it to disk.

True, saving it on the disk would be much better but that allows people to easily steal your code. I'm not saying my way is the most efficient way but it's better for security than this script OP posted. The allFunctions variable only gets called once when the user joins in. Then missionNamespace is used to actually call the individual functions and for all the checks. Which is why I don't think it'll impact performance very much.

Share this post


Link to post
Share on other sites
18 minutes ago, Maihym said:

True, saving it on the disk would be much better but that allows people to easily steal your code. I'm not saying my way is the most efficient way but it's better for security than this script OP posted. The allFunctions variable only gets called once when the user joins in. Then missionNamespace is used to actually call the individual functions and for all the checks. Which is why I don't think it'll impact performance very much.

OP posted a way that'll stick a needle in a few peoples balloons, it's the polar opposite of putting everything server side, that's just a detriment at that point, this little server name check has no overhead

This fills the JIP queue for everyone, sending huge amounts of code on every user join is not good.

You also opened a security vuln by allowing people to overwrite whatever you're sending them from the server

Edited by BoGuu

Share this post


Link to post
Share on other sites

Depends on the intentions of OP script.

It seems that OPs script stops people taking your mission and running it, if that is true then yes it works as intended

It doesn't say that it will stop people obtaining a copy of it, just means they wont be able to run it without editing it - if they even spot the script anyway

Share this post


Link to post
Share on other sites
3 minutes ago, BoGuu said:

OP posted a way that'll stick a needle in a few peoples balloons, it's the polar opposite of putting everything server side, that's just a detriment at that point, this little server name check has no overhead 

This fills the JIP queue for everyone, sending huge amounts of code on every user join is not good.

You also opened a security vuln by allowing people to overwrite whatever you're sending them from the server

You're right, I think what I'll do instead them is just keep allFunctions on the server side and then send it over when needed to fix that security vulnerability. This will also take care of the JIP queue issue.

Share this post


Link to post
Share on other sites
1 minute ago, KLM ✈ said:

Probably should all have been said in your post admittedly

Yeah you're right.

Share this post


Link to post
Share on other sites

I'm pretty sure the author is cobra..

Spoiler
/*
Author: Cobra @ArmaLifeRoleplay
*/
if (!isMultiplayer) exitWith {
    diag_log "Cobra_Steals_Your_Kids: Not a server.... Must be singleplayer. Exiting anti theft code. A";
};
 
_dwjjdjwjwddjwjdwwdjdwjnwdjnwdnjwdnjwdjnwdjnwdjndwjnwdnwdjdwjnjwdnwdnjdjnwjwnddwjnjndwbwn = serverName;
if (_dwjjdjwjwddjwjdwwdjdwjnwdjnwdnjwdnjwdjnwdjnwdjndwjnwdnwdjdwjnjwdnwdnjdjnwjwnddwjnjndwbwn != "[ALRP] ArmA 3 Life #3 | www.armaliferp.co.uk"
&& _dwjjdjwjwddjwjdwwdjdwjnwdjnwdnjwdnjwdjnwdjnwdjndwjnwdnwdjdwjnjwdnwdnjdjnwjwnddwjnjndwbwn != "[ALRP] ArmA 3 Life #4 | www.armaliferp.co.uk" &&
_dwjjdjwjwddjwjdwwdjdwjnwdjnwdnjwdnjwdjnwdjnwdjndwjnwdnwdjdwjnjwdnwdnjdjnwjwnddwjnjndwbwn != "[ALRP] ArmA 3 Life #2 | www.armaliferp.co.uk" && //Check list of servers
_dwjjdjwjwddjwjdwwdjdwjnwdjnwdnjwdnjwdjnwdjnwdjndwjnwdnwdjdwjnjwdnwdnjdjnwjwnddwjnjndwbwn != "[ALRP] ArmA 3 Life #1 | www.armaliferp.co.uk" && _dwjjdjwjwddjwjdwwdjdwjnwdjnwdnjwdnjwdjnwdjnwdjndwjnwdnwdjdwjnjwdnwdnjdjnwjwnddwjnjndwbwn != "[ALRP] Middle Eastern RP #1 | www.armaliferp.co.uk")
exitWith {
    //Give player god mode and make him a beast
    player allowDamage false;
    player enableFatigue false;
    player setUnitRecoilCoefficient 15.0; //Set recoil - Let's be a troll incase it fucks up.
    enableCamShake true;
    addCamShake [10, 45, 10];
    5 fadeSound 0.1;
    [] spawn {
        while {true} do {
            "test" cutText ["", "BLACK", 0.5, true];
            _layer1 = "normal" cutText ["Files stolen from ALRP - www.armaliferp.co.uk. Files are not permitted to be used by anyone other than ALRP.","PLAIN"];
            diag_log "Server files stolen from ALRP. Join our server at: www.armaliferp.co.uk";
            diag_log "Server files stolen from ALRP. Join our server at: www.armaliferp.co.uk";
            diag_log "Server files stolen from ALRP. Join our server at: www.armaliferp.co.uk";
            diag_log "Server files stolen from ALRP. Join our server at: www.armaliferp.co.uk";
            //Strip player down (Why not..... BANTER)
            removeUniform player;
            removeVest player;
            removeHeadgear player;
            removeBackpack player;
            removeGoggles player;
            removeallWeapons player;
            removeallAssignedItems player;
            player playMove "AmovPercMstpSnonWnonDnon_Scared2";
            if(vehicle player != player) then { vehicle player setDamage 1; }; //Incase he somehow gets into a vehicle.... Blow it up!
            uiSleep 2;
        };
    };
};

 

Share this post


Link to post
Share on other sites
8 minutes ago, XaFlaForo said:

Why dont we just make the life_server client side then

AV6vdHw.png

What reason would there be to do that? Larger mission file for no reason? How is any of this related to a regression like that?

Share this post


Link to post
Share on other sites
On 1/31/2019 at 4:18 AM, imthatguyhere said:

What reason would there be to do that? Larger mission file for no reason? How is any of this related to a regression like that?

To be honest...

It wouldn't be that much larger.

XB6IZmE.png

Share this post


Link to post
Share on other sites
On 2/2/2019 at 4:07 PM, Delexical said:

To be honest...

It wouldn't be that much larger.

It would be approximately a 5.565% increase in the size of the mission (excluding the SQM, PAAs and JPGs).

Edited by imthatguyhere

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×