| 1396 | } |
| 1397 | |
| 1398 | UINT8 FfsEngine::getSectionSize(const QByteArray & file, const UINT32 sectionOffset, UINT32 & sectionSize) |
| 1399 | { |
| 1400 | if ((UINT32)file.size() < sectionOffset + sizeof(EFI_COMMON_SECTION_HEADER)) |
| 1401 | return ERR_INVALID_FILE; |
| 1402 | |
| 1403 | const EFI_COMMON_SECTION_HEADER* sectionHeader = (const EFI_COMMON_SECTION_HEADER*)(file.constData() + sectionOffset); |
| 1404 | sectionSize = uint24ToUint32(sectionHeader->Size); |
| 1405 | // This may introduce a very rare error with a non-extended section of size equal to 0xFFFFFF |
| 1406 | if (sectionSize != 0xFFFFFF) |
| 1407 | return ERR_SUCCESS; |
| 1408 | |
| 1409 | if ((UINT32)file.size() < sectionOffset + sizeof(EFI_COMMON_SECTION_HEADER2)) |
| 1410 | return ERR_INVALID_FILE; |
| 1411 | |
| 1412 | const EFI_COMMON_SECTION_HEADER2* sectionHeader2 = (const EFI_COMMON_SECTION_HEADER2*)(file.constData() + sectionOffset); |
| 1413 | sectionSize = sectionHeader2->ExtendedSize; |
| 1414 | return ERR_SUCCESS; |
| 1415 | } |
| 1416 | |
| 1417 | UINT8 FfsEngine::parseSections(const QByteArray & body, const QModelIndex & parent) |
| 1418 | { |
nothing calls this directly
no test coverage detected