227,7 → 227,7 |
HeaderCRC32 dd ? |
; Set this field to zero, compute CRC32 via 0xEDB88320, compare. |
Reserved dd ? |
; Must be zero. |
; Myst be zero. |
MyLBA dq ? |
; LBA of the sector containing this GPT header. |
AlternateLBA dq ? |
846,7 → 846,6 |
; This function is called from disk_scan_partitions to validate and parse |
; primary and backup GPTs. |
proc disk_scan_gpt |
push ecx |
; Scan primary GPT (second sector) |
stdcall scan_gpt, 1, 0 |
test eax, eax |
865,7 → 864,6 |
DEBUGF 1, 'K : Backup GPT is also corrupt, fallback to legacy MBR\n' |
.exit: |
; Return value is ZF |
pop ecx |
ret |
endp |
|
957,8 → 955,8 |
mov al, DISKFUNC.read |
stdcall disk_call_driver, edi, dword[ebx+GPTH.PartitionEntryLBA+0], \ |
dword[ebx+GPTH.PartitionEntryLBA+4], esp |
pop ecx |
test eax, eax |
pop eax |
jnz .fail_free_gpea_gpt |
; Compute and check CRC32 of GPEA |
mov edx, [ebx+GPTH.PartitionEntryArrayCRC32] |
1011,12 → 1009,12 |
is_protective_mbr: |
push ecx edi |
xor eax, eax |
; cmp [ecx-6], eax |
; jnz .exit |
cmp [ecx-2], ax |
cmp [ecx-6], eax |
jnz .exit |
cmp [ecx-2], eax |
jnz .exit |
; Partition record 0 has specific fields |
cmp [ecx+0], al |
cmp dword[ecx+0], 0x00020000 |
jnz .exit |
cmp byte[ecx+4], 0xEE |
jnz .exit |