Skip to content

Support cyclic Windows recursive DLL graphs - #22

Open
moloch-- wants to merge 5 commits into
mainfrom
feat/windows-recursive-cycles
Open

moloch-- wants to merge 5 commits into
mainfrom
feat/windows-recursive-cycles

Conversation

@moloch--

@moloch-- moloch-- commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Map all custom PE dependencies before binding imports, so a dependency can import an export from an earlier image in the same cycle.
  • Bind the complete graph before running TLS callbacks or DllMain; initialize in dependency-first order with deterministic cycle handling.
  • Detach every initialized image in reverse order before unmapping any image, so cycle members remain callable during detach.
  • Add real cyclic and diamond DLL fixtures, a PE export forwarder back into the cycle, import-edge checks, native lifecycle tests, and a required Windows CI gate.

System32 and API-set delegation remains unchanged. Delay-load imports remain explicitly rejected; that feature is in a separate PR.

Validation

  • Windows 386, amd64, and arm64 memmod and integration test binaries cross-compiled with CGO_ENABLED=0.
  • TestBuildRecursiveCSharedLibraryMatrix/windows-* passed for all three Windows architectures and verified the intended PE import edges.
  • The Windows/386 fixture normalizes the linker's decorated PE forwarder target to the literal DLL name expected by the loader.
  • Native Windows runtime tests are required in the PR matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant