首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Windows上绝对不可能使用为X86编译的DLL吗?

在Windows上绝对不可能使用为X86编译的DLL吗?
EN

Stack Overflow用户
提问于 2020-08-06 23:52:40
回答 1查看 168关注 0票数 0

我正在研究在Windows CE7上编写安全控制器的可能性。生产dongle的公司并没有明确声明支持Windows,但是根据他们的销售人员,应该支持Windows。dongle使用一个导入库(.lib),它引用具有我想要使用的函数的.dll。通过查看.dll的dumpbin /headers头信息,我可以看到.dll是为x86 (14c)编译的,子系统是Windows GUI。作为参考,我在Windows设备上使用的.dlls是为拇指(1c2,ARM afaik)编译的,并且有子系统Windows CE GUI

下面是dumpbin命令的缩短输出。

代码语言:javascript
复制
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file <name removed>.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
             14C machine (x86)
               5 number of sections
        502875ED time date stamp Mon Aug 13 12:35:09 2012
               0 file pointer to symbol table
               0 number of symbols
              E0 size of optional header
            210E characteristics
                   Executable
                   Line numbers stripped
                   Symbols stripped
                   32 bit word machine
                   DLL

OPTIONAL HEADER VALUES
             10B magic # (PE32)
            6.00 linker version
            A000 size of code
            C000 size of initialized data
               0 size of uninitialized data
            4EA2 entry point (10004EA2)
            1000 base of code
            B000 base of data
        10000000 image base (10000000 to 10016FFF)
            1000 section alignment
            1000 file alignment
            4.00 operating system version
            0.00 image version
            4.00 subsystem version
               0 Win32 version
           17000 size of image
            1000 size of headers
           1A38F checksum
               2 subsystem (Windows GUI)
               0 DLL characteristics
          100000 size of stack reserve
            1000 size of stack commit
          100000 size of heap reserve
            1000 size of heap commit
               0 loader flags
              10 number of directories
            BED0 [      D9] RVA [size] of Export Directory
            B770 [      50] RVA [size] of Import Directory
           14000 [     7C8] RVA [size] of Resource Directory
               0 [       0] RVA [size] of Exception Directory
           12000 [    17D0] RVA [size] of Certificates Directory
           15000 [     990] RVA [size] of Base Relocation Directory
               0 [       0] RVA [size] of Debug Directory
               0 [       0] RVA [size] of Architecture Directory
               0 [       0] RVA [size] of Global Pointer Directory
               0 [       0] RVA [size] of Thread Storage Directory
               0 [       0] RVA [size] of Load Configuration Directory
               0 [       0] RVA [size] of Bound Import Directory
            B000 [     144] RVA [size] of Import Address Table Directory
               0 [       0] RVA [size] of Delay Import Directory
               0 [       0] RVA [size] of COM Descriptor Directory
               0 [       0] RVA [size] of Reserved Directory

这是我第一次像这样分析dlls和lib,所以我对它们不太熟悉。

如果为

  1. 编译了dll,则只能在x86计算机上使用它,而不能使用其他体系结构。这是有意义的,但考虑到dll正在使用PE格式(可移植的可执行文件),不同的体系结构之间不应该至少有一些兼容性吗?也许我误解了它的“可移植”部分。
  2. 如果上述观点成立,除了要求供应商重新编译Windows的dll?

之外,是否有可能让dll在Windows上运行?

EN

回答 1

Stack Overflow用户

发布于 2020-08-07 06:48:28

我联系了供应商,看起来销售人员给我转发了一套错误的DLL。实际上,它们有一组针对Windows CE6编译的DLL。我测试过了,它看起来很有效。为了直接回答我的问题,我是以@Peter的评论为基础的。您不能在Windows上使用x86-DLL,因为Windows不理解x86-机器代码。相反的情况也是一样。理论上,您可以实现某种类型的仿真层来完成转换,但最简单的选择仍然是要求供应商为Windows重新编译。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63293305

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档