{"id":16880720,"url":"https://github.com/wtdcode/unicorn-rs","last_synced_at":"2025-03-20T03:34:19.258Z","repository":{"id":110681775,"uuid":"381609813","full_name":"wtdcode/unicorn-rs","owner":"wtdcode","description":"Rust bindings for Unicorn Engine.","archived":false,"fork":false,"pushed_at":"2021-07-08T02:34:27.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-25T05:41:17.517Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wtdcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2021-06-30T07:13:16.000Z","updated_at":"2021-10-08T01:57:19.000Z","dependencies_parsed_at":"2023-04-09T05:33:24.106Z","dependency_job_id":null,"html_url":"https://github.com/wtdcode/unicorn-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2Funicorn-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2Funicorn-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2Funicorn-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2Funicorn-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wtdcode","download_url":"https://codeload.github.com/wtdcode/unicorn-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244544421,"owners_count":20469680,"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-10-13T15:59:53.527Z","updated_at":"2025-03-20T03:34:19.253Z","avatar_url":"https://github.com/wtdcode.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unicorn-rs\n\nRust bindings for the [Unicorn](http://www.unicorn-engine.org/) emulator with utility functions.\n\nAn extended version for fuzzing with AFL++ support can be found in https://github.com/aflplusplus/unicornafl.\n\n```rust\nuse unicorn::RegisterARM;\nuse unicorn::unicorn_const::{Arch, Mode, Permission, SECOND_SCALE};\n\nfn main() {\n    let arm_code32: Vec\u003cu8\u003e = vec![0x17, 0x00, 0x40, 0xe2]; // sub r0, #23\n\n    let mut unicorn = unicorn::Unicorn::new(Arch::ARM, Mode::LITTLE_ENDIAN).expect(\"failed to initialize Unicorn instance\");\n    let mut emu = unicorn.borrow();\n    emu.mem_map(0x1000, 0x4000, Permission::ALL).expect(\"failed to map code page\");\n    emu.mem_write(0x1000, \u0026arm_code32).expect(\"failed to write instructions\");\n\n    emu.reg_write(RegisterARM::R0 as i32, 123).expect(\"failed write R0\");\n    emu.reg_write(RegisterARM::R5 as i32, 1337).expect(\"failed write R5\");\n\n    let _ = emu.emu_start(0x1000, (0x1000 + arm_code32.len()) as u64, 10 * SECOND_SCALE, 1000);\n    assert_eq!(emu.reg_read(RegisterARM::R0 as i32), Ok(100));\n    assert_eq!(emu.reg_read(RegisterARM::R5 as i32), Ok(1337));\n}\n```\nFurther sample code can be found in ```tests/unicorn.rs```.\n\n## Installation\n\nThis project has been tested on Linux, OS X and Windows. \n\nTo use unicorn-rs, simply add it as a dependency to the Cargo.toml of your program.\n\n```\n[dependencies]\nunicorn = { path = \"/path/to/bindings/rust\", version=\"1.0.0\" }\n```\n\n## Acknowledgements\n\nThese bindings are based on Sébastien Duquette's (@ekse) [unicorn-rs](https://github.com/unicorn-rs/unicorn-rs).\nWe picked up the project, as it is no longer maintained.\nThanks to all contributers.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtdcode%2Funicorn-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwtdcode%2Funicorn-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtdcode%2Funicorn-rs/lists"}