crashdemons Posted January 2, 2008 Posted January 2, 2008 (edited) I've had alot of requests to find some way to remove the protected zone files in C:\program files\MSN Gaming Zone\Windows I am aware that Microsoft establishes these as Windows system files, but they are not critical to anything besides the microsoft online board/card games and the MSN Gaming Zone network itself. As I say below and is obvious: This may be unsafe and really shouldn't be attempted. To do this you must: 1. Disable the locations of two I386 folders (rename I386 to I386.disableddir) 2. Delete the MSN Gaming Zone files from the DLLCache hidden-system directory in system32 3. Delete MSN gaming Zone files from C:\program files\MSN Gaming Zone\Windows 4. wait for Windows File Protection alerts to open (Hit Cancel and Yes to permanently remove the MSN gamign zone files) 5. Enable I386 folders again (rename I386.disableddir to I386, Note: not necessary but suggested) Note: This will remove the files but not unlock or remove the MSN Gaming Zone folders. Warning: Deleting system files is neither suggested nor safe, do not attempt this unless you know what you are doing. So I made a simple script to do (Most) of this automatically. It is suggested you close any MSN gaming Zone programs and try to backup and delete any unprotected files that exist in C:\program files\MSN Gaming Zone\Windows before attempting. PS: I manually included some (un)official UDF's just to keep the program size minimal. This worked for me but if it doesnt for you, you may have to use attrib and make sure there is no 'System' Attribute set to MSN Gaming Zone folders in question. expandcollapse popup;#include <Array.au3> Opt("RunErrorsFatal",0) Func _ArrayAdd(ByRef $avArray, $sValue) If IsArray($avArray) Then ReDim $avArray[UBound($avArray) + 1] $avArray[UBound($avArray) - 1] = $sValue SetError(0) Return 1 Else SetError(1) Return 0 EndIf EndFunc ;==>_ArrayAdd Func _RunDOS($sCommand) Return RunWait(@ComSpec & " /C " & $sCommand, "", @SW_HIDE) EndFunc ;==>_RunDOS Func _FolderExists($path) If StringRight($path,1)=='\' Then Else $path&='\' EndIf If FileExists($path)==1 Then Return 1 ; folder exists If FileExists(StringTrimRight($path,1))==1 Then Return -1 ; File with that name exists but not directory Return 0 ; no folder or file by that name exists EndFunc Func _Dir($path='.\',$match='*',$folders_only=0) ;MsgBox(0,'',$ml) Dim $path,$folders_only, $match If StringRight($path,1)=='\' Then Else $path&='\' EndIf $path=StringReplace($path,'/','\') Local $a[1] $a[0]=0 $hS=FileFindFirstFile($path&$match) While 1 $file = FileFindNextFile($hS) If @error Then ExitLoop $fold=_FolderExists($path&$file) If $fold==1 Then $file&='\' Switch $folders_only Case 0 _ArrayAdd($a,$file) $a[0]+=1 Case Else If $fold=$folders_only Then _ArrayAdd($a,$file) $a[0]+=1 EndIf EndSwitch WEnd FileClose($hS) ;_ArrayResetZero($a) ;If $a[0]<=1 Then Return 0 ;If $a[0]>1 Then Return $a ;Return -1 Return $a EndFunc Func _RedMem() $o=@OSVersion if $o=="WIN_95" Then Return 0 DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1) EndFunc #cs Func _ProcessKillAll($strProcessKill) ;Note: use a dummy error handeler or this WILL kill autoit local $objWMIService, $objProcess, $colProcess, $strComputer $strComputer = ".";replace with remote computer $objWMIService = Objget("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & $strComputer & "\root\cimv2") ; enable the SeDebugPrivilege privilege $objWMIService.Security_.privileges.addasstring("sedebugprivilege", true) $colProcess = $objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = " & "'" & $strProcessKill & "'") For $objProcess in $colProcess If IsObj($objProcess) Then $objProcess.Terminate(1) Next EndFunc #ce Func COMKillErrors() $_ERROR_OBJECT.clear EndFunc Func L($t='') Dim $t ConsoleWrite(@CRLF&$t) EndFunc Func _DisableI386() L('Disabling I386 System file caches') _RunDos("ren C:\$WIN_NT$.~LS\I386 I386.disableddir") _RunDos("ren C:\Windows\I386 I386.disableddir") EndFunc Func _EnableI386() L('Enabling I386 System file caches') _RunDos("ren C:\$WIN_NT$.~LS\I386.disableddir I386") _RunDos("ren C:\Windows\I386.disableddir I386") EndFunc _RedMem() _DisableI386() $path='C:\progra~1\MSN Gaming Zone\Windows\' $dllc='C:\WINDOWS\system32\dllcache\' $cach1='C:\$WIN_NT$.~LS\I386.disableddir' $cach2='C:\Windows\I386.disableddir' ;$exes=_Dir($path,'*.exe') ;L('Killing MSN Game Zone processes') ;ObjEvent("AutoIt.Error","COMKillErrors") ;For $i=1 To Ubound($exes)-1 ; _ProcessKillAll($exes[$i]) ;Next ;ObjEvent("AutoIt.Error","") ;$exes='' L('Unlocking MSN Game Zone file attributes') FileSetAttrib($path&"*.*","-RASH") Sleep(200) $prot=_Dir($path) ;remaining protected dllcache files L('Backing Up protected MSN Game Zone files in Caches') For $i=1 To Ubound($prot)-1 L(" "&$prot[$i]) FileMove($dllc&$prot[$i],$dllc&"__"&$prot[$i],1) FileMove($cach1&$prot[$i],$cach1&"__"&$prot[$i],1) FileMove($cach2&$prot[$i],$cach2&"__"&$prot[$i],1) Next L('Deleting protected MSN Game Zone files from Caches') For $i=1 To Ubound($prot)-1 L(" "&$prot[$i]) FileDelete($dllc&$prot[$i]) FileDelete($cach1&$prot[$i]) FileDelete($cach2&$prot[$i]) Next L('Deleting MSN Game Zone files from Default folder') FileDelete($path&"*.*") For $i=1 To Ubound($prot)-1 L(" "&$prot[$i]) FileDelete($path&$prot[$i]) Next L('Done - Click Cancel and Yes on any WIndows Protection notices.') _RedMem() Sleep(120000) ; wait for Windows File Protection window(s) to be canceled, re-enable I386 in two minutes _EnableI386() Additions or modifications welcome Edited January 2, 2008 by crashdemons My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now