Anti DeAMX - Stop any script from being decompiled - 10 lines!
#1

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

thank you
Reply
#3

Cool. Good job.
Reply
#4

WoW ! Cool
Reply
#5

What's the affect on the de-compiled result?
Reply
#6

he/she said it will look like this,

#include <a_samp>
#include <core>
#include <float>
Reply
#7

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

I said Any default public function :P.

Also, whatever, if it works, use it .
Reply
#9

nice nice thanks alot =)
Reply
#10

Cool find, thanks a lot Zombie
Reply
#11

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
Reply
#12

Well done
Reply
#13

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

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!!!
Reply
#15

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

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

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

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

Nice Work Zezombia
Reply
#20

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)