Jump to content

Help Converting Vbs To Au3


Recommended Posts

hey guys....i am trying to convert this vbs script to au3

DECLARE SUB PASS.FOUND (GUESS$)

MAX.LENGTH = 8

GUESS$ = " "

LENGTH = 1

CLS

PRINT "Please enter your test password (up to 8 characters)... ";

LINE INPUT PW$

CLS

WHILE LENGTH <= MAX.LENGTH

FOR I = 32 TO 126

MID$(GUESS$, 1, 1) = CHR$(I)

PRINT GUESS$

IF GUESS$ = PW$ THEN

PASS.FOUND (GUESS$)

END IF

NEXT I

IF MID$(GUESS$, LENGTH, 1) = CHR$(126) THEN

MID$(GUESS$, LENGTH, 1) = CHR$(32)

LENGTH = LENGTH + 1

GUESS$ = GUESS$ + CHR$(32)

END IF

FOR J = 1 TO LENGTH - 1

IF MID$(GUESS$, J, 1) = CHR$(126) THEN

MID$(GUESS$, J, 1) = CHR$(32)

MID$(GUESS$, J + 1, 1) = CHR$(ASC(MID$(GUESS$, J + 1, 1)) + 1)

END IF

NEXT J

WEND

PRINT "The password was not found!"

SUB PASS.FOUND (GUESS$)

PRINT "The password is " + GUESS$ + ".";

END

END SUB

the closest i could get was this (since i dont know vb at all)

$MAX = 8

$GUESS = " "

$LENGTH1 = 1

$PW = InputBox("Please enter your test password (up to 8 characters)... ", "")

WHILE $LENGTH1 <= $MAX

FOR $I = 32 TO 126

StringMid($GUESS, 1, 1) = CHR($I)

MsgBox(0, "", $GUESS)

IF $GUESS = $PW THEN

_FOUND($GUESS)

EndIf

NEXT

IF StringMid ($GUESS, 1, 1) = CHR(126) THEN

StringMid ($GUESS, $LENGTH1, 1) = CHR(32)

$LENGTH1 =+ 1

$GUESS = $GUESS & CHR(32)

ENDIF

FOR $J = 1 TO $LENGTH1 - 1

IF StringMid ($GUESS, $J, 1) = CHR(126) THEN

StringMid ($GUESS, $J, 1) = CHR(32)

StringMid ($GUESS, $J + 1, 1) = CHR(ASC(StringMid ($GUESS, $J + 1, 1)) + 1)

EndIf

NEXT

WEND

MsgBox(0, "", "The password was not found!")

Func _FOUND($GUESS)

MsgBox(0, "", "The password is " & $GUESS & ".")

EndFunc

i know my problems are the lines like this "MID$(GUESS$, 1, 1) = CHR$(I) "...i was not sure how to convert those to autoit properly

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Link to comment
Share on other sites

hey guys....i am trying to convert this vbs script to au3

the closest i could get was this (since i dont know vb at all)

i know my problems are the lines like this "MID$(GUESS$, 1, 1) = CHR$(I) "...i was not sure how to convert those to autoit properly

VBS uses Mid(), not MID$(). Print, amother method that does not look VBS.

This script looks partly like VBS, but not.

Link to comment
Share on other sites

Hi,

Did you try vaconvert.au3 first?

VBScript to AutoIt Converter

Best, Randall

yes...i did try that...it didn't really help much

VBS uses Mid(), not MID$(). Print, amother method that does not look VBS.

This script looks partly like VBS, but not.

hmmm...i didn't even notice that it didn't have a $ in the reference to that function

http://www.w3schools.com/vbscript/func_mid.asp

maybe its classic basic?

How about a description of what you want this script to do?

basically its a brute force password program... i know that kind of stuff is looked down on here... basically me and a friend got into a conversation and i thought it would be something easy to make...(he is also trying to do it in php).. just for education... not planning to use it for anything other than to see if i can get something working. after trying to figure out how to do it myself and not really getting anywhere ( i have an idea of how to do it...just had trouble making it) i looked online the script above looked like something i could get an idea from

that code came from here http://www.hackinthebox.org/modules.php?op...order=0&thold=0

Edited by ACalcutt

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Link to comment
Share on other sites

i never actually tried that code in vb... i guess its not vb?

i tried to run that code...but it failed

C:\Documents and Settings\Administrator>cscript c:\code.vbs

Microsoft ® Windows Script Host Version 5.6

Copyright © Microsoft Corporation 1996-2001. All rights reserved.

c:\code.vbs(1, 9) Microsoft VBScript compilation error: Syntax error

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Link to comment
Share on other sites

Personally... It would take less time to just write the thing fresh in AutoIt then try and port over some VBS stuff.

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

i took a look at my old dos PowerBasic help file.... mid$ is a BASIC function...not vb...

MID$ function

Function: Returns a portion of a string.

Syntax: s$ = MID$(string expression, start [, length])

MID$ returns a substring of string expression that is length characters

long and begins at position start. If length is omitted, or there are

fewer than length characters to the right of the character at start, all

remaining characters of string expression, including the character at

start, are returned. If start is greater than the length of string

expression, MID$ returns a null string.

See also: MID$ statement

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Link to comment
Share on other sites

i took a look at my old dos PowerBasic help file.... mid$ is a BASIC function...not vb...

Yes, which is just like StringMid() in AutoIt.. but like I said, It would probably be best to write some basic autoit scripts, take the AutoIt 1-2-3 tutorial, read the help file a lot.. and write this again, fresh.

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

Personally... It would take less time to just write the thing fresh in AutoIt then try and port over some VBS stuff.

well...my origional idea that i was having trouble would work something like this

starts at 1 character

goes from CHR(32) - CHR(127)

if no match is found the first character will go back to the start(CHR(32) and then it will add a second character

now the second character will go from CHR(32) - CHR(127)

when the second row reaches chr(127) it will incremet the first row one...and then second character will go from CHR(32) - CHR(127) again

that will continue untill the first row is CHR(127) and the second row CHR(127)

then it will add a 3rd row etc.. etc..

now to get that into a script :think:

-edit-

@Simucal - trust me...the autoit help file is my best friend :-)....the thing i am having the most trouble with is making it so i dont need to know the amount of characters

i origionaly had something like this, i got stuck when i needed to go to the next character

$start = 32
$end = 127
$current = $start
$startwith = ""
$matchword = test

 Func _Match($startwith, $matchword) 
      While $current =< $end 
           If $matchword = $startwith & Chr($current) Then Exit 
           $current += 1 
      WEnd 
      $current = $start 
 EndFunc

and yes i know that function isn't called...i never got that far

Edited by ACalcutt

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Link to comment
Share on other sites

this isn't in a function but it finds the first letter

$start = 32
$end = 127
$current = $start
$startwith = ""
$matchword = "t"
      While $current <= $end 
           If $matchword == $startwith & Chr($current) Then
               MsgBox(0,0,Chr($current))
               Exit 
            EndIf
           $current += 1 
      WEnd 
      $current = $start

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

incase anyone is is curios...this is how the program has ended up so far

my friend figured out the basic idea in php

<?php 
//C2006 Code Phil Ferland (Longbow)
//C2006 Shell Andrew Calcutt (TheMHC)
// defind variables
  $A = 33; 
  $B = 33; 
  $C = 33; 
  $D = 33; 
  $E = 33; 
  $F = 33; 

//start alg with loop   
  while($F < 127 )  
  { 
// do A digit
    $A++;
    print "$F $E $D $C $B $A<BR>";
//test for 126 in A
    if($A <= 126)
    {
        continue;
    }
    //test for 126 in B
    elseif($B <= 126)
        //intrement $B if not 127
        {
        $A=33;
        $B++;
        print "$F $E $D $C $B $A<BR>";
        continue;
        }
        //test for 126 in C
        elseif($C <= 126)
            //incriment C
            {
            $B=33;
            $C++;
            print "$F $E $D $C $B $A<BR>";
            continue;
            }
            //test for 126 in D
            elseif($D<=126)
                //incriment D
                {
                $C=33;
                $D++;
                print "$F $E $D $C $B $A<BR>";
                continue;
                }
                //test for 126 in E
                elseif($E<=126)
                    //Increment E
                    {
                    $D=33;
                    $E++;
                    print "$F $E $D $C $B $A<BR>";
                    continue;
                    }
                    //test for 126 in F
                    elseif($F<=126)
                        //incriment F
                        {
                        $E=33;
                        $F++;
                        print "$F $E $D $C $B $A<BR>";
                        continue;
                        };
    }
?>

and i convered his php into my on autoit scrip

;------------------------------------------------------------
;C2006 PHP Code Phil Ferland (Longbow) 
;C2006 Converted to AutoIt by Andrew Calcutt (TheMHC)
;------------------------------------------------------------
#include <GuiConstants.au3>
#include <File.au3>
#include <Array.au3>
; defind variables
Dim $POS[1]
Dim $loop = 1, $line = 0
Dim $file = "log.txt"
_FileCreate($file)
;------------------------------------------------------------

$loopsize1 = InputBox("Question", "What is the maximum number of characters")
For $l = 1 to $loopsize1
    _ArrayAdd($POS, 32)
Next

For $loopsize = 1 to $loopsize1
    While $POS[$loopsize] <= 127
        $ContinueLoop = _Increment($POS[$loop], $POS[$loop - 1])
        If $ContinueLoop = 1 Then 
            $loop = 1
            ContinueLoop
        EndIf
        $loop += 1
    WEnd
Next
Exit    
    

Func _Increment(ByRef $increment, ByRef $reset)
    If $increment <= 127 Then ;test for 127 in $increment var
        $line += 1;increment $line number
        $write = "";clear write var
        For $w = 1 to $loopsize
            $write = Chr($POS[$w]) & $write
        Next
        FileWrite($file, $line & ": " & $write & @CRLF)
        $reset = 32; set $reset var to 32
        $increment += 1; incriment $increment var
        Return 1
    Else
        Return 0
    EndIf
EndFunc  ;==>_Increment
Edited by ACalcutt

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...