Skip to content

Commit

Permalink
2.13 Much more effective skipping of the too long variants. Some repo…
Browse files Browse the repository at this point in the history
…rting fixes.
  • Loading branch information
lexansoft committed Jun 27, 2017
1 parent 5e94f70 commit 9a62fb9
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 19 deletions.
Binary file modified ethcracker
Binary file not shown.
2 changes: 1 addition & 1 deletion run.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

go run src/ethcracker.go -pk ~/test/pk.txt -t ~/test/templates.txt -threads 1 -min_len 1 -max_len 30 -v 1 -start_from 30% -re 7
go run src/ethcracker.go -pk ~/test/pk.txt -t ~/test/templates.txt -threads 1 -min_len 1 -max_len 20 -v 1 -start_from 30% -re 7
#go run src/ethcracker.go -pk ~/test/ethwallet-q.json -t ~/test/pattern.txt -presale -threads 4 -min_len 1 -v 1 -start_from 0
# -dump ~/test/v.txt
14 changes: 6 additions & 8 deletions src/accounts/keystore/cracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ func Test_pass( params *CrackerParams, s string, thread int ) error {
mutex.Lock()
params.N++
if params.V > 0 {
if params.N >= params.Start_from && params.N + params.Skipped - params.Start_from > 0 {
// println( "TH" + strconv.Itoa( thread ) + "-> #" + strconv.Itoa( params.N ) + "/" + params.Total +
// " " + strconv.Itoa( thread ) : ", s )

if params.N + params.Skipped > params.Start_from {
h := time.Since( params.StartTime ).Hours() *
float64( params.Total - ( params.N + params.Skipped) ) / float64 ( params.N + params.Skipped - params.Start_from )

Expand All @@ -128,23 +125,24 @@ func Test_pass( params *CrackerParams, s string, thread int ) error {
int64( h ) / (24 * 365), ( int64( h ) % (24 * 365) ) / 24, int64( h ) % 24, int64( h * 60 ) % 60,
s );
}

} else {
if params.Start_from > 0 && params.N % ( 100000 ) == 0 {
if params.Start_from > 0 && ( params.N + params.Skipped ) % ( 100000 ) == 0 {

h := time.Since( params.StartTime ).Hours() *
float64( params.Start_from - params.N ) / float64 ( params.Start_from )
float64( params.Start_from - ( params.N + params.Skipped )) / float64 ( params.Start_from )

fmt.Printf( "Skipping first %d -> %d %d%% Skipped: %d Left: %d years %d days %d hours %d minutes %v\n",
params.Start_from,
params.N,
params.N + params.Skipped,
( params.N + params.Skipped ) * 100 / params.Start_from,
params.Skipped,
int64( h ) / (24 * 365), ( int64( h ) % (24 * 365) ) / 24, int64( h ) % 24, int64( h * 60 ) % 60,
s );

}
}
}

mutex.Unlock()
if params.N + params.Skipped < params.Start_from { return errors.New( "skipped") }

Expand Down
42 changes: 32 additions & 10 deletions src/ethcracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func main() {

if *v > 0 {
println( "------------------------------------------------")
println( "Ethereum Password Cracker v2.12")
println( "Ethereum Password Cracker v2.13")
println( "Author: @AlexNa ")
println( "------------------------------------------------")
println( "Private Key File:", *pk )
Expand Down Expand Up @@ -325,7 +325,18 @@ func main() {
if *keep_order {
test( letters )
} else {
AllPermutations( letters, 0 )

s := ""
for _, n := range( letters ) { s = s + n }
if len(s) > *max_len {
N := fact( len( letters ) )
params.Skipped = params.Skipped + N

if params.V > 1 { fmt.Printf( "Skipped %d too long variants\n", N ) }

} else {
AllPermutations( letters, 0 )
}
}

for i := 0; i < len( indexes ); i++ {
Expand Down Expand Up @@ -375,14 +386,25 @@ func test( l []string ) {
h := time.Since( params.StartTime ).Hours() *
float64( params.Total - ( params.N + params.Skipped) ) / float64 ( params.N + params.Skipped - params.Start_from )

if ( params.N + params.Skipped ) > params.Start_from &&
( params.N + params.Skipped ) % ( params.RE * 10 ) == 0 {
fmt.Printf( "-----> %d/%d %d%% Skipped: %d Left: %d years %d days %d hours %d minutes \n",
params.N + params.Skipped,
params.Total,
( params.N + params.Skipped ) * 100 / params.Total,
params.Skipped,
int64( h ) / (24 * 365), ( int64( h ) % (24 * 365) ) / 24, int64( h ) % 24, int64( h * 60 ) % 60 );
if params.N + params.Skipped > params.Start_from {
if params.Start_from > 0 && ( params.N + params.Skipped ) % ( 100000 ) == 0 {
fmt.Printf( "Skipping first %d -> %d %d%% Skipped: %d Left: %d years %d days %d hours %d minutes %v\n",
params.Start_from,
params.N + params.Skipped,
( params.N + params.Skipped ) * 100 / params.Start_from,
params.Skipped,
int64( h ) / (24 * 365), ( int64( h ) % (24 * 365) ) / 24, int64( h ) % 24, int64( h * 60 ) % 60,
s );
}
} else {
if ( params.N + params.Skipped ) % ( params.RE * 10 ) == 0 {
fmt.Printf( "-----> %d/%d %d%% Skipped: %d Left: %d years %d days %d hours %d minutes \n",
params.N + params.Skipped,
params.Total,
( params.N + params.Skipped ) * 100 / params.Total,
params.Skipped,
int64( h ) / (24 * 365), ( int64( h ) % (24 * 365) ) / 24, int64( h ) % 24, int64( h * 60 ) % 60 );
}
}

return
Expand Down

0 comments on commit 9a62fb9

Please sign in to comment.