Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Rem // code cracking cheat for Mastermind Game: https://pastebin.com/UXs2Hbm2
- @Echo Off & Setlocal DisableDelayedExpansion
- Set "Chars=1234567890qwertyuiopasdfghjklzxcvbnmMNBVCXZASDFGHJKLPOIUYTREWQ'/\@#$&"
- Set "Code=%1"
- :GetCode
- IF "%Code%"=="" (Set /P "Code=Code: " & Goto :GetCode)
- Setlocal EnableDelayedExpansion
- Set "CodeLen=start"
- For /L %%I in (1,1,60) Do IF "!Code:~%%I,1!"=="" If "!CodeLen!"=="start" Set "CodeLen=%%I"
- For /L %%I in (1 1 !CodeLen!) Do Set "C#%%I=!Chars!"
- Call :Crack
- Echo/
- Echo/Cracked Code: !Cracked!
- Endlocal
- Endlocal
- exit /B
- :Crack
- Set Cracked=
- Set CTF=
- For /L %%I in (1 1 !CodeLen!) Do (
- Set /A POS=%%I-1
- For %%P in (!POS!) Do If /I "!C#%%I:~0,1!"=="!Code:~%%P,1!" (
- Set /A CTF+=1
- Set "Cracked=!Cracked!!C#%%I:~0,1!"
- ) Else (
- For /F "Delims=" %%E in ("!C#%%I:~0,1!") Do Set "C#%%I=!C#%%I:%%E=!"
- )
- )
- IF !CTF! EQU !CodeLen! (Exit /B)
- Goto :Crack
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement