SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/01/2009, 02:14 AM   #1
Zezombia
Huge Clucker
 
Join Date: Apr 2008
Posts: 415
Reputation: 30
Default Anti DeAMX - Stop any script from being decompiled - 10 lines!

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.
Zezombia is offline   Reply With Quote
Old 16/01/2009, 03:08 AM   #2
Nimphious
Huge Clucker
 
Join Date: Dec 2008
Posts: 371
Reputation: 2
Default Re: Anti DeAMX - Stop any script from being decompiled - 10 lines!

thank you
Nimphious is offline   Reply With Quote
Old 16/01/2009, 03:16 AM   #3
Backwardsman97
High-roller
 
Backwardsman97's Avatar
 
Join Date: Nov 2007
Posts: 1,501
Reputation: 36
Default Re: Anti DeAMX - Stop any script from being decompiled - 10 lines!

Cool. Good job.
Backwardsman97 is offline   Reply With Quote
Old 16/01/2009, 03:19 AM   #4
LightFight™
Big Clucker
 
Join Date: Dec 2008
Posts: 80
Reputation: 7
Default Re: Anti DeAMX - Stop any script from being decompiled - 10 lines!

WoW ! Cool
LightFight™ is offline   Reply With Quote
Old 16/01/2009, 03:36 AM   #5
Joe Staff
High-roller
 
Joe Staff's Avatar
 
Join Date: Aug 2007
Posts: 2,578
Reputation: 378
Default Re: Anti DeAMX - Stop any script from being decompiled - 10 lines!

What's the affect on the de-compiled result?
__________________
Big bottom girls make this rockin' world go 'round.
Joe Staff is offline   Reply With Quote
Old 16/01/2009, 03:51 AM   #6
Nimphious
Huge Clucker
 
Join Date: Dec 2008
Posts: 371
Reputation: 2
Default Re: Anti DeAMX - Stop any script from being decompiled - 10 lines!

he/she said it will look like this,

#include <a_samp>
#include <core>
#include <float>
Nimphious is offline   Reply With Quote
Old 16/01/2009, 10:56 AM   #7
pen_theGun
Big Clucker
 
pen_theGun's Avatar
 
Join Date: Jan 2008
Posts: 179
Reputation: 0
Default Re: Anti DeAMX - Stop any script from being decompiled - 10 lines!

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.
__________________



pen_theGun is offline   Reply With Quote
Old 16/01/2009, 07:58 PM   #8
Zezombia
Huge Clucker
 
Join Date: Apr 2008
Posts: 415
Reputation: 30
Default Re: Anti DeAMX - Stop any script from being decompiled - 10 lines!

I said Any default public function :P.

Also, whatever, if it works, use it .
Zezombia is offline   Reply With Quote
Old 16/01/2009, 08:16 PM   #9
Flo_White
Huge Clucker
 
Join Date: Jul 2008
Location: Germany
Posts: 246
Reputation: 0
Default Re: Anti DeAMX - Stop any script from being decompiled - 10 lines!

nice nice thanks alot =)
__________________
Zombie Apocalypse: 77.220.180.161:7777 (click to play) (at HostedTab)
Forum: www.sampdm.net
Flo_White is offline   Reply With Quote
Old 16/01/2009, 08:22 PM   #10
yom
Gangsta
 
Join Date: Jul 2006
Posts: 988
Reputation: 6
Default Re: Anti DeAMX - Stop any script from being decompiled - 10 lines!

Cool find, thanks a lot Zombie
yom is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deamx Problem BlackAgent007 Help Archive 2 29/03/2010 09:58 PM
[ADD-ON] The Godfather: Crash Car Script! (Stop NON-RP Driving) Niicky_Andrews Filterscripts 31 23/11/2009 01:22 AM
Anti-DeAMX? DeltaAirlines12 Help Archive 2 13/09/2009 10:01 PM
PHP Start/Stop Script xinul Server Support 1 03/06/2009 09:56 PM
DEAmx / Decompiler Danut General 2 12/02/2009 08:17 PM


All times are GMT. The time now is 07:44 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.