@echo off
:: Request administrative privileges
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo off
color 0C && echo Administrator privileges are required to run this script.
echo Run this script as administrator.
echo Press 'ENTER' to continue...
pause > nul
exit /b
)
color 0A
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\FoxitPDFEditor.exe
set "file1=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\FoxitPDFEditor.exe"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file1%'); $bytes[0x012727FB] = 0x90; $bytes[0x012727FC] = 0xE9; $bytes[0x01272BA5] = 0x00; $bytes[0x01272DB4] = 0x01; $bytes[0x01277E88] = 0xB0; $bytes[0x01277E89] = 0x01; $bytes[0x01277E8A] = 0x90; $bytes[0x01D99E9F] = 0xB0; $bytes[0x01D99EA0] = 0x01; $bytes[0x01D99EA1] = 0x90; $bytes[0x06C11C0A] = 0x52; $bytes[0x06C11C0C] = 0x65; $bytes[0x06C11C0E] = 0x67; $bytes[0x06C11C10] = 0x69; $bytes[0x06C11C12] = 0x73; $bytes[0x06C11C14] = 0x74; $bytes[0x06C11C16] = 0x65; $bytes[0x06C11C18] = 0x72; $bytes[0x06C11C1A] = 0x65; $bytes[0x06C11C1C] = 0x64; [System.IO.File]::WriteAllBytes('%file1%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\phc.dll
set "file2=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\phc.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file2%'); $bytes[0x007595] = 0x00; $bytes[0x007807] = 0x00; $bytes[0x0092EB] = 0xEB; $bytes[0x0092EC] = 0x3F; $bytes[0x009338] = 0x31; $bytes[0x009339] = 0xF6; $bytes[0x00933A] = 0x43; $bytes[0x00933B] = 0x90; $bytes[0x04727C] = 0x00; $bytes[0x04727F] = 0xB0; $bytes[0x047280] = 0x0E; [System.IO.File]::WriteAllBytes('%file2%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\phc64.dll
set "file3=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\phc64.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file3%'); $bytes[0x008C67] = 0xEB; $bytes[0x00B009] = 0xEB; $bytes[0x00B00A] = 0x37; $bytes[0x00B042] = 0x40; $bytes[0x00B043] = 0xB6; $bytes[0x00B044] = 0x01; $bytes[0x00B045] = 0x90; [System.IO.File]::WriteAllBytes('%file3%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Security.fpi
set "file4=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Security.fpi"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file4%'); $bytes[0x05A7A1] = 0x00; $bytes[0x05A7A2] = 0x00; [System.IO.File]::WriteAllBytes('%file4%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\FPC_ExcelAddin_x64.dll
set "file5=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\FPC_ExcelAddin_x64.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file5%'); $bytes[0x0D8808] = 0xEB; [System.IO.File]::WriteAllBytes('%file5%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\FPC_PPTAddin_x64.dll
set "file6=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\FPC_PPTAddin_x64.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file6%'); $bytes[0x0D8368] = 0xEB; [System.IO.File]::WriteAllBytes('%file6%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\FPC_WordAddin_x64.dll
set "file7=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\FPC_WordAddin_x64.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file7%'); $bytes[0x0F40F8] = 0xEB; [System.IO.File]::WriteAllBytes('%file7%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\OutLookAddin_x64.dll
set "file8=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\OutLookAddin_x64.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file8%'); $bytes[0x0AB568] = 0xEB; [System.IO.File]::WriteAllBytes('%file8%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\ProjectAddin_x64.dll
set "file9=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\ProjectAddin_x64.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file9%'); $bytes[0x0D5018] = 0xEB; [System.IO.File]::WriteAllBytes('%file9%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\VisioAddin_x64.dll
set "file10=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x64\VisioAddin_x64.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file10%'); $bytes[0x0D2BC8] = 0xEB; [System.IO.File]::WriteAllBytes('%file10%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\FPC_ExcelAddin_x86.dll
set "file11=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\FPC_ExcelAddin_x86.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file11%'); $bytes[0x0B57DB] = 0xEB; [System.IO.File]::WriteAllBytes('%file11%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\FPC_PPTAddin_x86.dll
set "file12=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\FPC_PPTAddin_x86.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file12%'); $bytes[0x0B531B] = 0xEB; [System.IO.File]::WriteAllBytes('%file12%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\FPC_WordAddin_x86.dll
set "file13=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\FPC_WordAddin_x86.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file13%'); $bytes[0x0CE58B] = 0xEB; [System.IO.File]::WriteAllBytes('%file13%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\OutLookAddin_x86.dll
set "file14=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\OutLookAddin_x86.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file14%'); $bytes[0x08C3BB] = 0xEB; [System.IO.File]::WriteAllBytes('%file14%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\ProjectAddin_x86.dll
set "file15=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\ProjectAddin_x86.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file15%'); $bytes[0x0B211B] = 0xEB; [System.IO.File]::WriteAllBytes('%file15%', $bytes) }"
:: Patching bytes in C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\VisioAddin_x86.dll
set "file16=C:\Program Files (x86)\Foxit Software\Foxit PDF Editor\plugins\Creator\x86\VisioAddin_x86.dll"
echo Patching bytes...
powershell -command "& { $bytes = [System.IO.File]::ReadAllBytes('%file16%'); $bytes[0x0AFF2B] = 0xEB; [System.IO.File]::WriteAllBytes('%file16%', $bytes) }"
:: Stop and disable FoxitPhantomPDFUpdateService
powershell Set-Service -Name FoxitPhantomPDFUpdateService -Status stopped -StartupType disabled
echo.
@echo off
color 0A && echo Foxit PDF Pro successfully activated!
echo Press 'ENTER' to complete activation...
Pause > nul