Fix directory creation error in UEFIExtract default mode

This commit is contained in:
vit9696 2019-03-08 03:07:58 +03:00
parent e7455409ff
commit 2cbd78fb9e
2 changed files with 8 additions and 3 deletions

View File

@ -165,6 +165,7 @@ USTATUS FfsDumper::recursiveDump(const UModelIndex & index, const UString & path
} }
USTATUS result; USTATUS result;
for (int i = 0; i < model->rowCount(index); i++) { for (int i = 0; i < model->rowCount(index); i++) {
UModelIndex childIndex = index.child(i, 0); UModelIndex childIndex = index.child(i, 0);
bool useText = FALSE; bool useText = FALSE;
@ -172,9 +173,13 @@ USTATUS FfsDumper::recursiveDump(const UModelIndex & index, const UString & path
useText = !model->text(childIndex).isEmpty(); useText = !model->text(childIndex).isEmpty();
UString childPath = path; 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, childPath = usprintf("%s/%d %s", path.toLocal8Bit(), i,
(useText ? model->text(childIndex) : model->name(childIndex)).toLocal8Bit()); (useText ? model->text(childIndex) : model->name(childIndex)).toLocal8Bit());
}
result = recursiveDump(childIndex, childPath, dumpMode, sectionType, guid); result = recursiveDump(childIndex, childPath, dumpMode, sectionType, guid);
if (result) if (result)
return result; return result;

View File

@ -233,8 +233,8 @@ USTATUS NvramParser::parseNvarStore(const UModelIndex & index)
nvarIndex = index.child(i, 0); nvarIndex = index.child(i, 0);
if (model->hasEmptyParsingData(nvarIndex) == false) { if (model->hasEmptyParsingData(nvarIndex) == false) {
UByteArray nvarData = model->parsingData(nvarIndex); UByteArray nvarData = model->parsingData(nvarIndex);
const NVAR_ENTRY_PARSING_DATA* nvarPdata = (const NVAR_ENTRY_PARSING_DATA*)nvarData.constData(); 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 if (nvarPdata.isValid && nvarPdata.next + model->offset(nvarIndex) - localOffset == offset) { // Previous link is present and valid
isInvalidLink = false; isInvalidLink = false;
break; break;
} }