2024-09-04 15:12:38 +00:00
|
|
|
@echo off
|
|
|
|
chcp 65001
|
|
|
|
net session >nul 2>&1
|
|
|
|
if %errorLevel% == 0 (
|
|
|
|
echo Administrator mode detected.
|
|
|
|
) else (
|
|
|
|
echo Please run this script in administrator mode.
|
2024-09-12 01:00:53 +00:00
|
|
|
powershell -Command "Start-Process 'wt.exe' -ArgumentList 'cmd /c cd /d \"%cd%\" && \"%~f0\" %1' -Verb runAs"
|
2024-09-04 15:12:38 +00:00
|
|
|
exit
|
|
|
|
)
|
|
|
|
|
2024-09-15 06:34:47 +00:00
|
|
|
set NAPCAT_PATCH_PACKAGE=%cd%\qqnt.json
|
2024-09-04 15:12:38 +00:00
|
|
|
set NAPCAT_LOAD_PATH=%cd%\loadNapCat.js
|
|
|
|
set NAPCAT_INJECT_PATH=%cd%\NapCatWinBootHook.dll
|
|
|
|
set NAPCAT_LAUNCHER_PATH=%cd%\NapCatWinBootMain.exe
|
|
|
|
set NAPCAT_MAIN_PATH=%cd%\napcat.mjs
|
|
|
|
:loop_read
|
|
|
|
for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do (
|
|
|
|
set RetString=%%b
|
|
|
|
goto :napcat_boot
|
|
|
|
)
|
|
|
|
|
|
|
|
:napcat_boot
|
2024-09-05 02:41:04 +00:00
|
|
|
for %%a in ("%RetString%") do (
|
2024-09-04 15:12:38 +00:00
|
|
|
set "pathWithoutUninstall=%%~dpa"
|
|
|
|
)
|
|
|
|
|
|
|
|
SET QQPath=%pathWithoutUninstall%QQ.exe
|
|
|
|
|
|
|
|
if not exist "%QQpath%" (
|
|
|
|
echo provided QQ path is invalid: %QQpath%
|
|
|
|
pause
|
|
|
|
exit /b
|
|
|
|
)
|
2024-09-05 06:03:03 +00:00
|
|
|
|
2024-09-04 15:12:38 +00:00
|
|
|
set NAPCAT_MAIN_PATH=%NAPCAT_MAIN_PATH:\=/%
|
|
|
|
echo (async () =^> {await import("file:///%NAPCAT_MAIN_PATH%")})() > %NAPCAT_LOAD_PATH%
|
|
|
|
|
2024-09-12 01:00:53 +00:00
|
|
|
"%NAPCAT_LAUNCHER_PATH%" "%QQPath%" "%NAPCAT_INJECT_PATH%" %1
|