Skip to content

Commit

Permalink
Version 31
Browse files Browse the repository at this point in the history
31: Updated SppExtComObjHook.dll, Enhanced permanent activation detection

30: Updated SppExtComObjHook.dll/ReadMe.txt. Activate-Local.cmd can change RenewalInterval/ActivationInterval directly
  • Loading branch information
kkkgo committed Apr 2, 2019
1 parent bf307d2 commit 752bba1
Show file tree
Hide file tree
Showing 12 changed files with 314 additions and 347 deletions.
Binary file modified $OEM$/$$/Setup/Scripts/Win32/SppExtComObjHook.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion $OEM$/$$/Setup/Scripts/Win32/key.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if "%~1"=="" exit /b
goto :%1 || exit /b
goto :%1 2>nul || exit /b

:: Windows 10 [RS5]
:32d2fab3-e4a8-42c2-923b-4bf4fd13e6ee
Expand Down
98 changes: 32 additions & 66 deletions $OEM$/$$/Setup/Scripts/setupcomplete.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ set KMS_Port=1688
set KMS_ActivationInterval=120
set KMS_RenewalInterval=10080
set KMS_HWID=0x3A1C049600B60076
set Windows=Random
set Office2010=Random
set Office2013=Random
set Office2016=Random
set Office2019=Random

set FixedEPID=1

set "SysPath=%Windir%\System32"
if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative")
Expand All @@ -28,8 +21,9 @@ WMIC PATH %spp% WHERE LicenseStatus=1 GET Name 2>nul | findstr /i "Windows" >nul

set "_tempdir=%SystemRoot%\Temp"
set "_workdir=%~dp0"
if "%_workdir:~-1%"=="\" set "_workdir=%_workdir:~0,-1%"
set xOS=x64
if /i %PROCESSOR_ARCHITECTURE%==x86 (if "%PROCESSOR_ARCHITEW6432%"=="" set xOS=Win32)
if /i "%PROCESSOR_ARCHITECTURE%"=="x86" (if "%PROCESSOR_ARCHITEW6432%"=="" set xOS=Win32)
setlocal EnableExtensions EnableDelayedExpansion
set "IFEO=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"
set "OSPP=HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform"
Expand Down Expand Up @@ -73,8 +67,10 @@ SET EditionID=%EditionWMI%
:Main
call :StopService sppsvc
if %OsppHook% NEQ 0 call :StopService osppsvc
if exist "%SystemRoot%\system32\SppExtComObjPatcher.*" del /f /q "%SystemRoot%\system32\SppExtComObjPatcher.*" >nul 2>&1
copy /y "!_workdir!\!xOS!\SppExtComObjHook.dll" "%SystemRoot%\system32" >nul 2>&1
for %%# in (SppExtComObjHookAvrf.dll,SppExtComObjHook.dll,SppExtComObjPatcher.dll,SppExtComObjPatcher.exe) do (
if exist "%SystemRoot%\system32\%%#" del /f /q "%SystemRoot%\system32\%%#" >nul 2>&1
)
copy /y "!_workdir!\!xOS!\SppExtComObjHook.dll" "%SystemRoot%\system32" >nul 2>&1 || exit /b
if %OSType% EQU Win8 call :CreateIFEOEntry SppExtComObj.exe
if %OSType% EQU Win7 if %SppHook% NEQ 0 call :CreateIFEOEntry sppsvc.exe
call :CreateIFEOEntry osppsvc.exe
Expand All @@ -83,12 +79,12 @@ if not defined _C2R reg query HKLM\SOFTWARE\WOW6432Node\Microsoft\Office\ClickTo
for %%A in (14,15,16,19) do call :officeLoc %%A
call :SPP
call :OSPP
if %FixedEPID%==1 call :ePID
if %winbuild% GEQ 9200 (
schtasks /query /tn "\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger" 1>nul 2>nul || schtasks /create /tn "\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger" /xml "%~dp0Win32\SvcTrigger.xml" /f >nul 2>&1
)
attrib -R -A -S -H *.*
if exist "!_tempdir!\*chk.txt" del /f /q "!_tempdir!\*chk.txt"
if exist "!_tempdir!\slmgr.vbs" del /f /q "!_tempdir!\slmgr.vbs"
exit /b

:StopService
Expand All @@ -97,23 +93,19 @@ sc query %1 | find /i "STOPPED" >nul || sc stop %1 >nul 2>&1
goto :eof

:CreateIFEOEntry
reg add "%IFEO%\%1" /f /v Debugger /t REG_SZ /d "rundll32.exe SppExtComObjHook.dll,PatcherMain" >nul 2>&1
reg delete "%IFEO%\%1" /f /v Debugger >nul 2>&1
reg add "%IFEO%\%1" /f /v VerifierDlls /t REG_SZ /d "SppExtComObjHook.dll" >nul 2>&1
reg add "%IFEO%\%1" /f /v GlobalFlag /t REG_DWORD /d 256 >nul 2>&1
reg add "%IFEO%\%1" /f /v KMS_Emulation /t REG_DWORD /d %KMS_Emulation% >nul 2>&1
reg add "%IFEO%\%1" /f /v KMS_ActivationInterval /t REG_DWORD /d %KMS_ActivationInterval% >nul 2>&1
reg add "%IFEO%\%1" /f /v KMS_RenewalInterval /t REG_DWORD /d %KMS_RenewalInterval% >nul 2>&1
if /i %1 NEQ osppsvc.exe (
reg add "%IFEO%\%1" /f /v Windows /t REG_SZ /d "%Windows%" >nul 2>&1
if %winbuild% GEQ 9200 for %%A in (2013,2016,2019) do reg add "%IFEO%\%1" /f /v Office%%A /t REG_SZ /d "!Office%%A!" >nul 2>&1
if /i %1 EQU SppExtComObj.exe if %winbuild% GEQ 9600 (
reg add "%IFEO%\%1" /f /v KMS_HWID /t REG_QWORD /d "%KMS_HWID%" >nul 2>&1
)
if /i %1 EQU osppsvc.exe (
reg add "%IFEO%\%1" /f /v Office2010 /t REG_SZ /d "%Office2010%" >nul 2>&1
if %winbuild% LSS 9200 for %%A in (2013,2016,2019) do reg add "%IFEO%\%1" /f /v Office%%A /t REG_SZ /d "!Office%%A!" >nul 2>&1
reg add "%OSPP%" /f /v KeyManagementServiceName /t REG_SZ /d %KMS_IP% >nul 2>&1
reg add "%OSPP%" /f /v KeyManagementServicePort /t REG_SZ /d %KMS_Port% >nul 2>&1
)
if /i %1 EQU SppExtComObj.exe if %winbuild% GEQ 9600 (
reg add "%IFEO%\%1" /f /v KMS_HWID /t REG_QWORD /d "%KMS_HWID%" >nul 2>&1
)
goto :eof

:SPP
Expand Down Expand Up @@ -184,8 +176,26 @@ call :winchk
exit /b

:winchk
wmic path %spp% where (LicenseStatus='1' and Description like '%%KMSCLIENT%%') get Name 2>nul | findstr /i "Windows" >nul 2>&1 && (exit /b)
wmic path %spp% where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name 2>nul | findstr /i "Windows" >nul 2>&1 && (set WinPerm=1&exit /b)
if not defined tok (if %winbuild% GEQ 9200 (set "tok=4") else (set "tok=7"))
if not defined wApp set wApp=55c92734-d682-4d71-983e-d6ec3f16059f
wmic path %spp% where (LicenseStatus='1' and Description like '%%KMSCLIENT%%') get Name 2>nul | findstr /i "Windows" 1>nul && (exit /b)
echo.
wmic path %spp% where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name 2>nul | findstr /i "Windows" 1>nul && (
set WinPerm=1
)
if not defined WinPerm (
wmic path %spp% where "ApplicationID='%wApp%' and LicenseStatus='1'" get Name 2>nul | findstr /i "Windows" 1>nul && (
for /f "tokens=%tok% delims=, " %%G in ('"wmic path %spp% where (ApplicationID='%wApp%' and LicenseStatus='1') get Description /VALUE"') do set "channel=%%G"
for %%A in (VOLUME_MAK, RETAIL, OEM_DM, OEM_SLP, OEM_COA, OEM_COA_SLP, OEM_COA_NSLP, OEM_NONSLP, OEM) do if /i "%%A"=="!channel!" set WinPerm=1
)
)
if not defined WinPerm (
copy /y %Windir%\System32\slmgr.vbs "!_tempdir!\slmgr.vbs" 1>nul
cscript //nologo "!_tempdir!\slmgr.vbs" /xpr 2>nul | findstr /i "permanently" 1>nul && set WinPerm=1
)
if defined WinPerm (
exit /b
)
call :insKey %app%
exit /b

Expand Down Expand Up @@ -416,47 +426,3 @@ wmic path %spp% where ID='%1' call ClearKeyManagementServicePort >nul 2>&1
wmic path %spp% where ID='%1' call Activate >nul 2>&1
if /i %sps% EQU SoftwareLicensingService wmic path %sps% where version='%ver%' call RefreshLicenseStatus >nul 2>&1
exit /b

:ePID
set "IFEO=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"
for %%A in (WINEPID,O14EPID,O15EPID,O16EPID,O19EPID,WINRAND,O14RAND,O15RAND,O16RAND,O19RAND) do set %%A=0
if %winbuild% LSS 9200 (
set "winkey=sppsvc.exe"
set "o15key=osppsvc.exe"
set "o14key=osppsvc.exe"
set "o15svc=OfficeSoftwareProtectionProduct"
set "o14svc=OfficeSoftwareProtectionProduct"
) else (
set "winkey=SppExtComObj.exe"
set "o15key=SppExtComObj.exe"
set "o14key=osppsvc.exe"
set "o15svc=SoftwareLicensingProduct"
set "o14svc=OfficeSoftwareProtectionProduct"
)
reg query "%IFEO%\%winkey%" /v Windows 2>nul | findstr /i Random 1>nul && set WINRAND=1
reg query "%IFEO%\%o14key%" /v Office2010 2>nul | findstr /i Random 1>nul && set O14RAND=1
reg query "%IFEO%\%o15key%" /v Office2013 2>nul | findstr /i Random 1>nul && set O15RAND=1
reg query "%IFEO%\%o15key%" /v Office2016 2>nul | findstr /i Random 1>nul && set O16RAND=1
reg query "%IFEO%\%o15key%" /v Office2019 2>nul | findstr /i Random 1>nul && set O19RAND=1

if defined WinVL if not defined WinPerm if %WINRAND% equ 1 (
for /f "tokens=2 delims==" %%A in ('"wmic path SoftwareLicensingProduct where (Description like '%%KMSCLIENT%%' AND Name like 'Windows%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" 2^>nul') do set "WINEPID=%%A"
echo !WINEPID!| findstr /i "\-" 1>nul && (reg add "%IFEO%\%winkey%" /f /v Windows /t REG_SZ /d "!WINEPID!" 1>nul 2>nul)
)
if %loc_off19% equ 1 if %O19RAND% equ 1 (
for /f "tokens=2 delims==" %%A in ('"wmic path %o15svc% where (Name like '%%KMS_Client_AE%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" 2^>nul') do set "O19EPID=%%A"
echo !O19EPID!| findstr /i "\-" 1>nul && (reg add "%IFEO%\%o15key%" /f /v Office2019 /t REG_SZ /d "!O19EPID!" 1>nul 2>nul)
)
if %loc_off16% equ 1 if %O16RAND% equ 1 (
for /f "tokens=2 delims==" %%A in ('"wmic path %o15svc% where (Description like '%%KMSCLIENT%%' AND Name like 'Office 16%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" 2^>nul') do set "O16EPID=%%A"
echo !O16EPID!| findstr /i "\-" 1>nul && (reg add "%IFEO%\%o15key%" /f /v Office2016 /t REG_SZ /d "!O16EPID!" 1>nul 2>nul)
)
if %loc_off15% equ 1 if %O15RAND% equ 1 (
for /f "tokens=2 delims==" %%A in ('"wmic path %o15svc% where (Description like '%%KMSCLIENT%%' AND Name like 'Office 15%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" 2^>nul') do set "O15EPID=%%A"
echo !O15EPID!| findstr /i "\-" 1>nul && (reg add "%IFEO%\%o15key%" /f /v Office2013 /t REG_SZ /d "!O15EPID!" 1>nul 2>nul)
)
if %loc_off14% equ 1 if %O14RAND% equ 1 (
for /f "tokens=2 delims==" %%A in ('"wmic path %o14svc% where (Description like '%%KMSCLIENT%%' AND Name like 'Office 14%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" 2^>nul') do set "O14EPID=%%A"
echo !O14EPID!| findstr /i "\-" 1>nul && (reg add "%IFEO%\%o14key%" /f /v Office2010 /t REG_SZ /d "!O14EPID!" 1>nul 2>nul)
)
exit /b
Binary file modified $OEM$/$$/Setup/Scripts/x64/SppExtComObjHook.dll
Binary file not shown.
Loading

0 comments on commit 752bba1

Please sign in to comment.