Skip to content

Commit ead41ba

Browse files
committed
Version 0.15.0
- implemented PE and TE executables relocation for correct Boot Firmware Volume modification
1 parent 17ee8a4 commit ead41ba

File tree

6 files changed

+1108
-194
lines changed

6 files changed

+1108
-194
lines changed

basetypes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ typedef uint16_t CHAR16;
7676
#define ERR_UNKNOWN_COMPRESSION_ALGORITHM 26
7777
#define ERR_UNKNOWN_EXTRACT_MODE 27
7878
#define ERR_UNKNOWN_INSERT_MODE 28
79+
#define ERR_UNKNOWN_IMAGE_TYPE 29
80+
#define ERR_UNKNOWN_PE_OPTIONAL_HEADER_TYPE 30
81+
#define ERR_UNKNOWN_RELOCATION_TYPE 31
7982
#define ERR_NOT_IMPLEMENTED 0xFF
8083

8184
// Compression algorithms

ffsengine.cpp

Lines changed: 375 additions & 191 deletions
Large diffs are not rendered by default.

ffsengine.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ WITHWARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
2121
#include "basetypes.h"
2222
#include "treemodel.h"
2323
#include "messagelistitem.h"
24+
#include "peimage.h"
2425

2526
class TreeModel;
2627

@@ -66,7 +67,7 @@ class FfsEngine : public QObject
6667
// Construction routines
6768
UINT8 reconstructImage(QByteArray & reconstructed);
6869
UINT8 constructPadFile(const UINT32 size, const UINT8 revision, const UINT8 erasePolarity, QByteArray & pad);
69-
UINT8 reconstruct(const QModelIndex & index, QQueue<QByteArray> & queue, const UINT8 revision = 2, const UINT8 erasePolarity = ERASE_POLARITY_UNKNOWN);
70+
UINT8 reconstruct(const QModelIndex & index, QQueue<QByteArray> & queue, const UINT8 revision = 2, const UINT8 erasePolarity = ERASE_POLARITY_UNKNOWN, const UINT32 base = 0);
7071
UINT8 growVolume(QByteArray & header, const UINT32 size, UINT32 & newSize);
7172

7273
// Operations on tree items
@@ -86,6 +87,9 @@ class FfsEngine : public QObject
8687
UINT8 findTextPattern(const QString & pattern, const bool unicode, const Qt::CaseSensitivity caseSensitive);
8788
UINT8 findTextPatternIn(const QModelIndex & index, const QString & pattern, const bool unicode, const Qt::CaseSensitivity caseSensitive);
8889

90+
// Rebase routines
91+
UINT8 rebase(QByteArray & executable, const UINT32 base);
92+
8993
private:
9094
TreeModel *model;
9195

0 commit comments

Comments
 (0)