crt0stack

Crates.iocrt0stack
lib.rscrt0stack
version0.1.0
sourcesrc
created_at2020-08-19 21:08:46.941627
updated_at2020-08-19 21:08:46.941627
descriptionTools for reading and creating Linux crt0 stack data
homepagehttps://github.com/enarx/crt0stack
repositoryhttps://github.com/enarx/crt0stack
max_upload_size
id278400
size52,121
owners (github:enarx:owners)

documentation

README

Workflow Status Average time to resolve an issue Percentage of issues still open Maintenance

crt0stack

Create the initial stack frame to start an ELF binary on Linux

Examples

use crt0stack::{Builder, Entry};

let mut stack = [1u8; 512];
let stack = stack.as_mut();

let mut builder = Builder::new(stack);

builder.push("/init").unwrap();
let mut builder = builder.done().unwrap();

builder.push("HOME=/root").unwrap();
let mut builder = builder.done().unwrap();

let auxv = [
    Entry::Gid(1000),
    Entry::Uid(1000),
    Entry::Platform("x86_64"),
    Entry::ExecFilename("/init"),
];
auxv.iter().for_each(|e| builder.push(e).unwrap());

let handle = builder.done().unwrap();

License: Apache-2.0

Commit count: 46

cargo fmt