{"id":16712892,"url":"https://github.com/hugsy/ropgadget-rs","last_synced_at":"2025-04-10T06:06:47.335Z","repository":{"id":65090725,"uuid":"280964047","full_name":"hugsy/ropgadget-rs","owner":"hugsy","description":"Another (bad) ROP gadget finder, but this time in Rust","archived":false,"fork":false,"pushed_at":"2024-04-09T16:11:45.000Z","size":7088,"stargazers_count":20,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T06:06:35.842Z","etag":null,"topics":["exploit-development","pwn","rop","rop-gadget-finder","ropgadget","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/hugsy.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":"2020-07-19T22:50:02.000Z","updated_at":"2025-03-21T01:50:34.000Z","dependencies_parsed_at":"2025-02-16T19:43:26.959Z","dependency_job_id":null,"html_url":"https://github.com/hugsy/ropgadget-rs","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/hugsy%2Fropgadget-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugsy%2Fropgadget-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugsy%2Fropgadget-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugsy%2Fropgadget-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugsy","download_url":"https://codeload.github.com/hugsy/ropgadget-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166925,"owners_count":21058481,"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":["exploit-development","pwn","rop","rop-gadget-finder","ropgadget","rust"],"created_at":"2024-10-12T20:44:27.797Z","updated_at":"2025-04-10T06:06:47.280Z","avatar_url":"https://github.com/hugsy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.imgur.com/zjcxyVf.png\" alt=\"logo\" width=\"250px\"/\u003e\n\u003c/p\u003e\n\n# `ropgadget-rs`\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://discord.gg/hSbqxxBgRX\"\u003e\u003cimg alt=\"Discord\" src=\"https://img.shields.io/badge/Discord-BlahCats-yellow\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/hugsy/ropgadget-rs/actions/workflows/build.yml\"\u003e\u003cimg src=\"https://github.com/hugsy/ropgadget-rs/actions/workflows/build.yml/badge.svg?branch=main\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\nRopGadget-rs started as a weekend project to learn [Rust](https://www.rust-lang.org/). But as usual it also started from the need to get really fast \u0026 easily portable ropgadget finder capable of handling quickly any binary (especially very large ones such as mshtml, ntoskrnl, chrome, etc.).\n\n\u003e [!NOTE]\n\u003e This library is a side project to learn Rust. If you want better tools, see the ones mentioned at the bottom of the page. \n\nCurrently supports:\n\n|       |  ELF   |  PE   |    MachO  |\n| :---: | :----: |:-----:|:---------:|\n|  x86  |   ✅   |   ✅   |   ✅   |\n|  x64  |   ✅   |   ✅   |   ✅   |\n|  arm  |   ✅   |   ✅   |   ❌   |\n| arm64 |   ✅   |   ✅   |   ❌   |\n\n\n## `ropgadget-rs`\n\nSince 0.4, RopGadget-Rs was re-designed to be built as a library so it can be integrated to other projects.\nBut a lightweight standalone binary that features all what the library offers, can also be built.\n\n## Build\n\n(Optionally) If you don't have `cargo`:\n\n - On Linux/MacOS\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\n - On Windows\n```ps1\nInvoke-WebRequest https://win.rustup.rs/x86_64 -UseBasicParsing -OutFile \"rustup-init.exe\"\nInvoke-Expression rustup-init.exe\n```\n\nThen build:\n```bash\ngit clone https://github.com/hugsy/ropgadget-rs\ncd ropgadget-rs\ncargo build --release --lib\n```\n\nYou might also want to build the ropgadget-rs binary so it can be easily used from the command line:\n```bash\ncargo build --release --example rp-rs\n```\n\n\nAnd run:\n```bash\ncargo run -- --help\n```\n\n\n## Install\n\nVia `cargo`\n\n```bash\ncargo install --bins --git https://github.com/hugsy/ropgadget-rs.git\n```\n\n## Performance\n\nThe tool performs decently but could largely be optimized (and will be, over time).\nHere are some performance obtained on an old i5-4300M (build in `--release` mode) with 2 threads (default)\n\n * `ntoskrnl.exe` (Windows 10 RS6 - 10.0.19041.329) - 10,921,280 bytes\n\n```console\n\u003e  ./ropgadget-rs.exe -o rop.txt -vv ./ntoskrnl-rs6.exe\n[INFO] - Checking file './ntoskrnl-rs6.exe'\n[INFO] - Creating new Session(file=./ntoskrnl-rs6.exe, Info(Arch=x86-64, OS=PE))\n[INFO] - Looking for gadgets in 15 sections (with 2 threads)...'\n[INFO] - Dumping 336787 gadgets to 'rop.txt'...\n[INFO] - Done!\n[INFO] - Execution: 336787 gadgets found in 13.5224138s\n```\n\n * `msedge.dll` (Chromium Edge - 83.0.478.64) - 145,665,416 bytes\n\n```console\n\u003e ./ropgadget-rs -o rop.txt -vv ./msedge.dll\n[INFO] - Checking file './msedge.dll'\n[INFO] - Creating new Session(file=./msedge.dll, Info(Arch=x86-64, OS=PE))\n[INFO] - Looking for gadgets in 1 sections (with 2 threads)...'\n[INFO] - Dumping 5713703 gadgets to 'rop.txt'...\n[INFO] - Done!\n[INFO] - Execution: 5713703 gadgets found in 132.2237842s\n```\n\nYMMV but most small files (like Unix binaries) will execute in way under 1 second.\n\n```console\n$ ./ropgadget-rs -vv -o /dev/null /bin/ls\n[INFO] - Checking file '/bin/ls'\n[INFO] - Creating new Session(file=/bin/ls, Info(Arch=x86-64, OS=ELF))\n[INFO] - Looking for gadgets in 5 sections (with 2 threads)...'\n[INFO] - Dumping 3544 gadgets to '/dev/null'...\n[INFO] - Done!\n[INFO] - Execution: 3544 gadgets found in 151.5587ms\n```\n\n\n## Better projects\n\nUnless you're ok with experiencing my bugs, you should probably check out one of those projects:\n - [rp++](https://github.com/0vercl0k/rp)\n - [ropper](https://github.com/sashs/ropper)\n - [RopGadget](https://github.com/JonathanSalwan/ROPgadget)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugsy%2Fropgadget-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugsy%2Fropgadget-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugsy%2Fropgadget-rs/lists"}