diff --git a/UEFIExtract/ffsdumper.cpp b/UEFIExtract/ffsdumper.cpp index 9b6096b..addbc61 100644 --- a/UEFIExtract/ffsdumper.cpp +++ b/UEFIExtract/ffsdumper.cpp @@ -165,6 +165,7 @@ USTATUS FfsDumper::recursiveDump(const UModelIndex & index, const UString & path } USTATUS result; + for (int i = 0; i < model->rowCount(index); i++) { UModelIndex childIndex = index.child(i, 0); bool useText = FALSE; @@ -172,9 +173,13 @@ USTATUS FfsDumper::recursiveDump(const UModelIndex & index, const UString & path useText = !model->text(childIndex).isEmpty(); UString childPath = path; - if (dumpMode == DUMP_ALL || dumpMode == DUMP_CURRENT) + if (dumpMode == DUMP_ALL || dumpMode == DUMP_CURRENT) { + if (!changeDirectory(path) && !makeDirectory(path)) + return U_DIR_CREATE; + childPath = usprintf("%s/%d %s", path.toLocal8Bit(), i, (useText ? model->text(childIndex) : model->name(childIndex)).toLocal8Bit()); + } result = recursiveDump(childIndex, childPath, dumpMode, sectionType, guid); if (result) return result; diff --git a/common/nvramparser.cpp b/common/nvramparser.cpp index 0d90b29..abaf6d7 100644 --- a/common/nvramparser.cpp +++ b/common/nvramparser.cpp @@ -233,8 +233,8 @@ USTATUS NvramParser::parseNvarStore(const UModelIndex & index) nvarIndex = index.child(i, 0); if (model->hasEmptyParsingData(nvarIndex) == false) { UByteArray nvarData = model->parsingData(nvarIndex); - const NVAR_ENTRY_PARSING_DATA* nvarPdata = (const NVAR_ENTRY_PARSING_DATA*)nvarData.constData(); - if (nvarPdata->isValid && nvarPdata->next + model->offset(nvarIndex) - localOffset == offset) { // Previous link is present and valid + const NVAR_ENTRY_PARSING_DATA nvarPdata = readUnaligned((const NVAR_ENTRY_PARSING_DATA*)nvarData.constData()); + if (nvarPdata.isValid && nvarPdata.next + model->offset(nvarIndex) - localOffset == offset) { // Previous link is present and valid isInvalidLink = false; break; }