public static List <RaiderResult> UnhashFromFile(Endianness unhashingEndianness, HashFactory hashFactory, uint[] arrayFromFile, CaseOptions caseOption) { var allStrings = new AllStrings().ReadHashesFile(hashFactory, caseOption); var listBox = new List <RaiderResult>(); var isKnown = false; void AddResult(uint hash) { if (allStrings.TryGetValue(hash, out var result)) { isKnown = true; } else { if (hash == 0 || hash == uint.MaxValue) { result = "--------"; isKnown = true; } else { result = "HASH_UNKNOWN"; isKnown = false; } } listBox.Add(new RaiderResult() { Hash = hash, Value = result, IsKnown = isKnown }); } if (unhashingEndianness == Endianness.BigEndian) { foreach (var hash in arrayFromFile) { AddResult(hash); } } else { foreach (var hash in arrayFromFile) { AddResult(hash.Reverse()); } } return(listBox); }
private void CheckFile() { Sender.GenericMessageBoxDuringBruteForce("Raid info", $"Hashes identified: {Hashes.Count}"); var allParts = new AllStrings().ReadHashesFile(HashFactory, CaseOption); var results = new List <RaiderResult>(); foreach (var hash in Hashes) { if (allParts.TryGetValue(hash, out var result)) { results.Add(new RaiderResult { Hash = hash, Value = result, IsKnown = true }); } else { results.Add(new RaiderResult { Hash = hash, Value = "HASH_UNKNOWN", IsKnown = false }); } } Sender.UpdateFormDuringBruteforce(results); }