SA-MP Forums Archive
Anti DeAMX - Stop any script from being decompiled - 10 lines! - 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)
+--- Thread: Anti DeAMX - Stop any script from being decompiled - 10 lines! (/showthread.php?tid=61825)

Pages: 1 2 3


Anti DeAMX - Stop any script from being decompiled - 10 lines! - Zezombia - 16.01.2009

I've tested this on several scripts (using DeAMX v0.3), including the GodFarther. It took me about an hour of annoying cutting, compiling and decompileing, so be happy.

No more worrying about untrusted hosts being able to steal your source codes :P.

Any script with this protection will decompile as:
Quote:

#include <a_samp>
#include <core>
#include <float>
Nothing else.

To install...
Paste this anywhere in your script, as long as it's not in another callback:
pawn Code:
AntiDeAMX()
{
    new a[][] =
    {
        "Unarmed (Fist)",
        "Brass K"
    };
    #pragma unused a
}
Now, in a default public function (Ex: OnPlayerSpawn) paste this:
pawn Code:
AntiDeAMX();
That's it!

Example: http://pastebin.com/f4cdb7933

_________________________________________________

Want to make your script real safe? Read this:
Quote:
Originally Posted by ssǝן‾ʎ
The question is who has ownership of the script? If you write a script for a community and give them it, do you have any right to take it back? If you gave someone a Christmas present then fell out with them, would you claim the present back? The other question is who owns the server? If it's their server locking the script to an IP will do nothing as they'll still have that IP.

Anyway, I did write a thing for this a while ago by using bind in server.cfg and reading the value in the script using GetServerVarAsString:

pawn Code:
public OnGameModeInit()
{
    new
        ip[16];
    GetServerVarAsString("bind", ip, sizeof (ip));
    if (!ip[0] || strcmp(ip, "192.168.0.127"))
    {
        for (;;)
        {
            printf("Don't steal my script!");
        }
    }
}
If the bind variable is set then the server MUST be running on that server so you can compare it to the required IP. However this was editable before through hacking the amx, and is even easier now with deAMX.
The combination of the two are lethal !

Fell free to modify it in anyway you want. That was the smallest I could cut it down to. Even changing "Brass K" to "Bras K" stops it from working.


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - Nimphious - 16.01.2009

thank you


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - Backwardsman97 - 16.01.2009

Cool. Good job.


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - LightFight™ - 16.01.2009

WoW ! Cool


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - Joe Staff - 16.01.2009

What's the affect on the de-compiled result?


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - Nimphious - 16.01.2009

he/she said it will look like this,

#include <a_samp>
#include <core>
#include <float>



Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - pen_theGun - 16.01.2009

Code:
public OnGameModeInit()
{
	new a[][15] =
	{ "?","0","?" };
	#pragma unused a
}
or
Code:
main()
{
	new a[][15] =
	{ "?","?" };
	#pragma unused a
}
or
Code:
public OnGameModeExit()
{
	new a[][10] =
	{ "?","?","?"};
	#pragma unused a
}
and many other combos have all the same effect.
Also i see no need to excute AntiDeAMX() everytime on OnPlayerSpawn.

Once in;
Code:
public OnGameModeInit()
{
	AntiDeAMX();
return 1;
}
is enough.


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - Zezombia - 16.01.2009

I said Any default public function :P.

Also, whatever, if it works, use it .


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - Flo_White - 16.01.2009

nice nice thanks alot =)


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - yom - 16.01.2009

Cool find, thanks a lot Zombie


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - ICECOLDKILLAK8 - 16.01.2009

Lol you created an app to make using Deamx easyer, Then you create a code to Ruin it, lol, Nice one thanks for the code


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - Kieren - 17.01.2009

Well done


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - FUNExtreme - 17.01.2009

Very nice research you did backthere! I'll use this for shure.


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - Rimeau - 18.01.2009

Quote:
Originally Posted by [FF
TeddyBear ]
he/she said it will look like this,

#include <a_samp>
#include <core>
#include <float>
it does...

that's impressive, thanks a lot!!!


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - Manny165 - 18.01.2009

Great job, ill definitely need to add this just incase delux goes nutz and starts releasing people's gamemodes
lol


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - Celson - 18.01.2009

Great work Zezombia! This will definetly be very useful to scripters in the SA:MP community


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - [M]deLux - 18.01.2009

beware - it will only stop the decompiling for the current version of the decompiler, but cant stop the decompiling itself....


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - Zezombia - 19.01.2009

Quote:
Originally Posted by JeNkStAX
Lol you created an app to make using Deamx easyer, Then you create a code to Ruin it, lol, Nice one thanks for the code
Just doing my part.

Quote:
Originally Posted by FUNExtreme
Very nice research you did backthere! I'll use this for shure.
No research. I found it when I was testing Easy DeAMX on a script I've been working on. I had to go through 1000+ lines of cutting and decompileing to find what was causing it. So many files in the recycling bin...

Quote:
Originally Posted by [M
deLux ]
beware - it will only stop the decompiling for the current version of the decompiler, but cant stop the decompiling itself....
Explain what you mean. There is no decompiler for DeAMX. Just a "decompiling" script.


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - LibertyWorld - 19.01.2009

Nice Work Zezombia


Re: Anti DeAMX - Stop any script from being decompiled - 10 lines! - [M]deLux - 19.01.2009

Quote:
Originally Posted by Zezombia
Quote:
Originally Posted by [M
deLux ]
beware - it will only stop the decompiling for the current version of the decompiler, but cant stop the decompiling itself....
Explain what you mean. There is no decompiler for DeAMX. Just a "decompiling" script.
do you know what a decompiler is actually trying to do?

it tries to read the binary code of the amx file, where all used functionality is in - there is no way to hide functionality there, as it wouldnt be executed then

so you may have found a way to compile the script that it cant be decompiled with the de-amx tool at the moment, but in general it is still possible - thats what i tried to tell you