/* ------------------------------------------------------------------------ For Passphrase recovery 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 TokenLists to your own token lists. Add or delete as many array elements as you need to. In javascript strings, special character need a backslash in front. ------------------------------------------------------------------------ */ var addressToFind = "1ArKbbf28DSmcEajJgKk7ETWvbNmUFnHmP" ; var TokenLists = new Array ( ); TokenLists[0] = new Array ("Brown", "brown", "BROWN"); TokenLists[1] = new Array ("\-", "\.", "\_", ""); TokenLists[2] = new Array ("Cow", "cow", "COW"); TokenLists[3] = new Array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); TokenLists[4] = new Array ("\@", "\%", "\^", "\'", "\)", "\(", "\&", "\*", "\$", "\#"); // TokenLists[5] = new Array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); // TokenLists[6] = new Array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); // TokenLists[7] = new Array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); // TokenLists[8] = new Array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); // TokenLists[9] = new Array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); var myTestTimer ; var finishedSearching; var testPassphrase ; var TokenListsIndex = new Array () ; 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(); } } function myInit(){ var i ; finishedSearching = false; for (i = 0; i < TokenLists.length ; i++) { TokenListsIndex[i] = 0 ; } myTest(); } function myIncrement() { var i ; for (i = 0; i <= TokenLists.length ; i++) { if (i == TokenLists.length) { finishedSearching = true; alert("Finished: None of the token combinations produced your wallet address"); break; } TokenListsIndex[i]++; if (TokenListsIndex[i] == TokenLists[i].length) { TokenListsIndex[i] = 0 ; } else { break; } } } function myTest() { var i; while (!finishedSearching) { // compose the test passphrase from tokens testPassphrase = ""; for (i = 0; i < TokenLists.length ; i++) { testPassphrase = testPassphrase + TokenLists[i][TokenListsIndex[i]]; } // increment the pointer(s) for the next iteration myIncrement(); // put the test passphrase into the textbox on the webpage DOM.passphrase.val(testPassphrase); // 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 200 milliseconds // this gives the webpage time to update after the phrase change. myTestTimer = setTimeout(function(){ myTest() }, 200); // exit the function and let the web page update break; } } /* ------------------------------------------------------------------------ * End of code to copy/paste over function generateClicked() ------------------------------------------------------------------------ */