Update image.sh

This commit is contained in:
Kroese
2026-08-03 03:56:00 +02:00
committed by GitHub
parent 8f4f64aeee
commit 9b21a4bd55
+28 -28
View File
@@ -1006,24 +1006,24 @@ readIsoImageInfo() {
fi fi
# Header size at offset 0x08. # Header size at offset 0x08.
header_size=$( header_size=$(( \
(bytes[8]) | bytes[8] |
(bytes[9] << 8) | bytes[9] << 8 |
(bytes[10] << 16) | bytes[10] << 16 |
(bytes[11] << 24) bytes[11] << 24
) ))
if (( header_size != 208 )); then if (( header_size != 208 )); then
return 1 return 1
fi fi
# WIM version at offset 0x0c. # WIM version at offset 0x0c.
version=$( version=$(( \
(bytes[12]) | bytes[12] |
(bytes[13] << 8) | bytes[13] << 8 |
(bytes[14] << 16) | bytes[14] << 16 |
(bytes[15] << 24) bytes[15] << 24
) ))
if (( version != 0x10d00 && if (( version != 0x10d00 &&
version != 0x0e00 )); then version != 0x0e00 )); then
@@ -1031,15 +1031,15 @@ readIsoImageInfo() {
fi fi
# Split-WIM information at offsets 0x28 and 0x2a. # Split-WIM information at offsets 0x28 and 0x2a.
part_number=$( part_number=$(( \
(bytes[40]) | bytes[40] |
(bytes[41] << 8) bytes[41] << 8
) ))
total_parts=$( total_parts=$(( \
(bytes[42]) | bytes[42] |
(bytes[43] << 8) bytes[43] << 8
) ))
if (( part_number == 0 || if (( part_number == 0 ||
total_parts == 0 || total_parts == 0 ||
@@ -1048,12 +1048,12 @@ readIsoImageInfo() {
fi fi
# Image count at offset 0x2c. # Image count at offset 0x2c.
image_count=$( image_count=$(( \
(bytes[44]) | bytes[44] |
(bytes[45] << 8) | bytes[45] << 8 |
(bytes[46] << 16) | bytes[46] << 16 |
(bytes[47] << 24) bytes[47] << 24
) ))
if (( image_count == 0 || if (( image_count == 0 ||
image_count > 65535 )); then image_count > 65535 )); then
@@ -1085,13 +1085,13 @@ readIsoImageInfo() {
return 1 return 1
fi fi
# These resource forms cannot be read as a direct UTF-16LE byte range: # These resource forms cannot be decoded as a direct UTF-16LE byte range:
# #
# 0x04: compressed # 0x04: compressed
# 0x08: spanned # 0x08: spanned
# 0x10: solid # 0x10: solid
# #
# The metadata flag 0x02 is expected and is deliberately allowed. # The metadata flag 0x02 is expected and deliberately allowed.
if (( xml_flags & 0x1c )); then if (( xml_flags & 0x1c )); then
return 1 return 1
fi fi