ch4rl1e97

RegHide - Hide Your Files!

Aug 12th, 2016
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.70 KB | None | 0 0
  1. REM Created by gogglebot @HackForums 2016. If you make use of this, please, give credit where it's due!
  2. REM Stretch Goals:
  3. REM TODO: Functionality to delete reg values after recompiling file, though if a large file is overwritten with a smaller one the counter should stop it from running over into the previous file data so it's not an issue, just messy.
  4. REM TODO: Functionality to choose a different key in which to place the reg entries to allow multiple files to be seperately hidden.
  5. :top
  6. ::@ECHO off
  7. cls
  8. TITLE RegHide - Hide Your Files!
  9. SETLOCAL EnableDelayedExpansion
  10. GOTO Decide
  11.  
  12. :encode
  13. CLS
  14. ECHO ######################################## RegHide v1.1. ########################################
  15. ECHO ######### YOU MUST DELETE YOUR ORIGINAL FILE MANUALLY AFTER THIS PROCESS IS COMPLETE. #########
  16. ECHO ############ PLEASE PLACE YOUR FILE IN THE SAME DIRECTORY (FOLDER) AS THIS SCRIPT. ############
  17. ECHO ################### TO HIDE MULTIPLE FILES, COMPRESS THEM INTO A .ZIP FILE^^! ###################
  18. ECHO.
  19. ECHO ################################## Press Any Key To Continue ##################################
  20. pause >nul
  21. ECHO.
  22. ECHO ###############################################################################################
  23. ECHO Type the full name of your file, including it's extention (e.g. 'stuff.doc'), then press ENTER:
  24. set /p "OriginalFile="
  25. ECHO Please wait until the process is complete.
  26. ECHO This may take some time depending on the size of the file...
  27. TIMEOUT 2 /NOBREAK >nul
  28. CLS
  29. ECHO Hiding your file...
  30. ECHO Encoding...
  31. set int=0
  32. Certutil -f -encode "%OriginalFile%" encoded.encoded
  33. ECHO Done^^!
  34. ECHO.
  35. ECHO.
  36. ECHO.
  37. for /f "tokens=*" %%a in (encoded.encoded) do (
  38. ECHO  Dividing encoded file into the regisry...
  39. set /a int=!int!+1
  40. REG ADD HKCU\Secretz /v !int! /d %%a /f
  41. ECHO Part !int! done.
  42. CLS
  43. )
  44. ECHO Done^^!
  45. ECHO Writing 'count' entry...
  46. SET /a int=%int%+1
  47. REG ADD HKCU\Secretz /v count /d %int% /f
  48. ECHO Done^^!
  49. ECHO.
  50. TIMEOUT 1 /NOBREAK >nul
  51. ECHO A copy of your file is now hidden away and unreadable by human or program^^!
  52. ECHO To decode; run RegHide again and choose 'Decode' to retrieve it^^!
  53. ECHO.
  54. ECHO Press any key to exit.
  55. PAUSE >nul
  56. EXIT
  57.  
  58. :decode
  59. SET int=2
  60. ECHO -----BEGIN CERTIFICATE----- > recompiled.dat
  61. CLS
  62. ECHO ######################################## RegHide v1.1. ########################################
  63. ECHO ################################### Decode Your Hidden File ###################################
  64. ECHO.
  65. SET /p "type=Original file type/extention? (Do not include the "."): "
  66. SET /p "newname=Name for your rebuilt file: "
  67. ECHO Reading 'count'...
  68. FOR /F "skip=2 tokens=2,*" %%A IN ('reg.exe query "HKCU\Secretz" /v "count"') DO set "fin=%%B"
  69. ECHO Done^^!
  70. ECHO Beginning recompile loop...
  71. :loop
  72. ECHO Recompiling...
  73. FOR /F "skip=2 tokens=2,*" %%A IN ('reg.exe query "HKCU\Secretz" /v "%int%"') DO set "RegData=%%B"
  74. SET /a int=%int%+1
  75. IF %int% EQU %fin% goto output
  76. ECHO %RegData%>>recompiled.dat
  77. ECHO Part !int! done.
  78. GOTO loop
  79. :output
  80. ECHO -----END CERTIFICATE----- >> recompiled.dat
  81. CLS
  82. ECHO Recompile complete^^!
  83. ECHO Decoding file...
  84. TIMEOUT 1 /NOBREAK >nul
  85. Certutil -f -decode recompiled.dat %newname%.%type%
  86. del recompiled.dat
  87. CLS
  88. ECHO Done^^! Your file, %newname%.%type% has been rebuilt^^!
  89. ECHO Press any key to exit.
  90. PAUSE >nul
  91. exit
  92.  
  93. :Decide
  94. ECHO ######################################## RegHide v1.1. ########################################
  95. ECHO ########################### Hide Your Secret Files In The Registry^^! ###########################
  96. ECHO ################################ Encode Or Decode? [Press E/D] ################################
  97. CHOICE /C ED /N
  98. IF %ERRORLEVEL% EQU 2 goto decode
  99. IF %ERRORLEVEL% EQU 1 goto encode
Advertisement
Add Comment
Please, Sign In to add comment