{"id":13546109,"url":"https://github.com/mehcode/guerrilla","last_synced_at":"2025-04-09T16:18:14.872Z","repository":{"id":33255143,"uuid":"156787636","full_name":"mehcode/guerrilla","owner":"mehcode","description":"☢ Guerrilla (or Monkey) Patching in Rust for (unsafe) fun and profit.","archived":false,"fork":false,"pushed_at":"2022-07-31T19:17:32.000Z","size":26,"stargazers_count":116,"open_issues_count":8,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T16:18:04.424Z","etag":null,"topics":["monkey-patching","rust","testing","unsafe"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-09T00:36:29.000Z","updated_at":"2025-03-31T21:48:37.000Z","dependencies_parsed_at":"2022-08-25T09:01:05.680Z","dependency_job_id":null,"html_url":"https://github.com/mehcode/guerrilla","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehcode%2Fguerrilla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehcode%2Fguerrilla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehcode%2Fguerrilla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehcode%2Fguerrilla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehcode","download_url":"https://codeload.github.com/mehcode/guerrilla/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065280,"owners_count":21041872,"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":["monkey-patching","rust","testing","unsafe"],"created_at":"2024-08-01T12:00:31.811Z","updated_at":"2025-04-09T16:18:14.835Z","avatar_url":"https://github.com/mehcode.png","language":"Rust","readme":"# Guerrilla\n[![Crates.io](https://img.shields.io/crates/v/guerrilla.svg?style=popout-square)](https://crates.io/crates/guerrilla)\n[![Travis (.com)](https://img.shields.io/travis/com/mehcode/guerrilla.svg?label=Travis%20CI\u0026style=flat-square)](https://travis-ci.com/mehcode/guerrilla)\n[![AppVeyor](https://img.shields.io/appveyor/ci/mehcode/guerrilla.svg?label=AppVeyor\u0026style=flat-square)](https://ci.appveyor.com/project/mehcode/guerrilla)\n![License](https://img.shields.io/crates/l/guerrilla.svg?style=popout-square)\n\u003e Guerrilla (or Monkey) Patching in Rust for (unsafe) fun and profit.\n\nProvides aribtrary monkey patching in Rust. Please do not use this crate for anything outside of testing.\nIt will not end well.\n\nCan patch (almost) any function in Rust (free, associated, instance, generic, etc.).\n\n## Usage\n\n```rust\nextern crate guerrilla;\n\n#[inline(never)]\nfn say_hi(name: \u0026str) {\n    println!(\"hello, {}\", name);\n}\n\nfn main() {\n    // Variadic generics would be wondeful so we could have a [guerrilla::patch]\n    let _guard = guerrilla::patch1(say_hi, |name| {\n        // So sneaky... like a sneaky sneaky snek\n        println!(\"bye, {}\", name);\n    });\n\n    // [...]\n    // Thousands of lines codes further in the project\n    // [...]\n\n    say_hi(\"Steve\");\n\n    // Once the guard is dropped the patch reverts the function to its original\n    // behavior.\n    drop(_guard);\n\n    say_hi(\"Bob\");\n}\n```\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license\n   ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\n## Credits\n\nInspired (and derived) from [monkey-patching-in-go](https://bou.ke/blog/monkey-patching-in-go/).\n","funding_links":[],"categories":["Vulnerability Assessment"],"sub_categories":["Binary Analysis \u0026 Reversing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehcode%2Fguerrilla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehcode%2Fguerrilla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehcode%2Fguerrilla/lists"}