| Crates.io | vtcode-process-hardening |
| lib.rs | vtcode-process-hardening |
| version | 0.59.2 |
| created_at | 2026-01-02 04:09:54.008651+00 |
| updated_at | 2026-01-08 02:51:59.629083+00 |
| description | Process hardening and security measures for VT Code |
| homepage | |
| repository | https://github.com/vinhnx/vtcode |
| max_upload_size | |
| id | 2017926 |
| size | 10,900 |
This crate provides pre_main_hardening(), which is designed to be called pre-main() (using #[ctor::ctor]) to perform various process hardening steps, such as:
LD_PRELOAD and DYLD_*Add to your binary's Cargo.toml:
[dependencies]
ctor = "0.2"
vtcode-process-hardening = { path = "../vtcode-process-hardening" }
In your main.rs:
#[ctor::ctor]
fn init() {
vtcode_process_hardening::pre_main_hardening();
}
fn main() {
// Your code here
}
LD_PRELOAD and similar variables that could subvert library loadingunsafe libc functions but validates all return codes and exits cleanly on failurestd::env::vars_os() to handle non-UTF-8 variable names correctly