mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-27 21:44:24 -04:00
UEFIExtract 0.3.0
- added filtering by FFS file GUID, only specified files can now be unpacked
This commit is contained in:
parent
754f9c5b13
commit
701717c554
5 changed files with 99 additions and 64 deletions
|
@ -24,30 +24,36 @@ UEFIExtract::~UEFIExtract()
|
|||
delete ffsEngine;
|
||||
}
|
||||
|
||||
UINT8 UEFIExtract::extractAll(QString path)
|
||||
UINT8 UEFIExtract::init(const QString & path)
|
||||
{
|
||||
QFileInfo fileInfo = QFileInfo(path);
|
||||
fileInfo = QFileInfo(path);
|
||||
|
||||
if (!fileInfo.exists())
|
||||
return ERR_FILE_OPEN;
|
||||
if (!fileInfo.exists())
|
||||
return ERR_FILE_OPEN;
|
||||
|
||||
QFile inputFile;
|
||||
inputFile.setFileName(path);
|
||||
QFile inputFile;
|
||||
inputFile.setFileName(path);
|
||||
|
||||
if (!inputFile.open(QFile::ReadOnly))
|
||||
return ERR_FILE_OPEN;
|
||||
if (!inputFile.open(QFile::ReadOnly))
|
||||
return ERR_FILE_OPEN;
|
||||
|
||||
QByteArray buffer = inputFile.readAll();
|
||||
inputFile.close();
|
||||
QByteArray buffer = inputFile.readAll();
|
||||
inputFile.close();
|
||||
|
||||
UINT8 result = ffsEngine->parseImageFile(buffer);
|
||||
if (result)
|
||||
return result;
|
||||
UINT8 result = ffsEngine->parseImageFile(buffer);
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
return ERR_SUCCESS;
|
||||
}
|
||||
|
||||
UINT8 UEFIExtract::extract(QString guid)
|
||||
{
|
||||
QModelIndex rootIndex = ffsEngine->treeModel()->index(0, 0);
|
||||
result = ffsEngine->dump(rootIndex, fileInfo.fileName().append(".dump"));
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
UINT8 result = ffsEngine->dump(rootIndex, fileInfo.fileName().append(".dump"), guid);
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
return ERR_SUCCESS;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue