linkstore
linkstore is a library that allows you to define global variables in your final compiled binary that can be modified post-compilation.
linkstore currently supports ELF and PE executable formats and can be used with both statically and dynamically linked libraries.
Supported types
Currently, linkstore can serialize and deserialize numbers (excluding usize and isize), bool and fixed-length arrays out of the box.
For anything else, you'll need to implement your own deserialization from fixed-length byte arrays.
Usage
Defining & using linkstore globals
extern crate linkstore;
linkstore!
Manipulating linkstore globals after compilation
Once your binary has been built, you can use linkstore to modify the values.
// You can use `linkstore::open_binary` to open a binary file from the filesystem.
let mut binary: File = open_binary.unwrap;
// Alternatively, you can work directly on a memory buffer or memory-mapped file using a `std::io::Cursor`
let mut binary: = read.unwrap;
let mut binary: Cursor = new;
let mut embedder = new.unwrap;
embedder.embed.unwrap;
embedder.embed.unwrap;
embedder.embed.unwrap;
embedder.embed.unwrap;
embedder.embed.unwrap;
embedder.finish.unwrap;
TODO
- MacOS binaries support
- MacO + fat binaries support
- When specialization is stabilized, implement a ton of specialization and potentially extra serialization/deserialization support
- Continuous integration