Skip to content

Commit

Permalink
antidec: better chained expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
0x08088405 committed Dec 3, 2019
1 parent 0ad6f17 commit 47b2227
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions gm8exe/src/gamedata/antidec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ pub fn decrypt(data: &mut io::Cursor<&mut [u8]>, settings: AntidecMetadata) -> i
let mut value = u32::from_le_bytes(*chunk);

// apply masks, bswap
value ^= xor_mask;
value = value.wrapping_add(add_mask);
value = value.swap_bytes();
value = (value ^ xor_mask).wrapping_add(add_mask).swap_bytes();

// cycle masks
xor_mask = xor_mask.wrapping_sub(settings.sub_mask);
Expand Down

0 comments on commit 47b2227

Please sign in to comment.