#stack #elf #elf-binary #auxv #auxval

无std crt0stack

用于读取和创建Linux crt0堆栈数据的工具

1 个不稳定版本

0.1.0 2020年8月19日

#210无标准库

Download history 119/week @ 2024-03-29 132/week @ 2024-04-05 110/week @ 2024-04-12 94/week @ 2024-04-19 98/week @ 2024-04-26 39/week @ 2024-05-03 147/week @ 2024-05-10 143/week @ 2024-05-17 33/week @ 2024-05-24 34/week @ 2024-05-31 22/week @ 2024-06-07 32/week @ 2024-06-14 99/week @ 2024-06-21 24/week @ 2024-06-28 28/week @ 2024-07-05 159/week @ 2024-07-12

314 每月下载量
用于 6 个Crates(5 直接使用)

Apache-2.0

38KB
799 代码行数

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

crt0stack

创建初始堆栈帧以在Linux上启动ELF二进制文件

示例

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();

许可证: Apache-2.0

无运行时依赖

特性