apply patch work started
This commit is contained in:
parent
b8d7fff36a
commit
073b4a1eb8
23
src/patch.rs
Normal file
23
src/patch.rs
Normal file
@ -0,0 +1,23 @@
|
||||
use std::fs::File;
|
||||
use std::io::{Read, Seek, SeekFrom};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use byteorder::*;
|
||||
|
||||
pub fn apply_ips(ips_file: PathBuf, binary: PathBuf) {
|
||||
match ips_file.exists() || binary.exists() {
|
||||
true => {
|
||||
let mut ips = File::open(ips_file).unwrap();
|
||||
let mut bin = File::open(binary).unwrap();
|
||||
|
||||
let mut ips_str = String::new();
|
||||
let mut bin_str = String::new();
|
||||
ips.read_to_string(&mut ips_str).unwrap();
|
||||
bin.read_to_string(&mut bin_str).unwrap();
|
||||
|
||||
ips.seek(SeekFrom::Start(5)).unwrap();
|
||||
println!("{:?}", ips.read_f32::<BigEndian>().unwrap());
|
||||
},
|
||||
false => panic!("\u{1F926}"),
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user