#key-value #key #value #executable

shed

A portable key-value store which is appended to the end of an executable file

3 releases (1 stable)

1.0.0 Jun 24, 2021
0.2.1 Jun 23, 2021
0.2.0 Jun 22, 2021
0.1.0 Jan 20, 2018
0.0.0 Nov 19, 2017

#171 in Database interfaces

Apache-2.0

10KB
171 lines

SHED: Self Hosted Executable Database

A portable key-value store which is appended to the end of an executable file. Currently only working with ELF Executables.

Example Code

// Create a new SHED
let mut shed_example = shed::Shed::new();

// Test wheather this executable already has a SHED
if !shed_example.shed_exists() {
    shed_example
        .initialize_shed()
        .expect("Failed to initialize SHED");
}

// Create a key value store with the value type String
let mut x = shed::Store::new();
x.insert(String::from("Test Key"), String::from("Test Value"));

// Write our key store to the SHED
shed_example
    .write_shed(x)
    .expect("Failed to write data to SHED");

// Read key value store from SHED
let read_shed: shed::Store<String> =
    shed_example.read_shed().expect("Failed to read from SHED");
println!("{:?}", read_shed);

To Do

  • Get fully working on Linux
  • Add support for Windows PE executables
  • Make API look nicer
  • Write some documentation

Warning

This crate is experimental, since it involves an executable file modifying itself it may or may not trigger antivirus products. So far it hasn't triggered any of the major antivirus products so it should be good to use.

Dependencies

~0.9–1.6MB
~35K SLoC

2`