Sunday, October 25, 2015

Accessing the Real System32 From 32-bit Programs

On 64-bit editions of Windows, 32-bit programs that attempt to read from or write to System32 will actually perform their operations on SysWOW64, which is also in the Windows directory. That can be a problem if you want to do something with the real System32 files from a 32-bit program, especially without the source code of that program. (Programs can opt out of the redirection by calling the Wow64DisableWow64FsRedirection function.)

For example, I recently wanted to inspect the contents of the Local Group Policy files with a hex editor, which happened to be a 32-bit application. Those files are under System32 and have no useful counterpart in SysWOW64.

The solution is to use a special pseudo-folder called Sysnative instead of System32. \Windows\Sysnative is accessible for 32-bit applications (though you won't see it in a directory listing), but is not at all navigable by or visible to 64-bit applications. Its contents are the real contents of System32, and any files under it are the authoritative versions.

No comments:

Post a Comment