-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobfuscate.bat
More file actions
56 lines (45 loc) · 1.21 KB
/
Copy pathobfuscate.bat
File metadata and controls
56 lines (45 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@echo off
setlocal
title Heavy Python Obfuscator
set "OBFUSCATOR=%~dp0obfuscator.py"
python --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Python is not installed or not added to PATH.
echo Please install Python 3.9+ and ensure it's in your system PATH.
pause
exit /b
)
if not exist "%OBFUSCATOR%" (
echo [ERROR] Could not find 'obfuscator.py' next to this script.
echo Please ensure obfuscator.py is in the same folder.
pause
exit /b
)
set "INPUT_FILE=%~1"
if "%INPUT_FILE%"=="" (
echo No file dragged and dropped.
set /p "INPUT_FILE=Enter the path to the Python file to obfuscate: "
)
set "INPUT_FILE=%INPUT_FILE:"=%"
if not exist "%INPUT_FILE%" (
echo.
echo [ERROR] File not found: %INPUT_FILE%
echo Please check the path and try again.
pause
exit /b
)
for %%i in ("%INPUT_FILE%") do (
set "FILE_DIR=%%~di%%~pi"
set "FILE_NAME=%%~ni"
set "FILE_EXT=%%~xi"
)
set "OUTPUT_FILE=%FILE_DIR%%FILE_NAME%_obfuscated%FILE_EXT%"
echo.
echo =========================================
echo Obfuscating: %INPUT_FILE%
echo Output to: %OUTPUT_FILE%
echo =========================================
echo.
python "%OBFUSCATOR%" "%INPUT_FILE%" "%OUTPUT_FILE%"
echo.
pause