// Get batches to process private void SplitBatchThread(object infoObj) { ThreadParams p = (ThreadParams)infoObj; int min = p.min; int max = p.max; int batchSize = p.batchSize; char[] start = new char[min]; char[] end = new char[max]; for (int i = 0; i < start.Length; i++) { start[i] = validChars.First(); } for (int i = 0; i < end.Length; i++) { end[i] = validChars.Last(); } List <Tuple <char[], char[]> > b = BreakPass.Split(batchSize, start, end, validChars); foreach (Tuple <char[], char[]> t in b) { batchesNotProcessed.Add(t); } isReady = true; BatchUpdate(); }
// worker thread private void DoWork() { BreakPass bp = new BreakPass(true, false, false, false, file, false); List <string> res = bp.CrackManagedExe(workers, size, aBatch); WorkResult(res); }
// Thread for doing the work private void CompleteWorkThread(object infoObj) { comm.SendWorkAccepted(); WorkParams p = (WorkParams)infoObj; bool passFound = false; BreakPass bp = new BreakPass(p.lower, p.upper, p.numbers, p.symbols, p.file); List <string> res = bp.CrackManagedExe(comm.threads, comm.batchSize, p.batch); foreach (string s in res) { comm.SendPassword(s); passFound = true; } comm.SendWorkCompleted(new string(p.batch.Item1), new string(p.batch.Item2), passFound); }