Advertisement
cevoj35548

Stardock Fences v5.02

Jan 28th, 2024 (edited)
1,128
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.49 KB | None | 0 0
  1. <# ::
  2. @echo off & setlocal
  3. :: CHECK FOR ADMIN
  4. net file >nul 2>&1
  5. call :checkErr "Please run as admin."
  6.  
  7. :: REMOVE FENCES NATIVE IMAGE
  8. "%systemroot%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe" uninstall Fences
  9. :: DOWNLOAD DUMMY DLL (open sourced by me, check repo for code)
  10. if not exist "%systemroot%\womtrust.dll" (
  11.     curl -LR https://github.com/cevoj35/DummyWomtrust/releases/download/v1.0/womtrust.dll > "%systemroot%\womtrust.dll"
  12. )
  13. call :checkErr "Download failed. Please check your internet connection."
  14.  
  15. powershell -noprofile -nologo "iex (${%~f0} | out-string)"
  16. goto:eof
  17.  
  18. :checkErr
  19. if %errorlevel%==0 (goto :eof)
  20. echo %~1
  21. pause >nul
  22. exit /b 1
  23. ::#>
  24. <# -- LIBRARY -- #>
  25. function Expand-EnvVar($Path) {
  26.     return [System.Environment]::ExpandEnvironmentVariables($Path)
  27. }
  28. New-Alias -Name ee -Value Expand-EnvVar
  29. function Edit-FileBytes($Path, $Modifications) {
  30.     $Path = ee "$Path"
  31.     $bytes = [System.IO.File]::ReadAllBytes($Path)
  32.     foreach ($mod in $Modifications) {
  33.         if ($mod -match '(\d+)=(\d+)') {
  34.             $bytes[$matches[1]] = $matches[2]
  35.         }
  36.     }
  37.     [System.IO.File]::WriteAllBytes($Path, $bytes)
  38. }
  39. <# -- KILL PROCESSES -- #>
  40. taskkill /f /im explorer.exe 2>$null
  41. taskkill /f /im Fences.exe 2>$null
  42. $procpath = ee "%programfiles(x86)%\Stardock\Fences"
  43. Get-WmiObject Win32_Process | ForEach-Object {
  44.     $process = $_
  45.     $commandLine = $process.CommandLine
  46.  
  47.     # check if the command line contains the specific directory
  48.     if ($commandLine -and $commandLine.Contains($procpath)) {
  49.         Stop-Process -Id $process.ProcessId -Force
  50.         Write-Output "Terminated process with command line: $commandLine"
  51.     }
  52. }
  53. <# -- FILES -- #>
  54. Edit-FileBytes '%programfiles(x86)%\Stardock\Fences\DesktopDock.dll' '368=2','369=51','1064226=111'
  55. Edit-FileBytes '%programfiles(x86)%\Stardock\Fences\DesktopDock64.dll' '360=96','361=111','324723=14','1140594=111','1140596=109'
  56. Edit-FileBytes '%programfiles(x86)%\Stardock\Fences\Fences.exe' '216=73','217=198','1199085=111','1199086=109'
  57. Edit-FileBytes '%programfiles(x86)%\Stardock\Fences\SdAppServices.dll' '361=135','338549=14','339431=14'
  58. Edit-FileBytes '%programfiles(x86)%\Stardock\Fences\SdAppServices_x64.dll' '376=66','377=204','391266=14','392162=14','393058=14','393954=14','394850=14','395746=14','401944=14'
  59. Edit-FileBytes '%programfiles(x86)%\Stardock\Fences\Stardock.ApplicationServices.dll' '216=135','217=170','24251=111','24252=109'
  60.  
  61. Write-Host Complete! Please reboot.
  62. start explorer.exe
  63. pause
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement