{"id":13995664,"url":"https://github.com/llvm-swift/Symbolic","last_synced_at":"2025-07-22T22:31:39.127Z","repository":{"id":63916694,"uuid":"112050168","full_name":"llvm-swift/Symbolic","owner":"llvm-swift","description":"A Swift library for dynamically loading shared objects ","archived":false,"fork":false,"pushed_at":"2017-11-26T20:33:57.000Z","size":17,"stargazers_count":69,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-29T07:11:08.871Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/llvm-swift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-26T02:38:00.000Z","updated_at":"2024-11-05T15:30:33.000Z","dependencies_parsed_at":"2023-01-14T13:45:18.606Z","dependency_job_id":null,"html_url":"https://github.com/llvm-swift/Symbolic","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-swift%2FSymbolic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-swift%2FSymbolic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-swift%2FSymbolic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-swift%2FSymbolic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llvm-swift","download_url":"https://codeload.github.com/llvm-swift/Symbolic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227190271,"owners_count":17745238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-09T14:03:32.311Z","updated_at":"2024-11-29T18:30:47.418Z","avatar_url":"https://github.com/llvm-swift.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Symbolic\n\nSymbolic makes it easy to get information about an executable, shared object,\nor static library.\n\n## Usage\n\n### Note\n\n⚠️ This library is incredibly unsafe. Use it with caution! ⚠️\n\nTo dynamically load a shared object file, create a `SharedObject`, passing in\nthe file URL where the object resides.\n\nYou can also use `SharedObject.current()` to get ahold of the object in which\nyour code will reside once compiled.\n\n```swift\nlet libFoo = SharedObject(object: URL(fileURLWithPath: \"/usr/lib/libfoo.dylib\"))\nlet myExe = SharedObject.current()\n```\n\nFrom there, you can ask the object for the addresses of symbols in the object\nand (if you're adventurous) cast function addresses to `@convention(c)`\nfunction pointers.\n\n```swift\nlet libcURL = URL(fileURLWithPath: \"/usr/lib/libc.dylib\")\nlet libc = SharedObject(object: libcURL)\n\nlet addr = libc.address(forSymbol: \"sin\") // will not be `nil`\n\ntypealias SinFn = @convention(c) (Double) -\u003e Double\n\n// Will perform an unsafeBitCast on your behalf!\nlet sinFn = libc.function(forSymbol: \"sin\", ofType: SinFn.self)\n\nsinFn?(0.5) // 0.4794255386\n```\n\nAdditionally, if you have an address in mind that you've already linked, you\ncan ask for it directly in your current address space:\n\n```swift\nlet addrInfo = SymbolInfo(address: addr)\naddrInfo.symbolName // \"sin\"\n```\n\n## Author\n\nHarlan Haskins ([@harlanhaskins](https://github.com/harlanhaskins))\n\n## License\n\nThis project is released under the MIT license, a copy of which is avaialable\nin this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllvm-swift%2FSymbolic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllvm-swift%2FSymbolic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllvm-swift%2FSymbolic/lists"}