binkit 0.1.1

A modular toolbox for analyzing, disassembling, and patching binary formats
Documentation
1
2
3
4
5
6
7
8
9
10
11
use std::os::unix::fs::PermissionsExt;
use std::fs;
use clap::Error;

pub fn save_file(file: &str, buf: &[u8]) -> Result<(), Error>{
    let _ = fs::write(file, buf);
    let mut perms = fs::metadata(file)?.permissions();
    perms.set_mode(0o755); 
    fs::set_permissions(file, perms)?;
    Ok(())
}