Skip to content

Instantly share code, notes, and snippets.

@a-sync
Last active May 10, 2024 07:29
Show Gist options
  • Save a-sync/6638f2bf067b91c38ea76aa1903c196b to your computer and use it in GitHub Desktop.
Save a-sync/6638f2bf067b91c38ea76aa1903c196b to your computer and use it in GitHub Desktop.
batch obfuscator / deobfuscator
@echo off & setlocal
if "%~1"=="" exit /b
if /i "%~x1" neq ".bat" if /i "%~x1" neq ".cmd" exit /b
<"%~1" ((for /l %%N in (1 1 8) do pause)>nul&findstr "^">"%~n1__%~x1")
@echo off
if "%~1"=="" exit /b
if /i "%~x1" neq ".bat" if /i "%~x1" neq ".cmd" exit /b
for /f %%i in ("certutil.exe") do if not exist "%%~$path:i" (
echo CertUtil.exe not found.
pause
exit /b
)
>"temp.~b64" echo(//4mY2xzDQo=
certutil.exe -f -decode "temp.~b64" "%~n1_%~x1"
del "temp.~b64"
copy "%~n1_%~x1" /b + "%~1" /b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment