/* ------------------------------------------------------------------------ Copy/paste all of this code over the function generateClicked() , which includes the modified function generateClicked(), variable definitions, and the functions myInit(), myIncrement(), and myTest() CHANGE addressToFind to your known wallet address. CHANGE the words in myIncorrectPhrase to your own partially correct seed phrase. If your phrase is shorter than 24 words, delete the extra words ------------------------------------------------------------------------ */ var addressToFind = "1ArKbbf28DSmcEajJgKk7ETWvbNmUFnHmP" ; var myIncorrectPhrase = ["example", "sea", "sea", "clown", "round", "hybrid", "depend", "book", "farm", "devote", "winner", "lunch", "code", "impose", "about", "comfort", "retire", "balance", "maximum", "match", "message", "letter", "pony", "horse"]; function generateClicked() { if (confirm("press ok to generate a random phrase, press cancel to begin the recovery test iterations.")){ if (isUsingOwnEntropy()) { return; } clearDisplay(); showPending(); setTimeout(function() { setMnemonicLanguage(); var phrase = generateRandomPhrase(); if (!phrase) { return; } phraseChanged(); }, 50); } else { // divert to test function myInit(); } } var wordPosition ; var indexBip39WordList; var TemporaryArray ; var testPhrase ; var phraseLength ; var myTestTimer ; var finishedSearching; // hard coded to the english wordlist. Change if your phrase is in a different language. var Bip39WordList = WORDLISTS["english"]; function myInit(){ wordPosition = 0; indexBip39WordList = 0; finishedSearching = false; phraseLength = myIncorrectPhrase.length ; myTest(); } function myIncrement() { indexBip39WordList++ if (indexBip39WordList >= 2048) { indexBip39WordList = 0; wordPosition++; if (wordPosition >= phraseLength) { finishedSearching = true; alert("Search failed. The seed phrase associated with your address was not found."); } } } function myTest() { while (!finishedSearching) { // by value array copy TemporaryArray = myIncorrectPhrase.slice(); // get the next word in the BIP39 word list TemporaryArray[wordPosition] = Bip39WordList[indexBip39WordList]; // combine all the words into one string testPhrase = TemporaryArray.join(" "); // increment the pointer(s) for the next iteration myIncrement(); // if test phrase has a valid checksum if (mnemonic.check(testPhrase)) { // put the test phrase into the textbox on the webpage DOM.phrase.val(testPhrase); // call the function which updates the webpage after a new phrase is input phraseChanged(); // set an event timer to call this function myTest() again in 100 milliseconds // this gives the webpage time to update after the phrase change. myTestTimer = setTimeout(function(){ myTest() }, 100); // exit the function and let the web page update break; } } } /* ------------------------------------------------------------------------ * End of code to copy/paste over function generateClicked() ------------------------------------------------------------------------ */