延迟导入函数不在导出表中

逆向工程 dll 聚乙烯
2021-06-12 12:51:55

我一直在对 PE 可执行文件进行逆向工程,但遇到了一种我无法理解的行为。可执行文件同时使用 shell32.dll 和 profapi.dll。我看到 shell32.dll 延迟使用序数值加载 profapi.dll 中的函数(我通过查看 shell32.dll 的延迟加载导入表验证了这一点)。但是,profapi.dll 不导出任何函数,因为它甚至没有导出表。我正在使用 Python 库 pefile 检查这些 DLL 的延迟导入和导出部分。我在 Windows 7 上使用 profapi.dll 版本 6.1.7600.16385(由文件属性报告)。

据我了解,要从 profapi.dll 中按序号或名称加载函数,您仍然需要访问 profapi.dll 的导出表。profapi.dll 是否可以通过另一种方式公开其函数的地址,或者我是否遗漏了什么?

编辑:看起来这是 pefile 解析 DLL 的问题。我确实能够使用 IDApro 检查导出部分。我留下这个问题是为了突出 pefile 中的潜在错误。我正在使用 pefile 版本 1.2.10-139。

1个回答

profapi.dll当然应该有一个导出表。例如,这是来自profapi.dll版本的导出表6.3.9600.16384

There is an export table in .text at 0x10001000

The Export Tables (interpreted .text section contents)

Export Flags                    0
Time/Date stamp                 52157da7
Major/Minor                     0/0
Name                            00001060 profapi.dll
Ordinal Base                    101
Number in:
        Export Address Table            0000000e
        [Name Pointer/Ordinal] Table    00000000
Table Addresses
        Export Address Table            00001028
        Name Pointer Table              00000000
        Ordinal Table                   00000000

Export Address Table -- Ordinal Base 101
        [   0] +base[ 101] 2b24 Export RVA
        [   1] +base[ 102] 25c2 Export RVA
        [   2] +base[ 103] 3cd9 Export RVA
        [   3] +base[ 104] 1089 Export RVA
        [   4] +base[ 105] 4a8b Export RVA
        [   5] +base[ 106] 49b2 Export RVA
        [   6] +base[ 107] 42ae Export RVA
        [   7] +base[ 108] 4643 Export RVA
        [   8] +base[ 109] 45ce Export RVA
        [   9] +base[ 110] 4592 Export RVA
        [  10] +base[ 111] 3dc3 Export RVA
        [  11] +base[ 112] 4318 Export RVA
        [  12] +base[ 113] 428d Export RVA
        [  13] +base[ 114] 3bcd Export RVA

我刚刚检查6.1.7600.16385了 Windows 7 的版本,并确认它也有一个导出表,从中按顺序导出 6 个函数。如果您使用的 Python 库没有看到这些函数,那么这是由于 Python 库中的错误(或者可能是您对它的使用)。

对于它的价值,这是在旧版本中的一个已知问题pefile库,并固定在大约一年前也许您使用的是过时的版本?