using System; using System.IO; using System.Xml; using System.Text; using System.Linq; using System.Threading.Tasks; using System.Collections.Generic; using System.Runtime.InteropServices; namespace WinKeyRecover { class Program { public static void Main() { // Pour 4 manquants liste a 390625 posssibilités pour 19 819 368 octets (20Mo) // Pour 5 manquants liste a 9765625 posssibilités pour 356 225 912 octets (357Mo) !!! //11F "TDC2B-NG8YF-JH2BQ-46JJW-J8F7G" IntPtr hModule = NativeMethods.LoadLibrary(".\\pidgenx2.dll"); string fileXml = ".\\Win10pkeyconfig.xrm-ms"; string keyTest = "TDC2B-NG2YF-****Q-46JJW-J8F7G"; char[] patternChars = new char[] { 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'M', 'N', 'P', 'Q', 'R', 'T', 'V', 'W', 'X', 'Y', '2', '3', '4', '6', '7', '8', '9' }; CheckIsValid checkIsValid = new CheckIsValid(); bool isValidKey = checkIsValid.CheckKey(patternChars, keyTest); if (isValidKey) { CountMissingChars countMissingChars = new CountMissingChars(); int numberOfMissings = countMissingChars.Count(keyTest); GetMissingPositions getMissingPositions = new GetMissingPositions(); List positions = getMissingPositions.GetPositions(keyTest); GeneratePattern patternGenerator = new GeneratePattern(); List pattern = patternGenerator.Generate(patternChars, numberOfMissings); ReplaceMissings replaceMissings = new ReplaceMissings(keyTest, positions); CheckKey checkKey = new CheckKey(hModule, fileXml); SaveAsJson saveToJson = new SaveAsJson(); List> resultats = new List>(); for (int i = 0; i < pattern.Count; i++) { string key = replaceMissings.Replace(pattern[i]); string result = checkKey.Check(key); if (result != "Invalid") { resultats.Add(new List() { key, result }); saveToJson.Save(resultats); } Console.WriteLine("Clés numéro: {0}/{1} Trouvés:{3}", i, pattern.Count(), resultats.Count()); Console.CursorTop -= 1; Console.CursorLeft = 0; } checkKey.FreeMemory(); } NativeMethods.FreeLibrary(hModule); Console.WriteLine("Fin."); Console.ReadLine(); } } }