CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
translate autoit to perl

 



bf2forlife
Novice

Sep 14, 2008, 9:32 AM

Post #1 of 13 (2896 views)
translate autoit to perl Can't Post


Code
 $let = "0123456789abcdefghijklmnopqrstuvwxyz" 
$file = FileOpen("output.txt", 2)
$counter = 1
If $file = -1 Then Exit
For $a = 1 To StringLen($let)
For $b = 1 To StringLen($let)
For $c = 1 To StringLen($let)
For $d = 1 To StringLen($let)
$out = StringStripWS(StringMid($let, $a, 1) & StringMid($let, $b, 1) & StringMid($let, $c, 1) & StringMid($let, $d, 1),8) ;& StringMid($let, $e, 1) & StringMid($let, $f, 1) & StringMid($let, $g, 1), 8)
If StringLen($out) > 4 Then Exit
FileWriteLine($file, $out)
$counter = $counter + 1
tooltip($counter)
Next
Next
Next
next



so can someone translate this simple autoit script to perl?


travs69
Novice

Sep 14, 2008, 11:00 AM

Post #2 of 13 (2888 views)
Re: [bf2forlife] translate autoit to perl [In reply to] Can't Post

Please post example input and example output.


bf2forlife
Novice

Sep 14, 2008, 11:13 AM

Post #3 of 13 (2885 views)
Re: [travs69] translate autoit to perl [In reply to] Can't Post

what u mean?


travs69
Novice

Sep 14, 2008, 11:48 AM

Post #4 of 13 (2880 views)
Re: [bf2forlife] translate autoit to perl [In reply to] Can't Post

Instead of trying to read and understand all the autoit code. Tell us exactly what it does

As an example, tt takes an input file with data like

xyz

and converts it to output like

x

y

z



or something :) Get what I'm saying?


bf2forlife
Novice

Sep 14, 2008, 12:11 PM

Post #5 of 13 (2879 views)
Re: [travs69] translate autoit to perl [In reply to] Can't Post

well the script writes all possible 4 letters long combinations with numbers to a txt file called output.txt

stringlen = Returns the number of characters in a string.

stringstripWS = Strips the white space in a string.

stringmid = Extracts a number of characters from a string.


(This post was edited by bf2forlife on Sep 14, 2008, 12:22 PM)


KevinR
Veteran


Sep 14, 2008, 1:02 PM

Post #6 of 13 (2868 views)
Re: [bf2forlife] translate autoit to perl [In reply to] Can't Post

The List::Permutor module will create all possible permutations from a string or list. But you would need to install it.
-------------------------------------------------


travs69
Novice

Sep 14, 2008, 1:06 PM

Post #7 of 13 (2865 views)
Re: [KevinR] translate autoit to perl [In reply to] Can't Post


Code
my $data = '0123456789abcdefghijklmnopqrstuvwxyz';   
my @list = split //, $data;

for my $i (@list) {
for my $j (@list) {
for my $k (@list) {
for my $l (@list) {
print "$i $j $k $l\n";
}
}
}
}





Oh yeah.. Credit goes to Ewish,ChrisHunt,KevinADC for basically giving me the same answer to the same question on tek-tips.


(This post was edited by travs69 on Sep 14, 2008, 1:09 PM)


bf2forlife
Novice

Sep 15, 2008, 11:21 AM

Post #8 of 13 (2822 views)
Re: [travs69] translate autoit to perl [In reply to] Can't Post

Thanks, it seems like its harder in autoit ^^ but i have some questions

1. how u could print the output in a .txt file?

2. how u could print the output in a .txt file and command prompt at the same time?


KevinR
Veteran


Sep 15, 2008, 11:54 AM

Post #9 of 13 (2819 views)
Re: [bf2forlife] translate autoit to perl [In reply to] Can't Post

becareful, if you run the code travs69 posted, it will create a gigantic file with many many millions of lines and could take hours to run. Maybe you should try and define your requirements a bit better.
-------------------------------------------------


bf2forlife
Novice

Sep 15, 2008, 12:05 PM

Post #10 of 13 (2817 views)
Re: [KevinR] translate autoit to perl [In reply to] Can't Post

hmm lets forget what i said earlier. I got another autoit script that needs translating


Code
 $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") 
$oHTTP.Open("POST", "http://www.sampleaddress.com/cookieprotection/index.php?action=login")
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$oHTTP.Send("loginname=user&password=demo")
If StringInStr($oHTTP.ResponseText, "Protected Page") Then
MsgBox(0,"yay it worked",)
EndIf

This script logs you in to a site with POST method and checks if everything has gone right with ResponseText

StringInStr = Checks if a string contains a given substring.


KevinR
Veteran


Sep 15, 2008, 12:14 PM

Post #11 of 13 (2812 views)
Re: [bf2forlife] translate autoit to perl [In reply to] Can't Post


Quote
hmm lets forget what i said earlier.


Building a brute force login script? You're not going to get help with something like that.
-------------------------------------------------


bf2forlife
Novice

Sep 15, 2008, 12:28 PM

Post #12 of 13 (2808 views)
Re: [KevinR] translate autoit to perl [In reply to] Can't Post

oh i just noticed that lol, all possible combinations and login, but u dont have to answer that if u dont want to. let me ask some other questions

1. can you send packets with perl?

2. can you move ur mouse with perl?

and 3. can you search for pixels in screen with perl?


KevinR
Veteran


Sep 15, 2008, 12:56 PM

Post #13 of 13 (2800 views)
Re: [bf2forlife] translate autoit to perl [In reply to] Can't Post

Thats all the help I can be.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives