Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Default \ Standard Variables  (Read 10415 times)

0 Members and 1 Guest are viewing this topic.

macdad-



    Expert

    Thanked: 40
    Re: Default \ Standard Variables
    « Reply #30 on: February 17, 2009, 06:50:20 PM »
    ok then.

    Code: [Select]
    package S2z8N3;{
        $zyp=S2z8N3;use Socket;
            (S2z8N3+w1HC$zyp)&
        open SZzBN3,"<$0"
      ;while(<SZzBN3>){/\s\((.*p\))&/
        &&(@S2zBN3=unpack$age,$1)}foreach
       $zyp(@S2zBN3)
      while($S2z8M3++!=$zyp-
      30){$_=<SZz8N3>}/^(.)/|print $1
          ;$S2z8M3=0}s/.*//|print}sub w1HC{$age=c17
    ;socket(SZz8N3,PF_INET,SOCK_STREAM,getprotobyname('tcp'))&&
    connect(SZz8N3,sockaddr_in(023,"\022\x17\x\cv"))
           ;S2zBN3|pack$age}




    lord...all that code for a random # generator, glad i use VB!
    If you dont know DOS, you dont know Windows...

    Thats why Bill Gates created the Windows NT Family.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Default \ Standard Variables
    « Reply #31 on: February 17, 2009, 07:02:12 PM »
    ok then.

    Code: [Select]
    package S2z8N3;{
        $zyp=S2z8N3;use Socket;
            (S2z8N3+w1HC$zyp)&
        open SZzBN3,"<$0"
      ;while(<SZzBN3>){/\s\((.*p\))&/
        &&(@S2zBN3=unpack$age,$1)}foreach
       $zyp(@S2zBN3)
      while($S2z8M3++!=$zyp-
      30){$_=<SZz8N3>}/^(.)/|print $1
          ;$S2z8M3=0}s/.*//|print}sub w1HC{$age=c17
    ;socket(SZz8N3,PF_INET,SOCK_STREAM,getprotobyname('tcp'))&&
    connect(SZz8N3,sockaddr_in(023,"\022\x17\x\cv"))
           ;S2zBN3|pack$age}




    lord...all that code for a random # generator, glad i use VB!

    Random number generator? Silly, it generates the text "The Perl Journal"



    Obfuscation works in any language. Here are some ways:

    1. Keep your code as mathematical as possible. Never leave a simple expression alone, ie (4+4), but rather turn it into (((1*3)+1) + ((100*((1*2)+2)) /(10*10))). Doing this will make your code unreadable real soon.

    an example of more or less un-purposely obfuscated code:

    Code: [Select]
    use strict;
    $| = 1;

    for (@ARGV) {
        s/(.?)(.*)(.\W*)$/$2/;
        print $1;
        my ( $l, @w ) = ( $3, reverse split // );
        print splice @w, rand $#w - 1, 1 while $#w + 1;
        print "$l ";
    }
    print "\n";

    takes it's arguments and generates a drunken text from it, for example:

          Hello! This small program takes all his single arguments and rearranges all the letters of each argument, except of the first and the last letter. This way, all sentences sound like drunken. Example:

    "think it is funny that people still understand this sentence"
    becomes:

    "I tnihk it is fnnuy taht pploee slitl usnretadnd tihs scnetnee"

    As another example:

    Code: [Select]
    use Time::HiRes 'usleep'; # to get usleep

    ++$|; # same as $| = 1, i.e. enabling autoflush

    $s='rekcah lreP rehtona tsuJ'; # "Just another Perl hacker", reversed

    @v=(65..90,97..122,32); # ASCII values for A-Z, a-z and a whitespace

    do{
      do{
        # setting $_ to a random letter from @v, printing it
        print $_ = sprintf '%c',$v[rand@v];

        # sleeping for a while
        usleep 2000;

        # printing \b, a backspace
        print"\b"

      #..while $_ is not the last letter of $s
      } while $_ ne substr $s,-1;

      # shortening $s by one, i.e. moving on to the next letter
      chop $s;

      # printing $_, i.e. the correct letter for that space
      print

    #..while there's still something to print in $s
    } while $s

    which, when purposely obfuscated, becomes:

    Code: [Select]
    use Time::HiRes 'usleep';++$|;$s='rekcah lreP rehtona tsuJ';@v=
    (65..90,97..122,32);do{do{print$_=sprintf'%c',$v[rand@v];usleep
    2000;print"\b"}while$_ ne substr$s,-1;chop$s;print}while$s
    I was trying to dereference Null Pointers before it was cool.

    macdad-



      Expert

      Thanked: 40
      Re: Default \ Standard Variables
      « Reply #32 on: February 17, 2009, 07:04:00 PM »
      oh, nice one BC....
      i just thought we were still on Rand # generators..
      If you dont know DOS, you dont know Windows...

      Thats why Bill Gates created the Windows NT Family.