Hi i'm creating a BruteForce function in Qt and altough this code works in my Python version the C++ seems to be a little buggy:
Code:
#include <QtCore/QCoreApplication> #include <QDebug> int main(int argc, char *argv[]) { BruteForce(1,3,"abcdef"); return a.exec(); } { for (int i=min; i<=max; i++) { qDebug() << "Checking with" << i << "char " << endl; recurse(i,0,"",charset); } } { QChar c; for (int i=0;i<=charset.length();i++) { if (pos < width - 1) { recurse(width, pos+1 , s + c , charset); } c=charset[i]; qDebug() << s+c; } }
and my output:
....
"aed"
"aee"
"aef"
"ae
"af"
"afa"
"afb"
"afc"
"afd"
"afe"
"aff"
"af
"a
"b"
"b
"b
"b
"b
"b
"b
"b
"ba"
"baa"
"bab"
"bac"
"bad"
"bae"
"baf"
"ba
"bb"
......
as you can see it goes trough aaa to aaf and check again ? aa ?
after a 3 character check it prints the actual item in the cahrset in [charset lenght] times O.o
any guesses?
