@ECHO OFF

REM * Setup - Move to MZK Path
PUSHD "%~dp0"

SET CMDPROCESS=

CLS

TITLE Malware Zero

REM * Check - Compression
IF NOT EXIST "DB\CHECK\MZK" (
	ECHO 압축 파일을 올바르게 해제 후 실행해주세요.
	ECHO.
	ECHO Please extract the compressed file correctly before running.
	ECHO.
	PAUSE
	EXIT /B
)

REM * Setup - Path
IF DEFINED SYSTEMROOT (
	SET "PATH=%CD%;%SYSTEMROOT%\System32\wbem;%SYSTEMROOT%;%SYSTEMROOT%\System32;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\"
) ELSE (
	IF DEFINED WINDIR (
		SET "PATH=%CD%;%WINDIR%\System32\wbem;%WINDIR%;%WINDIR%\System32;%WINDIR%\System32\WindowsPowerShell\v1.0\"
	) ELSE (
		ECHO The environment variable settings are incorrect.
		ECHO.
		ECHO 환경 변수 설정이 올바르지 않습니다.
		ECHO.
		PAUSE
		EXIT /B
	)
)

DEL /F /Q /A "%TEMP%\CMDQUICKEDITDISABLE" >Nul 2>Nul

REG.EXE QUERY "HKCU\Console" -v QuickEdit >Nul 2>Nul
IF %ERRORLEVEL% EQU 0 (
	REG.EXE IMPORT REPAIR\CMD_QUICKEDIT_DISABLE.REG >Nul 2>Nul
	>"%TEMP%\CMDQUICKEDITDISABLE" ECHO 1
)

POWERSHELL.EXE -C "(Get-WmiObject WIn32_OperatingSystem).Caption"|FIND.EXE "Windows 11" >Nul 2>Nul
IF %ERRORLEVEL% EQU 0 (
	SET CMDPROCESS=1
) ELSE (
	SET CMDPROCESS=2
)

CHCP.COM >Nul 2>Nul
IF %ERRORLEVEL% EQU 0 (
	FOR /F "TOKENS=2 DELIMS=:" %%A IN ('CHCP.COM 2^>Nul') DO (
		IF %%A EQU 949 (
			IF %CMDPROCESS% EQU 1 (
				>Nul 2>Nul START "" /I /HIGH CONHOST.EXE #.BAT KOREAN
			) ELSE (
				>Nul 2>Nul START "" /I /HIGH CMD.EXE /D /C "#.BAT KOREAN"
			)
		) ELSE (
			IF %CMDPROCESS% EQU 1 (
				>Nul 2>Nul START "" /I /HIGH CONHOST.EXE #.BAT GLOBAL
			) ELSE (
				>Nul 2>Nul START "" /I /HIGH CMD.EXE /D /C "#.BAT GLOBAL"
			)
		)
	)
) ELSE (
	IF %CMDPROCESS% EQU 1 (
		>Nul 2>Nul START "" /I /HIGH CONHOST.EXE #.BAT GLOBAL
	) ELSE (
		>Nul 2>Nul START "" /I /HIGH CMD.EXE /D /C "#.BAT GLOBAL"
	)
)