Código
Module PRUEBA Private DChar() As Char = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" } Dim chrIntent As Integer Dim chrPos As Integer Public Sub initPasswordModule() chrIntent = 1 chrPos = 0 End Sub Public Sub newGetPassword() Dim BruteSTR(UBound(DChar)) As Char Dim PasswordCracked As Boolean PasswordCracked = True BruteSTR(0) = DChar(0) Do While PasswordCracked GenerateString(BruteSTR, chrPos, chrIntent) PasswordCracked = False Application.DoEvents() Loop End Sub Private Sub GenerateString(ByRef StrChar() As Char, ByRef cPos As Integer, ByRef cIntent As Integer) Dim lastCaracterIndex As Integer lastCaracterIndex = cIntent Mod Len(DChar) If lastCaracterIndex = 0 Then ' Llegamos al ultimo caracter del array => agregamos un nuevo caracter cPos = cPos StrChar(cPos) = DChar(0) Else StrChar(cPos) = DChar(lastCaracterIndex) ' Cambiamos el ultimo caracter por el siguiente End If cIntent = cIntent + 1 End Sub End Module
Aquí el error: (Ventana de Inmediato, debug)
Citar
- b - c - d - e - f - g - h - i - j - k - l - m - n - o - p - q - r - s - t - u - v - w - x - y - z - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - aa - ab - ac - ad - ae - af - ag - ah - ai - aj - ak - al - am - an - ao - ap - aq - ar - as - at - au - av - aw - ax - ay - az - aA - aB - aC - aD - aE - aF - aG - aH - aI - aJ - aK - aL - aM - aN - aO - aP - aQ - aR - aS - aT - aU - aV - aW - aX - aY - aZ - a0 - a1 - a2 - a3 - a4 - a5 - a6 - a7 - a8 - a9 - a - a - a - a - a - a - a - a - a - a - a
Véase los últimos caracteres en rojo. Muchas gracias a todos, espero que me puedan ayudar.
Utilizo VB2010