Skip to content

Relocation Warnings and Forwarded Export Resolution on Windows 7 #39

@i486

Description

@i486

Here’s a clearer, more concise rewrite that tightens the wording and structure.


Describe the bug

This issue covers two related bugs that, if fixed, would significantly improve analysis on Windows 7.

Bug 1: Relocation warnings shown when disabled

DLLs that do not contain relocations are currently marked with a red icon in the Modules tree, and the log displays:

Module "DLLNAME.dll" has no relocations.

This happens even when “Process relocations while parsing images” is unchecked. In this case, DLLs without relocations should not be flagged.

Bug 2: Incorrect import status for unresolved forwarded exports when scanning with forwarder checking enabled

When scanning an application that imports a DLL whose exports are forwarded to another DLL, WinDepends incorrectly marks the imports as valid (green in the PI column) even when the forwarded functions do not exist in the destination DLL.

Background / Example

On Windows 7, api-ms-win-core-synch-l1-2-0.dll may be installed in System32 by certain updates. From the Windows 7 loader’s perspective, it behaves like a normal forwarding DLL (similar to liba.dll in issue #32), forwarding exports to kernel32.dll, since the apiset schema does not recognize it.

This DLL exports 11 functions, but 6 of them (such as WaitOnAddress, WakeByAddressAll, etc.) are not available on Windows 7.

Image

If an application that imports unavailable functions from this DLL is scanned on Windows 7:

  • With forwarder checking disabled, the imports appear green, which is expected behavior.
Image
  • With forwarder checking enabled, the imports still appear green, even though the forwarded functions are missing in the target DLL.
Image

To Reproduce

  1. Download the latest FFmpeg static build.
  2. Scan it on Windows 7 with forwarder checking enabled.
  3. Observe that all CRT APISET forwarder DLLs (api-ms-win-crt-*.dll) show red icons and “no relocation” warnings (Bug 1).
  4. Observe that WaitOnAddress, WakeByAddressAll, and WakeByAddressSingle are marked green in the PI column despite being unavailable (Bug 2).

A similar issue could likely be reproduced on Windows 10 by compiling a test application that imports Windows 11–only APIs via an apiset library.

Expected behavior

Only api-ms-win-core-synch-l1-2-0.dll should be marked with a red icon, as it is the only problematic DLL in this scenario.

When selecting the forwarder DLL (api-ms-win-core-synch-l1-2-0.dll), the APIs should be marked red if the forwarded functions cannot be found in the target DLL (kernel32.dll).

Environment

  • OS: Windows 7

Additional context

I previously hesitated to report this problem because it seemed Windows 7–specific. However, as a side effect of issue #32 (kudos to @MarekKnapek for reporting and @hfiref0x for implementing the feature), WinDepends can now properly analyze applications that fail to load on Windows 7 due to newer apiset DLLs. Fixing the issues described above would make it even easier to analyze such issues. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions