{"id":15403203,"url":"https://github.com/woodruffw/upgrayedd","last_synced_at":"2026-03-02T12:41:34.972Z","repository":{"id":206869808,"uuid":"717875642","full_name":"woodruffw/upgrayedd","owner":"woodruffw","description":"Ergonomic function interposition in Rust","archived":false,"fork":false,"pushed_at":"2024-03-11T21:17:27.000Z","size":23,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-06T07:18:44.322Z","etag":null,"topics":["instrumentation","ld-preload"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/upgrayedd","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/woodruffw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-11-12T21:30:19.000Z","updated_at":"2025-03-29T17:43:58.000Z","dependencies_parsed_at":"2023-11-12T22:27:38.263Z","dependency_job_id":"42e54ff9-309a-44ea-b680-41e2f5a3f83c","html_url":"https://github.com/woodruffw/upgrayedd","commit_stats":null,"previous_names":["woodruffw/upgrayedd"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodruffw%2Fupgrayedd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodruffw%2Fupgrayedd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodruffw%2Fupgrayedd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woodruffw%2Fupgrayedd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woodruffw","download_url":"https://codeload.github.com/woodruffw/upgrayedd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249188426,"owners_count":21227015,"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":["instrumentation","ld-preload"],"created_at":"2024-10-01T16:06:44.437Z","updated_at":"2026-03-02T12:41:34.885Z","avatar_url":"https://github.com/woodruffw.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# upgrayedd\n\n[*\"Two Ds for a double dose of debugging.\"*](https://www.youtube.com/watch?v=Gf9i23KPGKk)\n\n[![CI](https://github.com/woodruffw/upgrayedd/actions/workflows/ci.yml/badge.svg)](https://github.com/woodruffw/upgrayedd/actions/workflows/ci.yml)\n[![Crates.io](https://img.shields.io/crates/v/upgrayedd)](https://crates.io/crates/upgrayedd)\n\n\u003e [!WARNING]\n\u003e You do not need this library. Do not use this library, especially in production\n\u003e systems. It is **not safe**, *even if* you only use safe Rust with it.\n\u003e It **cannot** be made safe.\n\n`upgrayedd` is a convenience proc macro for building function interposition\ntools in Rust. When used in a shared library build (which is the only\nway you should be using it), it makes `LD_PRELOAD`-style interposition\nlook like (relatively) idiomatic Rust.\n\n## Usage\n\nInterposing on an OpenSSL API:\n\n```rust,no_run\nuse upgrayedd::upgrayedd;\n\n#[upgrayedd]\nfn X509_VERIFY_PARAM_set_auth_level(param: *mut std::ffi::c_void, level: std::ffi::c_int) {\n    eprintln!(\"before!\");\n    unsafe { upgrayedd(param, level) };\n    eprintln!(\"after!\");\n}\n```\n\nRewriting parameters:\n\n```rust\nuse upgrayedd::upgrayedd;\n\n#[upgrayedd]\nfn frobulate(size: libc::size_t) {\n    unsafe { upgrayedd(size + 42) };\n}\n```\n\nStubbing functions out:\n\n```rust\nuse upgrayedd::upgrayedd;\n\n#[upgrayedd]\nfn verify_cert(cert: *mut std::ffi::c_void) -\u003e libc::c_int {\n    // nothing to see here\n    1\n}\n```\n\nSee the [docs] for more usage examples.\n\n[docs]: https://docs.rs/upgrayedd\n\n## Limitations\n\n* Fundamentally unsafe. Again: please do not use this for anything serious.\n* Hooking \"basic\" routines (like `malloc` and `free`) may or may not work,\n  depending on what you put in your hook. In particular, if you accidentally\n  recurse while holding a lock (which is easy to do when hooking `malloc`\n  and calling `println!`), you'll probably end up deadlocking.\n* Bad things will definitely happen if you try to pass Rust types into\n  wrapped C functions, which `upgrayedd` will happily let you do.\n* Bad things will definitely happen if you supply the wrong function\n  signature, which `upgrayedd` will happily let you do.\n* Only C functions can currently be wrapped; C++ would probably work with small\n  tweaks.\n* Currently Linux only. Other OSes would probably work with small tweaks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoodruffw%2Fupgrayedd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoodruffw%2Fupgrayedd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoodruffw%2Fupgrayedd/lists"}