Skip to content

Commit

Permalink
1. Fixed problem when min_len = 0.
Browse files Browse the repository at this point in the history
2. Added counter for the skipped variants.
  • Loading branch information
lexansoft committed Jun 14, 2017
1 parent 34ac1b1 commit f959f82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/accounts/keystore/cracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type CrackerParams struct {
N int
Total int
RE int
Skipped int

StartTime time.Time
}
Expand Down
15 changes: 12 additions & 3 deletions src/ethcracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ func main() {
}
}
} else {

indexes = make( []int, len( templates ) )
for i := 0; i < len( indexes ); i++ {
if templates_flags[i].UseAlways { indexes[i] = 1 }
Expand Down Expand Up @@ -334,15 +335,23 @@ func main() {
wg.Wait()
}

if *v > 0 { println( ":-( Sorry... password not found") }
if *v > 0 {
println( ":-( Sorry... password not found")
if params.Skipped > 0 {
println( "NOTE:", params.Skipped, "variants skipped because of length limitations")
}
}
}

func test( l []string ) {
s := ""
for _, n := range( l ) { s = s + n }

if len(s) < *min_len { return }
if len(s) > *max_len { return }

if s == "" { return }

if len(s) < *min_len { params.Skipped = params.Skipped + 1; return }
if len(s) > *max_len { params.Skipped = params.Skipped + 1; return }

if *dump != "" {
f_dump.Write( []byte( s + "\n" ) )
Expand Down

0 comments on commit f959f82

Please sign in to comment.