What is the equivalant of this in Perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WarcraftNoob
    New Member
    • Mar 2007
    • 8

    What is the equivalant of this in Perl

    What is the equivalent of this in perl

    On command line I have this

    perl -e "$n="\x41"x40;$ q="\x32\x32\x32 \x32";$e=$n.$q; print $n' | ./foo

    i want to tranlate it to this but its not working, how would I go about doing this, im on UNIX

    Code:
    #!/usr/bin/perl
    
    my $n="\x41"x40;
    
    my $q="\x32\x32\x32\x32";
    
    my $e=$n.$q;
    
    
    system(SOMETHING IN HERE);
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    There is no "equivalent " of that in perl, as that is perl.

    Additionally, your code appears to be nonsense, so I can't imagine how to help you.

    "\x41" is equivalent to the letter 'A'
    "\x32" is equivalent to the letter '2'
    x 40 repeats a string 40 times.

    I have no information to share past that.

    - Miller

    Comment

    • WarcraftNoob
      New Member
      • Mar 2007
      • 8

      #3
      Originally posted by miller
      There is no "equivalent " of that in perl, as that is perl.

      Additionally, your code appears to be nonsense, so I can't imagine how to help you.

      "\x41" is equivalent to the letter 'A'
      "\x32" is equivalent to the letter '2'
      x 40 repeats a string 40 times.

      I have no information to share past that.

      - Miller

      yes i know those are hex values, thats the point, to overflow the buffer, i need to know how I would execute that command line that i have through a perl source file

      Comment

      Working...