mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-22 07:58:22 +08:00
Fix #152, caused by multiple body match
This commit is contained in:
parent
e1c0b08fc0
commit
d9325c22fe
@ -109,28 +109,31 @@ USTATUS FfsDumper::recursiveDump(const UModelIndex & index, const UString & path
|
||||
fileIndex = index;
|
||||
}
|
||||
|
||||
fileList.insert(fileIndex);
|
||||
// We may select parent file during ffs extraction.
|
||||
if (fileList.count(fileIndex) == 0) {
|
||||
fileList.insert(fileIndex);
|
||||
|
||||
UString filename;
|
||||
if (counterRaw == 0)
|
||||
filename = usprintf("%s/file.ffs", path.toLocal8Bit());
|
||||
else
|
||||
filename = usprintf("%s/file_%d.ffs", path.toLocal8Bit(), counterRaw);
|
||||
counterRaw++;
|
||||
UString filename;
|
||||
if (counterRaw == 0)
|
||||
filename = usprintf("%s/file.ffs", path.toLocal8Bit());
|
||||
else
|
||||
filename = usprintf("%s/file_%d.ffs", path.toLocal8Bit(), counterRaw);
|
||||
counterRaw++;
|
||||
|
||||
std::ofstream file(filename.toLocal8Bit(), std::ofstream::binary);
|
||||
if (!file)
|
||||
return U_FILE_OPEN;
|
||||
std::ofstream file(filename.toLocal8Bit(), std::ofstream::binary);
|
||||
if (!file)
|
||||
return U_FILE_OPEN;
|
||||
|
||||
const UByteArray &headerData = model->header(fileIndex);
|
||||
const UByteArray &bodyData = model->body(fileIndex);
|
||||
const UByteArray &tailData = model->tail(fileIndex);
|
||||
const UByteArray &headerData = model->header(fileIndex);
|
||||
const UByteArray &bodyData = model->body(fileIndex);
|
||||
const UByteArray &tailData = model->tail(fileIndex);
|
||||
|
||||
file.write(headerData.constData(), headerData.size());
|
||||
file.write(bodyData.constData(), bodyData.size());
|
||||
file.write(tailData.constData(), tailData.size());
|
||||
file.write(headerData.constData(), headerData.size());
|
||||
file.write(bodyData.constData(), bodyData.size());
|
||||
file.write(tailData.constData(), tailData.size());
|
||||
|
||||
dumped = true;
|
||||
dumped = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user