-
Notifications
You must be signed in to change notification settings - Fork 4
/
chipid.h
38 lines (30 loc) · 878 Bytes
/
chipid.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
#ifndef CHIPID_H
#define CHIPID_H
#include <QObject>
#include <QIODevice>
#include <QPair>
#include <stdint.h>
class ChipID : public QObject
{
Q_OBJECT
public:
struct ChipInfo
{
QString manufacturer;
uint16_t manufacturerID;
QString product;
uint16_t productID;
uint8_t width;
uint32_t capacity;
QList<QPair<uint16_t, uint32_t> > sectors;
bool unlockShifted;
};
explicit ChipID(QString filePath, QObject *parent = NULL);
bool findChips(QList<uint8_t> manufacturersStraight, QList<uint8_t> devicesStraight, QList<uint8_t> manufacturersShifted, QList<uint8_t> devicesShifted, QList<ChipInfo> &info);
private:
void loadChips(QIODevice &file);
static uint32_t decodeSectorSize(QString sizeString);
ChipInfo dummyChipInfo;
QList<ChipInfo> allChips;
};
#endif // CHIPID_H