mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-20 02:05:32 -04:00
NE Alpha 36
This commit is contained in:
parent
4160a6a580
commit
0e60013311
7 changed files with 52 additions and 20 deletions
|
@ -1063,7 +1063,7 @@ USTATUS FfsParser::parseVolumeHeader(const UByteArray & volume, const UINT32 loc
|
|||
}
|
||||
index = model->addItem(model->offset(parent) + localOffset, Types::Volume, subtype, name, text, info, header, body, UByteArray(), Fixed, parent);
|
||||
|
||||
// Set parsing data for created item
|
||||
// Set parsing data for created volume
|
||||
VOLUME_PARSING_DATA pdata;
|
||||
pdata.emptyByte = emptyByte;
|
||||
pdata.ffsVersion = ffsVersion;
|
||||
|
@ -1488,6 +1488,8 @@ USTATUS FfsParser::parseFileHeader(const UByteArray & file, const UINT32 localOf
|
|||
FILE_PARSING_DATA pdata;
|
||||
pdata.emptyByte = (fileHeader->State & EFI_FILE_ERASE_POLARITY) ? 0xFF : 0x00;
|
||||
pdata.guid = fileHeader->Name;
|
||||
model->setParsingData(index, UByteArray((const char*)&pdata, sizeof(pdata)));
|
||||
|
||||
|
||||
// Override lastVtf index, if needed
|
||||
if (isVtf) {
|
||||
|
@ -2904,6 +2906,7 @@ USTATUS FfsParser::parseFit(const UModelIndex & index, const UINT32 diff)
|
|||
UString info;
|
||||
for (UINT32 i = 1; i < fitHeader->Size; i++) {
|
||||
currentStrings.clear();
|
||||
info.clear();
|
||||
const FIT_ENTRY* currentEntry = fitHeader + i;
|
||||
UINT32 currentEntrySize = currentEntry->Size;
|
||||
|
||||
|
@ -2916,13 +2919,13 @@ USTATUS FfsParser::parseFit(const UModelIndex & index, const UINT32 diff)
|
|||
case FIT_TYPE_EMPTY:
|
||||
break;
|
||||
|
||||
case FIT_TYPE_MICROCODE:
|
||||
case FIT_TYPE_MICROCODE: {
|
||||
//TODO: refactor into function with error reporting
|
||||
if (currentEntry->Address > diff && currentEntry->Address < 0xFFFFFFFFUL) {
|
||||
UINT32 offset = currentEntry->Address - diff;
|
||||
UModelIndex mcIndex = model->findByOffset(offset);
|
||||
UByteArray mcFile = model->header(mcIndex) + model->body(mcIndex) + model->tail(mcIndex);
|
||||
|
||||
|
||||
UINT32 mcOffset = offset - model->offset(mcIndex);
|
||||
if (mcOffset + sizeof(INTEL_MICROCODE_HEADER) <= (UINT32)mcFile.size()) {
|
||||
const INTEL_MICROCODE_HEADER* header = (const INTEL_MICROCODE_HEADER*)(mcFile.constData() + mcOffset);
|
||||
|
@ -2936,7 +2939,7 @@ USTATUS FfsParser::parseFit(const UModelIndex & index, const UINT32 diff)
|
|||
if (reservedBytesValid) {
|
||||
UINT32 mcSize = header->TotalSize;
|
||||
if (mcOffset + mcSize <= (UINT32)mcFile.size()) {
|
||||
info = usprintf("LocalOffset %08Xh, CPUID %Xh, Revision %Xh, Date %08Xh",
|
||||
info = usprintf("LocalOffset %08Xh, CPUID %08Xh, Revision %08Xh, Date %08Xh",
|
||||
mcOffset,
|
||||
header->CpuSignature,
|
||||
header->Revision,
|
||||
|
@ -2948,7 +2951,7 @@ USTATUS FfsParser::parseFit(const UModelIndex & index, const UINT32 diff)
|
|||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
|
||||
case FIT_TYPE_BIOS_AC_MODULE:
|
||||
case FIT_TYPE_BIOS_INIT_MODULE:
|
||||
|
|
|
@ -57,7 +57,6 @@ USTATUS NvramParser::parseNvarStore(const UModelIndex & index)
|
|||
|
||||
bool isInvalid = false;
|
||||
bool isInvalidLink = false;
|
||||
//bool isDataOnly = false;
|
||||
bool hasExtendedHeader = false;
|
||||
bool hasChecksum = false;
|
||||
bool hasTimestamp = false;
|
||||
|
@ -113,7 +112,7 @@ USTATUS NvramParser::parseNvarStore(const UModelIndex & index)
|
|||
// Add GUID store area
|
||||
UByteArray guidArea = data.right(guidAreaSize);
|
||||
// Get info
|
||||
name = UString("GUID store area");
|
||||
name = UString("GUID store");
|
||||
info = usprintf("Full size: %Xh (%u)\nGUIDs in store: %u",
|
||||
guidArea.size(), guidArea.size(),
|
||||
guidsInStore);
|
||||
|
@ -412,8 +411,7 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index)
|
|||
UINT32 storeOffset = prevStoreOffset;
|
||||
UINT32 prevStoreSize = 0;
|
||||
|
||||
while (!result)
|
||||
{
|
||||
while (!result) {
|
||||
// Padding between stores
|
||||
if (storeOffset > prevStoreOffset + prevStoreSize) {
|
||||
UINT32 paddingOffset = prevStoreOffset + prevStoreSize;
|
||||
|
@ -476,7 +474,6 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index)
|
|||
info = usprintf("Full size: %Xh (%u)", padding.size(), padding.size());
|
||||
|
||||
if (padding.count(emptyByte) == padding.size()) { // Free space
|
||||
|
||||
// Add tree item
|
||||
model->addItem(localOffset + storeOffset, Types::FreeSpace, 0, UString("Free space"), UString(), info, UByteArray(), padding, UByteArray(), Movable, index);
|
||||
}
|
||||
|
@ -781,7 +778,7 @@ USTATUS NvramParser::parseFtwStoreHeader(const UByteArray & store, const UINT32
|
|||
if (parentVolumeIndex.isValid() && model->hasEmptyParsingData(parentVolumeIndex) == false) {
|
||||
UByteArray data = model->parsingData(parentVolumeIndex);
|
||||
const VOLUME_PARSING_DATA* pdata = (const VOLUME_PARSING_DATA*)data.constData();
|
||||
emptyByte = pdata->ffsVersion;
|
||||
emptyByte = pdata->emptyByte;
|
||||
}
|
||||
|
||||
// Get FTW block headers
|
||||
|
@ -1185,7 +1182,7 @@ USTATUS NvramParser::parseIntelMicrocodeHeader(const UByteArray & store, const U
|
|||
|
||||
// Add info
|
||||
UString name("Intel microcode");
|
||||
UString info = usprintf("\nFull size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\n"
|
||||
UString info = usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\n"
|
||||
"Date: %08Xh\nCPU signature: %08Xh\nRevision: %08Xh\nChecksum: %08Xh\nLoader revision: %08Xh\nCPU flags: %08Xh",
|
||||
ucodeHeader->TotalSize, ucodeHeader->TotalSize,
|
||||
header.size(), header.size(),
|
||||
|
@ -1262,7 +1259,7 @@ USTATUS NvramParser::parseVssStoreBody(const UModelIndex & index)
|
|||
if (parentVolumeIndex.isValid() && model->hasEmptyParsingData(parentVolumeIndex) == false) {
|
||||
UByteArray data = model->parsingData(parentVolumeIndex);
|
||||
const VOLUME_PARSING_DATA* pdata = (const VOLUME_PARSING_DATA*)data.constData();
|
||||
emptyByte = pdata->ffsVersion;
|
||||
emptyByte = pdata->emptyByte;
|
||||
}
|
||||
|
||||
// Get local offset
|
||||
|
@ -1553,7 +1550,7 @@ USTATUS NvramParser::parseEvsaStoreBody(const UModelIndex & index)
|
|||
if (parentVolumeIndex.isValid() && model->hasEmptyParsingData(parentVolumeIndex) == false) {
|
||||
UByteArray data = model->parsingData(parentVolumeIndex);
|
||||
const VOLUME_PARSING_DATA* pdata = (const VOLUME_PARSING_DATA*)data.constData();
|
||||
emptyByte = pdata->ffsVersion;
|
||||
emptyByte = pdata->emptyByte;
|
||||
}
|
||||
|
||||
// Get local offset
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue