-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathPatchUtils.h
42 lines (36 loc) · 1005 Bytes
/
PatchUtils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef PATCHUTILS_H
#define PATCHUTILS_H
#include <QString>
enum PatchType
{
Binary = 0,
Assembly = 1,
C = 2,
C_dependency = 3
};
struct PatchEntryItem
{
QString FileName;
enum PatchType PatchType;
unsigned int HookAddress; // where to overwrite hookstring
QString HookString;
unsigned int PatchOffsetInHookString; // where the P is in the hookstring
unsigned int PatchAddress; // where the patch we insert into the ROM
QString SubstitutedBytes;
QString Description;
public:
int GetHookLength() const
{
int hookLen = HookString.length() / 2;
if(PatchOffsetInHookString != (unsigned int) -1) hookLen += 4;
return hookLen;
}
};
namespace PatchUtils
{
extern QString EABI_INSTALLATION;
QVector<struct PatchEntryItem> GetPatchesFromROM();
QString SavePatchesToROM(QVector<PatchEntryItem> entries);
bool VerifyEABI(QString *missing);
}
#endif // PATCHUTILS_H