Crates.io | stack_replace |
lib.rs | stack_replace |
version | 0.1.1 |
source | src |
created_at | 2023-04-11 08:14:08.137781 |
updated_at | 2023-04-11 08:23:12.935905 |
description | simple container cli and lib! |
homepage | https://github.com/wszxl516/replace_stack.git |
repository | https://github.com/wszxl516/replace_stack.git |
max_upload_size | |
id | 835877 |
size | 5,405 |
int main(int argc, char *argv[]){
argv[0] = "[new_name]";
return 0;
}
use stack_replace::ReplaceStack;
fn main() {
let args = std::env::args();
let args_str = args.collect::<Vec<String>>();
let st = ReplaceStack::new().unwrap();
let argv_addr = st.find_string_addr(&args_str[0]).unwrap();
println!("argv: {:?}", argv_addr);
for addr in argv_addr {
ReplaceStack::replace_string(addr, "[new_name]");
}
}