Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SETLOCAL EnableDelayedExpansion
- :top
- REM Appologies for the messiness and non-uniform and capitalisation, it's in progress :p
- REM Warning: Currently no function to delete all the reg values, also is hardcoded to only function in HKCU\Secretz, so that's where you'll find the mess to delete :p
- goto Decide
- :encode
- ECHO YOU MUST DELETE YOUR ORIGINAL FILE MANUALLY AFTER THIS PROCESS IS COMPLETE.
- ECHO PLEASE PLACE YOUR FILE IN THE SAME DIRECTORY (FOLDER) AS THIS SCRIPT.
- pause
- set /p OriginalFile="Type the full name of your file, including it's extention (e.g. 'stuff.doc') "
- set int=0
- Certutil -encode "%OriginalFile%" encoded.encoded
- for /f "tokens=*" %%a in (encoded.encoded) do (
- set /a int=!int!+1
- REG ADD HKCU\Secretz /v !int! /d %%a
- )
- set /a int=%int%+1
- REG ADD HKCU\Secretz /v count /d %int%
- exit
- :decode
- set int=2
- echo -----BEGIN CERTIFICATE----- > recompiled.dat
- set /p "type=Original File Type? (Do not type the ".") "
- set /p "newname=Name for recompiled file? "
- FOR /F "skip=2 tokens=2,*" %%A IN ('reg.exe query "HKCU\Secretz" /v "count"') DO set "fin=%%B"
- :loop
- FOR /F "skip=2 tokens=2,*" %%A IN ('reg.exe query "HKCU\Secretz" /v "%int%"') DO set "RegData=%%B"
- set /a int=%int%+1
- if %int% EQU %fin% goto output
- echo %RegData%>>recompiled.dat
- goto loop
- :output
- echo -----END CERTIFICATE----- >> recompiled.dat
- Certutil -decode recompiled.dat %newname%.%type%
- REM For testing this next line is commented out.
- REM delete recompiled.dat
- exit
- :Decide
- set /p usr=Encode or decode? [E/D]
- if %usr% EQU E goto encode
- if %usr% EQU D goto decode
Advertisement
Add Comment
Please, Sign In to add comment