VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Boot/Windows/BootSector.asm
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-09-12 23:46:56 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-09-13 01:14:17 +0200
commit22152878f883cb7d1e9ac56a5f59329afd26302b (patch)
tree8f07cba26ab61e09d93005628adb81620fd7d273 /src/Boot/Windows/BootSector.asm
parent89a7fad16d06b271dab13f8c63dfaa95dbdf398b (diff)
downloadVeraCrypt-22152878f883cb7d1e9ac56a5f59329afd26302b.tar.gz
VeraCrypt-22152878f883cb7d1e9ac56a5f59329afd26302b.zip
Windows Bootloader: pass correct compressed data size to decompressor and use shorter string to keep a valid memory layout for boot sector.
Diffstat (limited to 'src/Boot/Windows/BootSector.asm')
-rw-r--r--src/Boot/Windows/BootSector.asm5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Boot/Windows/BootSector.asm b/src/Boot/Windows/BootSector.asm
index eb4418fa..1e0df327 100644
--- a/src/Boot/Windows/BootSector.asm
+++ b/src/Boot/Windows/BootSector.asm
@@ -106,7 +106,7 @@ non_backup:
call checksum
; Verify checksum
- cmp ebx, dword ptr [start + TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET]
+ cmp ebx, dword ptr [start + TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET]
je checksum_ok
; Checksum incorrect - try using backup if available
@@ -139,6 +139,7 @@ checksum_ok:
; Decompress boot loader
mov cx, word ptr [start + TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET]
+ sub cx, TC_GZIP_HEADER_SIZE
push cx ; Compressed data size
push TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET + TC_GZIP_HEADER_SIZE ; Compressed data
push TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE ; Output buffer size
@@ -234,7 +235,7 @@ checksum:
backup_loader_used db 0
disk_error_msg db 'Disk error', 13, 10, 7, 0
-loader_damaged_msg db 7, 'Loader damaged! Use Rescue Disk: Repair Options > Restore', 0
+loader_damaged_msg db 7, 'Loader damaged! Repair with Rescue Disk', 0
ORG 7C00h + 510
dw 0AA55h ; Boot sector signature