{"id":15762357,"url":"https://github.com/williamvenner/linkstore","last_synced_at":"2025-04-01T14:32:03.080Z","repository":{"id":62442293,"uuid":"450950851","full_name":"WilliamVenner/linkstore","owner":"WilliamVenner","description":"Rust crate for embedding, manipulating and retrieving data embedded in binaries using linker sections","archived":false,"fork":false,"pushed_at":"2022-11-18T10:51:23.000Z","size":111,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-11T11:33:27.441Z","etag":null,"topics":["ar","binaries","binary","coff","drm","elf","executable","fingerprint","fingerprinting","linker","linking","mach-o","macho","pe","program","rust","steganography"],"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/WilliamVenner.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}},"created_at":"2022-01-22T22:30:04.000Z","updated_at":"2024-06-23T23:39:41.000Z","dependencies_parsed_at":"2023-01-23T13:15:20.702Z","dependency_job_id":null,"html_url":"https://github.com/WilliamVenner/linkstore","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Flinkstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Flinkstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Flinkstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Flinkstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WilliamVenner","download_url":"https://codeload.github.com/WilliamVenner/linkstore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246604612,"owners_count":20804100,"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":["ar","binaries","binary","coff","drm","elf","executable","fingerprint","fingerprinting","linker","linking","mach-o","macho","pe","program","rust","steganography"],"created_at":"2024-10-04T11:08:48.216Z","updated_at":"2025-04-01T14:32:02.825Z","avatar_url":"https://github.com/WilliamVenner.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# linkstore\n\nlinkstore is a library that allows you to define global variables in your final compiled binary that can be modified post-compilation.\n\nlinkstore currently supports ELF and PE executable formats and can be used with both statically and dynamically linked libraries.\n\n# Supported types\n\nCurrently, linkstore can serialize and deserialize numbers (excluding `usize` and `isize`), `bool` and fixed-length arrays out of the box.\n\nFor anything else, you'll need to implement your own deserialization from fixed-length byte arrays.\n\n# Usage\n\n## Defining \u0026 using linkstore globals\n\n```rust\n#[macro_use] extern crate linkstore;\n\nlinkstore! {\n    pub static LINKSTORE_TEST: u64 = 0xDEADBEEF;\n    pub static LINKSTORE_YEAH: u32 = 0xDEADBEEF;\n    pub static LINKSTORE_BYTES: [u8; 4] = [0xDE, 0xAD, 0xBE, 0xEF];\n    pub static LINKSTORE_SHORTS: [u16; 4] = [0xDE, 0xAD, 0xBE, 0xEF];\n    pub static LINKSTORE_BIG: u128 = 0xDEADBEEF;\n}\n\nfn main() {\n    unsafe {\n        println!(\"LINKSTORE_TEST = {:x}\", LINKSTORE_TEST::get());\n        println!(\"LINKSTORE_YEAH = {:x}\", LINKSTORE_YEAH::get());\n        println!(\"LINKSTORE_BYTES = {:?}\", LINKSTORE_BYTES::get());\n        println!(\"LINKSTORE_SHORTS = {:?}\", LINKSTORE_SHORTS::get());\n        println!(\"LINKSTORE_BIG = {:b}\", LINKSTORE_BIG::get());\n    }\n}\n```\n\n## Manipulating linkstore globals after compilation\n\nOnce your binary has been built, you can use linkstore to modify the values.\n\n```rust\n// You can use `linkstore::open_binary` to open a binary file from the filesystem.\nlet mut binary: std::fs::File = linkstore::open_binary(\"C:\\\\Windows\\\\system32\\\\kernel32.dll\").unwrap();\n\n// Alternatively, you can work directly on a memory buffer or memory-mapped file using a `std::io::Cursor`\nlet mut binary: Vec\u003cu8\u003e = std::fs::read(\"C:\\\\Windows\\\\system32\\\\kernel32.dll\").unwrap();\nlet mut binary: std::io::Cursor\u003c\u0026mut [u8]\u003e = std::io::Cursor::new(\u0026mut binary);\n\nlet mut embedder = linkstore::Embedder::new(\u0026mut binary).unwrap();\n\nembedder.embed(\"LINKSTORE_TEST\", \u002669_u64).unwrap();\nembedder.embed(\"LINKSTORE_YEAH\", \u0026420_u32).unwrap();\nembedder.embed(\"LINKSTORE_BYTES\", \u0026[1_u8, 2, 3, 4]).unwrap();\nembedder.embed(\"LINKSTORE_SHORTS\", \u0026[1_u16, 2, 3, 4]).unwrap();\nembedder.embed(\"LINKSTORE_BIG\", \u0026(u128::MAX / 2)).unwrap();\n\nembedder.finish().unwrap();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Flinkstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamvenner%2Flinkstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Flinkstore/lists"}