2014-06-19 11:45:20 +08:00
|
|
|
/* uefipatch.h
|
|
|
|
|
|
|
|
Copyright (c) 2014, Nikolaj Schlej. All rights reserved.
|
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UEFIPATCH_H__
|
|
|
|
#define __UEFIPATCH_H__
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
#include <QFileInfo>
|
|
|
|
#include <QUuid>
|
|
|
|
|
|
|
|
#include "../basetypes.h"
|
|
|
|
#include "../ffs.h"
|
|
|
|
#include "../ffsengine.h"
|
|
|
|
|
|
|
|
class UEFIPatch : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit UEFIPatch(QObject *parent = 0);
|
|
|
|
~UEFIPatch();
|
|
|
|
|
2018-05-08 03:01:17 +08:00
|
|
|
UINT8 patchFromFile(QString path, QString patches);
|
2014-06-19 11:45:20 +08:00
|
|
|
UINT8 patch(QString path, QString fileGuid, QString findPattern, QString replacePattern);
|
|
|
|
|
|
|
|
private:
|
2014-07-05 20:56:56 +08:00
|
|
|
UINT8 patchFile(const QModelIndex & index, const QByteArray & fileGuid, const UINT8 sectionType, const QVector<PatchData> & patches);
|
2014-06-19 11:45:20 +08:00
|
|
|
FfsEngine* ffsEngine;
|
|
|
|
TreeModel* model;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|