diff --git a/src/main.rs b/src/main.rs index b9b6a23..fd2be85 100644 --- a/src/main.rs +++ b/src/main.rs @@ -199,12 +199,12 @@ fn apply_code(patch_file : &str, codes : &Vec<(u32, u32)>) -> Result<(), String> let addr_diff = codes[pos + 2].1 & 0xffff; let val_diff = codes[pos + 3].1; while count != 0 { - if first_code & 0xf000000 == 0x1000000 { + if first_code & 0x7000000 == 0x1000000 { if addr >= max_data_len { return Err(format!("apply code error at line {}: address overflow", line)); } data[addr] = (val & 0xff) as u8; - } else if first_code & 0xf000000 == 0x2000000 { + } else if first_code & 0x7000000 == 0x2000000 { if addr + 1 >= max_data_len { return Err(format!("apply code error at line {}: address overflow", line)); }