Skip to content

JanAhrens/swift-use-dylib-without-swiftmodule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use Swift dynamic library without swiftmodule file

This repository demonstrates a technique that you can use to create a .swiftmodule file for a .dylib without having access to the original .swift file.

Steps:

  1. Analyze the .dylib using nm -gU libModule.dylib
  2. Use xcrun swift-demangle to reconstruct the structure of the library
  3. Create a mock implementation of the Swift module (see Module.swift)
  4. Use the mock implementation to generate the .swiftdoc and .swiftmodule files
  5. Compile your program (main.swift) using the mock .swiftmodule and link it against the real dylib (libModule.dylib)

Acknowledgements:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published