Jump to content

Disable XP SFC/WFP (Works With SP3)


Recommended Posts

Normal process usually entails hex editing sfc_os.dll. I am testing SP3 RC1 and I could not find anyone who had hacked it yet. Searching the net I found a guy who figured out a way to make XP think it was in safe mode thus SFC/WMP is disabled. The cool thing about this hack is no matter what previous or future version you are running WFP can be disabled in the same manner. Using the hex editor method the values constantly change. He also found out a way to enable the security tab when your machine is not a member of a domain.

FYI just in case:

rshx32.dll = Security tab

sfc_os.dll = WFP

Credit goes to Neowinian on neowin.net forums for the solution:

Here's how to make the Windows XP file system think it's in safe mode. This will disable Windows File Protection, and also add the Security tab when you right-click on a file in Explorer and select Properties.

Step 0: XP ships with a simple hex editor called DEBUG.EXE that is required for this procedure. If you deleted it, put it back in the windows\system32 directory -- you can remove it afterwards if you wish.

Step 1: Click Start>Run, type in SERVICES.MSC and press the <enter> key. Find the entry labeled Cryptographic Services and double-click it. Change the startup type to Disabled and click Apply, then click the Stop button, and then click OK. (Note: if you already had Cryptographic Services disabled, omit this step as well as step 8.)

Step 2: Open a CMD.EXE Command Prompt window and type the following commands:

cd \windows\system32

ren rshx32.dll rshx32.old

ren sfc_os.dll sfc_os.old

You will probably receive warning messages from Windows File Protection after each REN command. Make sure to select the options to ignore the warning and allow the files to be renamed.

Step 3: Type the following commands:

cd \

del rshx32.dll /s

del sfc_os.dll /s

cd \windows\system32

copy rshx32.old rshx32.dll

copy sfc_os.old sfc_os.dll

IMPORTANT!!! You MUST rename the files in Step 2 before you can copy them in Step 3, or this procedure will not work!

Step 4: Type the following command:

DEBUG rshx32.dll

You'll now have a minus-sign as a prompt. Type the following command:

S 100 8000 74 00 5C 00 4F

DEBUG will return a line of the form:

0ADE:0AC0

The four-character letter-number combination after the colon is what you must enter in the command below. Now type the following three commands:

E 0AC0 74 00 00 00 4F (use the value returned to you above and not 0AC0!!!)

W

Q

Step 5: Type the following command:

DEBUG sfc_os.dll

You'll now have a minus-sign as a prompt. Type the following command:

S 100 8000 74 00 5C 00 4F

DEBUG will return a line of the form:

0ADE:0AC0

The four-character letter-number combination after the colon is what you must enter in the command below. Now type the following three commands:

E 0AC0 74 00 00 00 4F (use the value returned to you above and not 0AC0!!!)

W

Q

Step 6: Type the following commands:

copy rshx32.dll dllcache

copy sfc_os.dll dllcache

Step 7: Close the Command Prompt window, open Regedit, and go to the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot

Create a new DWORD value called OptionValue and give it a value of 1. Close Regedit.

Step 8: Run the SERVICES.MSC program, select Cryptographic Services, change the startup type to Manual, and click Apply. Do not start the service! (Note: omit this step if Cryptographic Services was disabled before you began this procedure.)

Step 9: Reboot your system.

That's it! You will now have the security tab at all times, and Windows File Protection will be disabled. If you would like to remove the tab and re-enable Windows File Protection, use Regedit to change OptionValue to 0, and then reboot your system. The method used to patch RSHX32.DLL and SFC_OS.DLL should work on any version of the file, including future versions issued in upcoming service packs or hotfixes.

Please note that if you apply these patches, they will take precedence over safe mode. This means that you must first set OptionValue to 1 in the registry before you boot into safe mode in order to see the security tab and to have Windows File Protection disabled.

Edited by snooz
Link to comment
Share on other sites


For those who were using my patched SFC_OS.DLL (WFP disabled permanently without dealing with the registry) just post the latest SFC_OS.DLL from SP3 and I'll patch it.

I'm curious to see how Microsoft did try to avoid us from disabling it this time :lol:

Link to comment
Share on other sites

This is the Internet's word of mouth... a very dangerous thing.

Here is the original (?) article about getting the Security tab appear in XP home. Notice it suggests naming it OptionValuf to differ from the original.

Rshx32.dll is patched... but what about the others? Are you ready to patch your whole OS? Not to mention that I still fail to comprehend how this dll relates to SFC... But maybe that's just me. Or THAT is the method that the author has discovered. But I wouldn't risk to patch it on a live system (while I don't have that problem with sfc_os.dll).

I haven't tried this tweak and don't recommend it to anyone. All I know is, last time I created an OptionValue in the registry (I like to tinker with Regmon a lot, and I saw many applications were trying to read it) I lost my soundcard and other drivers. I believe this is the value that gets set when you choose which flavor of Safe Mode you want - with networking, etc... And by the way, many drivers don't start in safe mode.

So... do you really want to be constantly in safe mode?

GL

Link to comment
Share on other sites

To back up my claims, here's a list of files in system32 folder that query the OptionValue entry:

advapi32.dll

credui.dll

cscdll.dll

dhcpmon.dll

filemgmt.dll

kernel32.dll

localsec.dll

lsasrv.dll

msgina.dll

msv1_0.dll

netcfgx.dll

netid.dll

ntdll.dll

ntkrnlpa.exe

ntoskrnl.exe

ntshrui.dll

pautoenr.dll

rshx32.dll

samsrv.dll

services.exe

sfc_os.dll

smlogcfg.dll

smss.exe

syssetup.dll

winlogon.exe

Found through searching unicode strings. There may be others, this is a heavily nLited system.

It seems this is an (undocumented by Microsoft?) way of determining if we're in safe mode or not.

GL

Link to comment
Share on other sites

Since I was the "Neowinian" who originally posted the above patches, I'm wondering why the OP didn't put a link to my post (don't care about credit per se, but this seems like "ripping").

Anyway, to GrofLuigi...note that this patch moves "OptionValue" in the two DLLs to

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot

from

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Option

and effectively gives the user control over operation of the Security tab and WFP. By setting OptionValue to 1, you see the Security tab and WFP is disabled. By setting it to 0, WFP is enabled and the Security tab disappears. The possible downside is that the patched OptionValue now takes precedence over Safe Mode for these two functions -- which for my purposes is no downside whatsoever, but it might be a problem for others. I also documented this possible downside in the patch posted above.

All other DLLs will respect the OptionValue that XP puts in

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Option

when it loads in Safe Mode.

Edited by mhc
Link to comment
Share on other sites

Since I was the "Neowinian" who originally posted the above patches, I'm wondering why the OP didn't put a link to my post (don't care about credit per se, but this seems like "ripping").

Some boards don't like linking to other sites. I mentioned your name and the board that is not "ripping". Shows a lot about you since I praised your work and gave you credit.

Link to comment
Share on other sites

This has been documented by Microsoft. I've known about this since xp came out but saw no need to do this. Fooling the operating system to think it's in safe mode could cause unforseen problems that i would rather avoid. This is the poor man's hex editing

-gosh

Link to comment
Share on other sites

Wow. Where do I begin. Oh yeah, I know. Have you ever looked at the hex code in RSHX32.DLL or SFC_OS.DLL? I have, and what I did above is a FAR better way to hack these programs than, for example, finding the mysterious "-63" check in SFC_OS.DLL. Are you aware that SFC_OS.DLL does a simple check for safe mode just like it does a simple check for -63? And that RSHX32.DLL checks for safe mode for the sole reason to determine whether to display the Security tab in XP Home? And that for these reasons, the above patches affect no other operation in XP?

Geez, these patches aren't like eliminating core XP components that can break the most popular programs sold in the marketplace...it's just altering simple checks in two DLLs!

I would be reacting differently if you actually TRIED the hacks and found problems with them. Right now you're shooting from the hip with statements that IMO have no basis in reality.

Oh, FWIW, what I did above is hex editing. And what you call hex editing is also fooling the operating system as much as what I did above. The difference is that the above way is a better solution, period, than attempting to hack actual code since it is version-independent. And since the registry value set by NTOSKRNL.EXE to signify safe mode is checked by so many DLLs when they are loaded, that value will not change at this point in XP, so hacking that location in SFC-OS.DLL and RSHX32.DLL will remain valid for the remainder of XP's life.

Edited by mhc
Link to comment
Share on other sites

sfc_os.dll: Change the xor eax,eax inc eax to nop nop nop at offset EC95, EC96, EC97:

33C041 to 909090

Fyyre,

I don't know where you got that but it's not good.

"xor eax, eax" and "inc eax" should be 33C040 not 33C041

And at offset EC95 there is no "xor eax, eax" but "xor ecx, ecx" which is 33C9

-----------------------

To permanently disable Windows File Protection - Windows XP Pro SP3 (5.1.2600.3264)

Without using the registry.

At offset EC84, replace 83F89D7508 by 3BC0EB3290

cmp eax, FFFFFF9D

jne 76C6F891

by

cmp eax, eax

jmp 76C6F8BA

:sneaky:

sfc_os.zip

Edited by jdoe
Link to comment
Share on other sites

>I don't know where you got that but it's not good.

Hi,

I have version 3244. Since there is no such cmp eax, 0xFFFFF9D in its sfc_os.dll - that explains a lot =o

I'm using the wu registry patch from connect.microsoft.com, you? (in regards to SP build number...)

Link to comment
Share on other sites

Please read your post again...my name was never mentioned, and that, combined with the lack of a link, was why I reacted as I did. So for the record, here is the link to my post on Neowin which was "quoted" above.

http://www.neowin.net/forum/index.php?showtopic=600928

Wrong

Credit goes to Neowinian on neowin.net forums for the solution:

What I find ironic is you are taking credit for the solution when as someone else pointed out that Microsoft released it. Your accusing me of not giving credit when you are the one guilty of it.

I appreciate the solution none the less.

Edited by snooz
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...