Jump to content

Photo

Obfuscated Scripts


  • Please log in to reply
6 replies to this topic

#1 Beefster

Beefster

    Human Being

  • Members
  • Real Name:Justin
  • Location:Colorado

Posted 19 February 2009 - 06:46 PM

If you don't know what obfuscated scripts are, it's basically code that does something somewhat useful, but whose source looks like total crap to even an EXPERIENCED programmer.

I'll kick it with a quick obfuscation of my modification of the signpost script by pkmnfrk.
CODE
void vvvvvv(){Waitframe();}ffc script vvvvvvvv{void run(int vv){while(17){while(Link->X<this->X-8||Link->X>this->X+8||Link->Y<this->Y||Link->Y>this->Y+16||Link->Dir!=0||!Link->InputA)vvvvvv();Link->InputA=0;Screen->Message(vv);while(Link->X>=this->X-8&&Link->X<=this->X+8&&Link->Y>=this->Y&&Link->Y<=this->Y+16&&Link->Dir==0&&Link->InputA)vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();vvvvvv();}}}

It's not really that obfuscated, but it's pretty good for the first obfuscated script.
It compiles fine; the code is completely valid.

Post your obfuscated scripts too!

#2 Radien

Radien

    Courage

  • Members
  • Real Name:Steve
  • Location:Oregon

Posted 20 February 2009 - 04:47 AM

Sooo... are you treating this as a sort of brain teaser? Sort of like, "what does this script do? Figure it out." ...?

#3 Joe123

Joe123

    Retired

  • Members

Posted 20 February 2009 - 05:18 AM

Is this meant to be useful or just a game? icon_eyebrow.gif

When you said 'obfuscated' (seeing as I've never heard the word before and it starts with 'ob'), I thought you'd come up with some method for simulating objects in ZScript.

#4 Beefster

Beefster

    Human Being

  • Members
  • Real Name:Justin
  • Location:Colorado

Posted 20 February 2009 - 07:42 PM

It's completely useless, and that's the fun of it.

This is what obfuscation is.

#5 Koopa

Koopa

    The child behind the turtle

  • Members
  • Location:Switzerland

Posted 21 February 2009 - 02:58 AM

It's not completely useless. Obfuscation is a way of letting others use your code without understanding or being able to copy it. If you obfuscate a script for your new custom boss in your quest, you prevent others from using it in their own quests or learning from it.

For languages like Java, there are even commercial code obfuscators available.

It can also be put to malicious purposes - in fact viruses and he like are as a rule almost always obfuscated. One example is this bash code:
QUOTE
WARNING - DO NOT TRY IT OUT. THIS IS MALICIOUS CODE.

_(){ _|_& };_


But it's been put to lighter uses too. In the perl community, it's almost a meme to post obscure scripts that output the line "Just another perl hacker"


#6 Radien

Radien

    Courage

  • Members
  • Real Name:Steve
  • Location:Oregon

Posted 21 February 2009 - 06:25 AM

So, the translation of the selection of code Beefster posted would be:

'DON'T #%@$ING STEAL MY #%@$ING SIGNPOST."




icon_biggrin.gif

#7 Joe123

Joe123

    Retired

  • Members

Posted 21 February 2009 - 07:01 AM

CODE
int a__;ffc script a_______{            void run(int a___){;;;;a__=a___;
while(a____()>=0||0>a____());;}}        int a____(){return a__;;}


That's quite entertaining actually =P


What does your java code do Koopa?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users