{"id":24449094,"url":"https://github.com/tijme/relocatable","last_synced_at":"2026-03-06T19:01:55.981Z","repository":{"id":273096635,"uuid":"918706518","full_name":"tijme/relocatable","owner":"tijme","description":"Boilerplate to develop raw and truly Position Independent Code (PIC).","archived":false,"fork":false,"pushed_at":"2025-01-20T09:29:03.000Z","size":2106,"stargazers_count":51,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-01T00:59:00.832Z","etag":null,"topics":["malware","pic","position-independent-code","shellcode","windows","x64"],"latest_commit_sha":null,"homepage":"","language":"C","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/tijme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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,"zenodo":null},"funding":{"github":["tijme"],"custom":["paypal.me/tijmegommers"]}},"created_at":"2025-01-18T16:41:12.000Z","updated_at":"2025-04-22T15:22:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c1fa345-c1f1-4056-9761-e1b56d9ce9ef","html_url":"https://github.com/tijme/relocatable","commit_stats":null,"previous_names":["tijme/relocatable"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tijme/relocatable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tijme%2Frelocatable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tijme%2Frelocatable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tijme%2Frelocatable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tijme%2Frelocatable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tijme","download_url":"https://codeload.github.com/tijme/relocatable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tijme%2Frelocatable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30192364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T18:54:55.862Z","status":"ssl_error","status_checked_at":"2026-03-06T18:53:04.013Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["malware","pic","position-independent-code","shellcode","windows","x64"],"created_at":"2025-01-21T00:37:04.233Z","updated_at":"2026-03-06T19:01:55.955Z","avatar_url":"https://github.com/tijme.png","language":"C","funding_links":["https://github.com/sponsors/tijme","paypal.me/tijmegommers","https://www.paypal.me/tijmegommers"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n    \u003ch1\u003eRelocatable\u003c/h1\u003e\r\n\u003c/p\u003e\r\n\u003cp align=\"center\"\u003e\r\n    \u003ca href=\"https://github.com/tijme/relocatable/blob/master/LICENSE.md\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/badge/License-MPL%20V2.0-527c50?style=for-the-badge\u0026labelColor=2b4e34\" /\u003e\r\n    \u003c/a\u003e \u0026nbsp;\r\n    \u003ca href=\"https://github.com/tijme/relocatable/releases\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/github/v/release/tijme/relocatable?style=for-the-badge\u0026labelColor=2b4e34\u0026color=527c50\" /\u003e\r\n    \u003c/a\u003e \u0026nbsp;\r\n    \u003ca href=\"https://github.com/tijme/relocatable/actions\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/tijme/relocatable/compile.yml?style=for-the-badge\u0026labelColor=2b4e34\u0026color=527c50\" /\u003e\r\n    \u003c/a\u003e\r\n\u003c/p\u003e\r\n\u003cp align=\"center\"\u003e\r\n    \u003cb\u003eBoilerplate to develop raw and truly Position Independent Code (PIC).\u003c/b\u003e\r\n    \u003cbr/\u003e\r\n    \u003csup\u003eBuilt with ♥ by \u003ca href=\"https://x.com/tijme\"\u003eTijme Gommers\u003c/a\u003e – Buy me a coffee via \u003ca href=\"https://www.paypal.me/tijmegommers\"\u003ePayPal\u003c/a\u003e.\u003c/sup\u003e\r\n    \u003cbr/\u003e\r\n\u003c/p\u003e\r\n\u003cp align=\"center\"\u003e\r\n    \u003ca href=\"#abstract\"\u003eAbstract\u003c/a\u003e\r\n    •\r\n    \u003ca href=\"#getting-started\"\u003eGetting started\u003c/a\u003e\r\n    •\r\n    \u003ca href=\"#issues--requests\"\u003eIssues \u0026 requests\u003c/a\u003e\r\n    •\r\n    \u003ca href=\"#license--copyright\"\u003eLicense \u0026 copyright\u003c/a\u003e\r\n\u003c/p\u003e\r\n\u003chr\u003e\r\n\r\n## Abstract\r\n\r\nSometimes you want to write Position Independent Code (PIC) in plain C (well, at least I do). Relocatable helps you do so. It allows you to write C-code that will be directly compiled into raw shellcode, which can be loaded into any process without the need for tools such as Donut or sRDI. An advantage is that the output size of the shellcode is extremely small (almost no overhead), and the shellcode remains simple.\r\n\r\n## Getting started\r\n\r\nClone this repository first. Install the dependencies, then [review the code](https://github.com/tijme/relocatable/blob/master/.github/laughing.gif).\r\n\r\n**Dependencies**\r\n\r\n* [MinGW](https://formulae.brew.sh/formula/mingw-w64)\r\n\r\n**Modify the code**\r\n\r\nAdjust the code in `./src/main.c` to your needs. The included example code pops a message box.\r\n\r\n**Compiling**\r\n\r\n    make\r\n\r\n**Usage**\r\n\r\nLoad `./dst/relocatable.x64.bin` using your shellcode loader (technique) of choice. You can also convert it to a c-code array using `xxd`.\r\n\r\n    xxd -i dst/relocatable.x64.bin\r\n\r\nThis outputs about a 1000 bytes. An example is included below.\r\n\r\n    unsigned char dst_relocatable_x64_bin[] = {\r\n      0x55, 0x48, 0x89, 0xe5, 0xe8, 0x55, 0x03, 0x00, 0x00, 0x90, 0x5d, 0xc3,\r\n      0x55, 0x48, 0x89, 0xe5, 0x48, 0x83, 0xec, 0x10, 0xc7, 0x45, 0xfc, 0x60,\r\n      0x00, 0x00, 0x00, 0x8b, 0x45, 0xfc, 0x65, 0x48, 0x8b, 0x00, 0x48, 0x8\r\n      -- snip --\r\n\r\n## Issues \u0026 requests\r\n\r\nIssues or new feature requests can be reported via the [issue tracker](https://github.com/tijme/relocatable/issues). Please make sure your issue or feature has not yet been reported by anyone else before submitting a new one.\r\n\r\n## License \u0026 copyright\r\n\r\nCopyright (c) 2025 Tijme Gommers. Relocatable is released under the GNU General Public License, version 2.0. View [LICENSE.md](https://github.com/tijme/relocatable/blob/master/LICENSE.md) for the full license. Relocatable was inspired by [ShellcodeStdio](https://github.com/jackullrich/ShellcodeStdio/tree/master), which is also licenced under the [GNU General Public License, version 2.0](https://github.com/zyantific/zydis/blob/master/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftijme%2Frelocatable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftijme%2Frelocatable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftijme%2Frelocatable/lists"}