{"id":33941749,"url":"https://github.com/szymonwieloch/rust-dlopen","last_synced_at":"2025-12-12T16:51:11.345Z","repository":{"id":23875195,"uuid":"100070774","full_name":"szymonwieloch/rust-dlopen","owner":"szymonwieloch","description":"Rust library for opening and working with dynamic link libraries.","archived":false,"fork":false,"pushed_at":"2024-01-09T15:25:42.000Z","size":186,"stargazers_count":203,"open_issues_count":22,"forks_count":33,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-12-12T03:33:02.984Z","etag":null,"topics":["dlopen","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/szymonwieloch.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-11T21:18:17.000Z","updated_at":"2025-11-18T22:45:15.000Z","dependencies_parsed_at":"2024-06-18T21:30:33.207Z","dependency_job_id":"8bb07085-9c89-4652-93a5-6d5035221920","html_url":"https://github.com/szymonwieloch/rust-dlopen","commit_stats":{"total_commits":117,"total_committers":9,"mean_commits":13.0,"dds":0.3589743589743589,"last_synced_commit":"f9fed7168dfdcfd682a6c409595d4e2430b2dd2d"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/szymonwieloch/rust-dlopen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szymonwieloch%2Frust-dlopen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szymonwieloch%2Frust-dlopen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szymonwieloch%2Frust-dlopen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szymonwieloch%2Frust-dlopen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szymonwieloch","download_url":"https://codeload.github.com/szymonwieloch/rust-dlopen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szymonwieloch%2Frust-dlopen/sbom","scorecard":{"id":864487,"data":{"date":"2025-08-11","repo":{"name":"github.com/szymonwieloch/rust-dlopen","commit":"f9fed7168dfdcfd682a6c409595d4e2430b2dd2d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":1,"reason":"Found 4/23 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T02:18:14.772Z","repository_id":23875195,"created_at":"2025-08-24T02:18:14.772Z","updated_at":"2025-08-24T02:18:14.772Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27680783,"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","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dlopen","rust"],"created_at":"2025-12-12T16:51:10.528Z","updated_at":"2025-12-12T16:51:11.340Z","avatar_url":"https://github.com/szymonwieloch.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rust-dlopen\n\n[![Travis CI][tcii]][tci] [![Appveyor CI][acii]][aci] [![Crates CI][ccii]][cci]  [![Codedov CI][vcii]][vci]  [![Docs][dcii]][dci]\n\n[tcii]: https://travis-ci.org/szymonwieloch/rust-dlopen.svg?branch=master\n[tci]: https://travis-ci.org/szymonwieloch/rust-dlopen\n[acii]: https://ci.appveyor.com/api/projects/status/github/szymonwieloch/rust-dlopen?svg=true\n[aci]: https://ci.appveyor.com/project/szymonwieloch/rust-dlopen\n[ccii]: https://img.shields.io/crates/v/dlopen.svg\n[cci]: https://crates.io/crates/dlopen\n[vcii]: https://codecov.io/api/gh/szymonwieloch/rust-dlopen/branch/master/graph/badge.svg\n[vci]: https://codecov.io/gh/szymonwieloch/rust-dlopen\n[dcii]: https://docs.rs/dlopen/badge.svg\n[dci]: https://docs.rs/dlopen\n\n# Overview\n\nThis library is my effort to make use of dynamic link libraries in Rust simple.\nPreviously existing solutions were either unsafe, provided huge overhead of required writing too much code to achieve simple things.\nI hope that this library will help you to quickly get what you need and avoid errors.\n\n# Quick example\n\n```rust\nextern crate dlopen;\n#[macro_use]\nextern crate dlopen_derive;\nuse dlopen::wrapper::{Container, WrapperApi};\n\n#[derive(WrapperApi)]\nstruct Api\u003c'a\u003e {\n    example_rust_fun: fn(arg: i32) -\u003e u32,\n    example_c_fun: unsafe extern \"C\" fn(),\n    example_reference: \u0026'a mut i32,\n}\n\nfn main(){\n    let mut cont: Container\u003cApi\u003e =\n        unsafe { Container::load(\"libexample.so\") }.expect(\"Could not open library or load symbols\");\n    cont.example_rust_fun(5);\n    unsafe{cont.example_c_fun()};\n    *cont.example_reference_mut() = 5;\n}\n```\n\n\n# Features\n\n## Main features\n\n* Supports majority of platforms and is platform independent.\n* Is consistent with Rust error handling mechanism and makes making mistakes much more difficult.\n* Is very lightweight. It mostly uses zero cost wrappers to create safer abstractions over platform API.\n* Is thread safe.\n* Is object-oriented programming friendly.\n* Has a low-level API that provides full flexibility of using libraries.\n* Has two high-level APIs that protect against dangling symbols - each in its own way.\n* High level APIs support automatic loading of symbols into structures. You only need to define a\n    structure that represents an API. The rest happens automatically and requires only minimal amount of code.\n* Automatic loading of symbols helps you to follow the DRY paradigm.\n\n## Compare with other libraries\n\n|Feature                             | dlopen     | [libloading](https://github.com/nagisa/rust_libloading) | [sharedlib](https://github.com/Tyleo/sharedlib) |\n|------------------------------------|------------|---------------------------------------------------------|-------------------------------------------------|\n| Basic functionality                | Yes        | Yes        | Yes       |\n| Multiplatform                      | Yes        | Yes        | Yes       |\n|Dangling symbol prevention          | Yes        | Yes        | Yes       |\n| Thread safety                      | Yes        | **Potential problem with SetErrorMode() on older Windows platforms** | **No support for SetErrorMode (library may block the application on Windows)**|\n| Loading of symbols into structures | Yes        | **No**     | **No**     \n| Overhead                           | Minimal    | Minimal    | **Some overhead** |\n| Low-level, unsafe API              | Yes        | Yes        | Yes       |\n| Object-oriented friendly           | Yes        | **No**       | Yes     | \n| Load from the program itself       | Yes        | **No**       | **No**  |\n| Obtaining address information (dladdr) | Yes    |  **Unix only** | **No**|\n\n## Safety\n\t\nPlease note that while Rust aims at being 100% safe language, it does not yet provide mechanisms that would allow me to create a 100% safe library, so I had to settle on 99%.\nAlso the nature of dynamic link libraries requires casting obtained pointers into types that are defined on the application side. And this cannot be safe. \nHaving said that I still think that this library provides the best approach and greatest safety possible in Rust.\n\n# Usage:\n\nCargo.toml:\n\n```toml\n[dependencies]\ndlopen = \"0.1\"\n```\n\n# Documentation\n    \n[Cargo documentation](https://docs.rs/dlopen)\n    \n# License\nThis code is licensed under [MIT](./LICENSE) license.\n\n# Changelog\n\n[GitHub changelog](https://github.com/szymonwieloch/rust-dlopen/releases)\n\n# Acknowledgement\n\nSpecial thanks to [Simonas Kazlauskas](https://github.com/nagisa) whose [libloading](https://github.com/nagisa/rust_libloading) became code base for my project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszymonwieloch%2Frust-dlopen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszymonwieloch%2Frust-dlopen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszymonwieloch%2Frust-dlopen/lists"}