mirror of
https://github.com/hak5/wifipineapple-openwrt.git
synced 2025-10-29 16:57:19 +00:00
firmware-utils/mkdir615h1: fix magic XOR calculation
Signed-off-by: Forest Crossman <cyrozap@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41314 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
b5f47d40c1
commit
a0b76f9456
@ -199,7 +199,7 @@ static int encode_image(const char *input_file_name,
|
||||
}
|
||||
|
||||
for (i = 0; i < bytes_read; i++)
|
||||
buf[i] ^= magic >> ((((i >> 60) + i) & 7) - (i >> 60));
|
||||
buf[i] ^= magic >> (i % 8) & 0xff;
|
||||
fwrite(&buf, bytes_read, 1, fp_output);
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ int decode_image(const char *input_file_name, const char *output_file_name)
|
||||
|
||||
bytes_read = fread(&buf, 1, BUF_SIZE, fp_input);
|
||||
for (i = 0; i < bytes_read; i++)
|
||||
buf[i] ^= header.magic >> ((((i >> 60) + i) & 7) - (i >> 60));
|
||||
buf[i] ^= header.magic >> (i % 8) & 0xff;
|
||||
|
||||
/*
|
||||
* Handle padded source file
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user