stack_replace

Crates.iostack_replace
lib.rsstack_replace
version0.1.1
sourcesrc
created_at2023-04-11 08:14:08.137781
updated_at2023-04-11 08:23:12.935905
descriptionsimple container cli and lib!
homepagehttps://github.com/wszxl516/replace_stack.git
repositoryhttps://github.com/wszxl516/replace_stack.git
max_upload_size
id835877
size5,405
cross (wszxl516)

documentation

README

example replace argv[0] in stack

    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]");
        }
    }
Commit count: 3

cargo fmt