@@ -22,10 +22,18 @@ GNU General Public License v2.0
22
22
https://github.com/cyclone-github/atomic_pwn/blob/main/LICENSE
23
23
24
24
version history
25
- v0.1.0-2024-04-16; initial release
26
- v0.2.0-2024-04-17; used multi-threading code from hashgen for 40% performance (alpha)
27
- v0.2.1-2024-04-18-1200; optimize code for 111% performance gain (process lines as byte, tweak read/write/chan buffers)
28
- v0.2.2-2024-05-02-1600; refactor code, fix https://github.com/cyclone-github/atomic_pwn/issues/2
25
+ v0.1.0; 2024-04-16
26
+ initial release
27
+ v0.2.0; 2024-04-17
28
+ used multi-threading code from hashgen for 40% performance (alpha)
29
+ v0.2.1; 2024-04-18-1200
30
+ optimize code for 111% performance gain (process lines as byte, tweak read/write/chan buffers)
31
+ v0.2.2; 2024-05-02-1600
32
+ refactor code
33
+ fix https://github.com/cyclone-github/atomic_pwn/issues/2
34
+ v0.2.3; 2025-01-13
35
+ fix https://github.com/cyclone-github/atomic_pwn/issues/5
36
+ modified codebase to mirror phantom_decryptor
29
37
*/
30
38
31
39
// main func
@@ -64,19 +72,20 @@ func main() {
64
72
os .Exit (1 )
65
73
}
66
74
67
- // override outputFile since this has not been implemented yet
68
- * outputFile = ""
69
-
70
75
startTime := time .Now ()
71
76
72
77
// set CPU threads
73
78
numThreads := setNumThreads (* threadFlag )
74
79
75
- // channels / variables
76
- crackedCountCh := make (chan int , 10 ) // buffer of 10 to reduce blocking
77
- linesProcessedCh := make (chan int , 1000 ) // buffer of 1000 to reduce blocking
80
+ // variables
81
+ var (
82
+ crackedCount int32
83
+ linesProcessed int32
84
+ wg sync.WaitGroup
85
+ )
86
+
87
+ // channels
78
88
stopChan := make (chan struct {})
79
- var wg sync.WaitGroup
80
89
81
90
// goroutine to watch for ctrl+c
82
91
handleGracefulShutdown (stopChan )
@@ -94,12 +103,16 @@ func main() {
94
103
95
104
// monitor status of workers
96
105
wg .Add (1 )
97
- go monitorPrintStats (crackedCountCh , linesProcessedCh , stopChan , startTime , validVaultCount , & wg , * statsIntervalFlag )
106
+ go monitorPrintStats (& crackedCount , & linesProcessed , stopChan , startTime , validVaultCount , & wg , * statsIntervalFlag )
98
107
99
108
// start the processing logic
100
- startProc (* wordlistFileFlag , * outputFile , numThreads , stopChan , vaults , crackedCountCh , linesProcessedCh )
109
+ startProc (* wordlistFileFlag , * outputFile , numThreads , vaults , & crackedCount , & linesProcessed , stopChan )
101
110
102
111
// close stop channel to signal all workers to stop
103
- time .Sleep (10 * time .Millisecond )
104
112
closeStopChannel (stopChan )
113
+
114
+ // wait for monitorPrintStats to finish
115
+ wg .Wait ()
105
116
}
117
+
118
+ // end code
0 commit comments