mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-13 06:34:42 -04:00
Add FFS volume parser for non-AMI NVRAM areas
This commit is contained in:
parent
4e2a8f6bd7
commit
01e2e0877b
1 changed files with 33 additions and 1 deletions
|
@ -1250,8 +1250,40 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index,const UINT32
|
||||||
if (U_SUCCESS != ffsParser->parseIntelMicrocodeHeader(ucode, storeOffset, index, ucodeIndex)) {
|
if (U_SUCCESS != ffsParser->parseIntelMicrocodeHeader(ucode, storeOffset, index, ucodeIndex)) {
|
||||||
throw 0;
|
throw 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UINT32 storeSize = ucodeHeader->TotalSize;
|
||||||
|
|
||||||
storeOffset += ucodeHeader->TotalSize - 1;
|
storeOffset += storeSize - 1;
|
||||||
|
previousStoreEndOffset = storeOffset + 1;
|
||||||
|
continue;
|
||||||
|
} catch (...) {
|
||||||
|
// Parsing failed, try something else
|
||||||
|
}
|
||||||
|
|
||||||
|
// FFS volume
|
||||||
|
try {
|
||||||
|
// Check data size
|
||||||
|
if (volumeBodySize - storeOffset < sizeof(EFI_FIRMWARE_VOLUME_HEADER)) {
|
||||||
|
throw 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check volume header candidate
|
||||||
|
const EFI_FIRMWARE_VOLUME_HEADER* volumeHeader = (const EFI_FIRMWARE_VOLUME_HEADER*)(volumeBody.constData() + storeOffset);
|
||||||
|
if (volumeHeader->Signature != EFI_FV_SIGNATURE) {
|
||||||
|
throw 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// All checks passed, volume found
|
||||||
|
UByteArray volume = volumeBody.mid(storeOffset);
|
||||||
|
UModelIndex volumeIndex;
|
||||||
|
if (U_SUCCESS != ffsParser->parseVolumeHeader(volume, storeOffset, index, volumeIndex)) {
|
||||||
|
throw 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
(VOID)ffsParser->parseVolumeBody(volumeIndex);
|
||||||
|
UINT32 storeSize = (UINT32)(model->header(volumeIndex).size() + model->body(volumeIndex).size());
|
||||||
|
|
||||||
|
storeOffset += storeSize - 1;
|
||||||
previousStoreEndOffset = storeOffset + 1;
|
previousStoreEndOffset = storeOffset + 1;
|
||||||
continue;
|
continue;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue