My new method is here:
http://www.purebasic.fr/english/viewtop ... 15#p340515
Old one below:
Fill chars.s() with characters you want to be tested
This code tries every possible combination
Code: Select all
;###################################
; Title: Bruteforce Engine
; Author: Joakim L. Christiansen
; License: Provided as example, do whatever you want
;
; About:
; Fill chars.s() with characters you want to be tested
;###################################
EnableExplicit
Global Dim chars.s(10), i, u
Define password.s, count, changed
Global length = 0, comb
Global Dim pass.s(length)
Global Dim pos(length)
; For i=0 To 9
; ReDim chars.s(comb)
; chars(comb) = Str(i)
; comb + 1
; Next
For i=97 To 122
ReDim chars.s(comb)
chars(comb) = Chr(i)
comb + 1
Next
comb-1
Repeat
ReDim pass.s(length)
ReDim pos(length)
For u=0 To length ;draw password
pass(u) = chars(0)
pos(u) = 0
Next
password = "": For u=0 To length ;draw password
password + pass(u)
Next: Debug password
Repeat
changed = 0
For i=length To 0 Step -1
If pos(i) < comb
pos(i) + 1
pass(i) = chars(pos(i)) ;hmm?
For u=i+1 To length ;reset others?
pos(u) = 0
pass(u) = chars(0)
Next
password = "": For u=0 To length ;draw password
password + pass(u)
Next: Debug password
changed = 1
Break
EndIf
Next
Until Not changed
;Debug "bye"
length + 1
Until length > 5
;MessageRequester("","")
