为什么我不能从命令行从 C:\SysWOW64 复制 DLL? [英] Why can't I copy a DLL from C:\SysWOW64 from the command line?

查看:80
本文介绍了为什么我不能从命令行从 C:\SysWOW64 复制 DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我在做什么很奇怪,请不要担心.然而,正在发生的绝对是疯狂的.

I know what I'm doing is weird, please don't worry about that. What is happening, however, is absolutely insane.

如果我尝试在 Windows 7 64 位上使用 copy 从命令行从 C:\SysWOW32\ 复制 DLL 文件,我实际上最终得到C:\System32\ 中的文件.为什么会发生这种情况?

If I try to copy a DLL file from C:\SysWOW32\ from the command line using copy on Windows 7 64-bit, I actually end up getting the file that's in C:\System32\. Why is this happening?

好的 - dumpbin 能够区分 DLL 文件

C:\Users\user\Desktop>dumpbin /headers C:\Windows\System32\opengl32.dll | grep machine
            8664 machine (x64)

C:\Users\user\Desktop>dumpbin /headers C:\Windows\SysWOW64\opengl32.dll | grep machine
             14C machine (x86)
             32 bit word machine

不行 - 其他命令,如 md5sum(来自 GOW)得到错误的字节!

NOT OK - Other commands, like md5sum (from GOW) get the wrong bytes!

C:\Users\user\Desktop>md5sum C:\Windows\system32\opengl32.dll
\d1bbe227367ed791d5fcf08e132d2956 *C:\\Windows\\system32\\opengl32.dll

C:\Users\user\Desktop>md5sum C:\Windows\SysWow64\opengl32.dll
\d1bbe227367ed791d5fcf08e132d2956 *C:\\Windows\\SysWow64\\opengl32.dll

不行 - 使用命令行复制 64 位 DLL

C:\Users\user\Desktop>copy C:\Windows\System32\opengl32.dll .
        1 file(s) copied.

C:\Users\user\Desktop>dir opengl32.dll
07/13/2009  06:16 PM           791,552 opengl32.dll

C:\Users\user\Desktop>md5sum opengl32.dll
d1bbe227367ed791d5fcf08e132d2956 *opengl32.dll

C:\Users\user\Desktop>dumpbin /headers opengl32.dll | grep machine
             14C machine (x86)
             32 bit word machine

错了!为什么 32 位 DLL 会被复制?

Wrong! Why did the 32-bit DLL get copied??

确定 - 使用命令行复制 32 位 DLL

C:\Users\user\Desktop>copy C:\Windows\SysWOW64\opengl32.dll .
Overwrite .\opengl32.dll? (Yes/No/All): yes
        1 file(s) copied.

C:\Users\user\Desktop>dir opengl32.dll
07/13/2009  06:16 PM           791,552 opengl32.dll

C:\Users\user\Desktop>md5sum C:\Windows\System32\opengl32.dll
\d1bbe227367ed791d5fcf08e132d2956 *C:\\Windows\\System32\\opengl32.dll

C:\Users\user\Desktop>dumpbin /headers opengl32.dll | grep machine
             14C machine (x86)
             32 bit word machine

确定 - 使用资源管理器复制 64 位 DLL

<control-drag System32\opengl32.dll to desktop>

C:\Users\user\Desktop>dir opengl32.dll
07/13/2009  06:41 PM         1,039,872 opengl32.dll

C:\Users\user\Desktop>md5sum opengl32.dll
585fed4cdb8034b8b58aeb8008255817 *opengl32.dll

C:\Users\user\Desktop>dumpbin /headers opengl32.dll | grep machine
            8664 machine (x64)

确定 - 使用资源管理器复制 32 位 DLL

<control-drag SysWow64\opengl32.dll to desktop>

C:\Users\user\Desktop>dir opengl32.dll
07/13/2009  06:16 PM           791,552 opengl32.dll

C:\Users\user\Desktop>md5sum opengl32.dll
d1bbe227367ed791d5fcf08e132d2956 *opengl32.dll

C:\Users\user\Desktop>dumpbin /headers opengl32.dll | grep machine
             14C machine (x86)
             32 bit word machine

谁能解释一下这里发生了什么?

Can anyone explain what's happening here?

推荐答案

您看到的行为是由 SysWOW64 文件系统重定向

md5sum.exe 是一个 32 位的二进制文件,所以当它请求 C:\Windows\System32\opengl32.dll 时,文件系统返回 C:\Windows\SysWOW64\opengl32.dll.

md5sum.exe is a 32-bit binary, so when it requests C:\Windows\System32\opengl32.dll, the file system returns C:\Windows\SysWOW64\opengl32.dll.

同样,如果您启动 32 位提示 (C:\Windows\SysWOW64\cmd.exe),则执行 copy 操作并输入参数 C:\Windows\System32\opengl32.dllC:\Windows\SysWOW64\opengl32.dll被复制

Similarly, if you launch a 32-bit prompt (C:\Windows\SysWOW64\cmd.exe), perform a copy operation and inputs the argument C:\Windows\System32\opengl32.dll, C:\Windows\SysWOW64\opengl32.dll is copied

这篇关于为什么我不能从命令行从 C:\SysWOW64 复制 DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆