A little brute force engine for BlitzPlus. Unfortunately B+ can't handle numbers bigger than ~2 000 000 000 so there may not be that many candidate possibilities either.
This example searches for up to 5 lettered candidates with symbols "abcdefghijklmnopqrstuvwõäöüxyABCDEFGHIJKLMNOPQRSTUVWÕÄÖÜXY0123456789" in it. My 1.6GHz processor tries about 60 000 - 100 000 candidates per second
Example:
Engine:
This example searches for up to 5 lettered candidates with symbols "abcdefghijklmnopqrstuvwõäöüxyABCDEFGHIJKLMNOPQRSTUVWÕÄÖÜXY0123456789" in it. My 1.6GHz processor tries about 60 000 - 100 000 candidates per second
Example:
result$ = "hElLo" ; from 1 to 5 letters For l% = 1 To 5 brute% = StartBruteforce%(l%, "abcdefghijklmnopqrstuvwõäöüxyABCDEFGHIJKLMNOPQRSTUVWÕÄÖÜXY0123456789") total# = BruteforceTotal(brute%) Notify "Starting bruteforce with " + Int(total#) + " canditates!" ; trie all possible candidates with l% symbols in it For i = 1 To total# BruteforceNext%(brute%) value$ = BruteforceCurrentValue$(brute%) If value$ = result$ Then RuntimeError "FOUND -> " + value$ Next Next
Engine:
Function StartBruteforce%(count%, letters$ = "") Local brute% = CreateBank(2 + 4 + Len(letters$)) PokeShort(brute%, 0, count%) PokeInt(brute%, 2, 0) For i% = 1 To Len(letters$) PokeByte(brute%, 6 + i% - 1, Asc(Mid$(letters$, i%, 1))) Next Return brute% End Function Function BruteforceNext%(brute%) PokeInt(brute%, 2, PeekInt(brute%, 2) + 1) End Function Function BruteforceCurrentIndex%(brute%) Return PeekInt(brute%, 2) End Function Function BruteforceCurrentValue$(brute%) Local txt$ = "" Local length# = PeekShort(brute%, 0) Local value# = PeekInt(brute%, 2) Local letters# = BankSize(brute%) - 6 For i# = length# To 1 Step -1 txt$ = txt$ + Chr( PeekByte(brute%, 6 + (Floor((value# - 1) / letters#^(i# - 1)) Mod letters#) )) Next Return txt$ End Function Function BruteforceTotal(brute%) Return (BankSize(brute%) - 6)^PeekShort(brute%, 0) End Function