mirror of
https://github.com/wh201906/Proxmark3GUI.git
synced 2026-07-14 22:55:32 +08:00
Refactor project structure
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
#include "mifare.h"
|
||||
|
||||
Mifare::Mifare(Util *addr,QObject *parent) : QObject(parent)
|
||||
{
|
||||
util=addr;
|
||||
isProcessingData=false;
|
||||
isProcessingKey=false;
|
||||
}
|
||||
|
||||
void Mifare::processData(const QString str)
|
||||
{
|
||||
if(isProcessingData)
|
||||
{
|
||||
if(inputType==FROM_RDBL)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
void Mifare::processKey(const QString str)
|
||||
{
|
||||
if(isProcessingKey)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
void Mifare::setProcessingState(ProcessingState st)
|
||||
{
|
||||
if(st==Mifare::NONE)
|
||||
{
|
||||
isProcessingKey=false;
|
||||
isProcessingData=false;
|
||||
}
|
||||
else if(st==Mifare::KEY)
|
||||
{
|
||||
isProcessingKey=true;
|
||||
isProcessingData=false;
|
||||
}
|
||||
else if(st==Mifare::DATA)
|
||||
{
|
||||
isProcessingKey=false;
|
||||
isProcessingData=true;
|
||||
}
|
||||
}
|
||||
void Mifare::setInputType(InputType tp)
|
||||
{
|
||||
inputType=tp;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef MIFARE_H
|
||||
#define MIFARE_H
|
||||
|
||||
#include "common/util.h"
|
||||
#include <QObject>
|
||||
|
||||
class Mifare : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Mifare(Util *addr,QObject *parent = nullptr);
|
||||
enum ProcessingState
|
||||
{
|
||||
NONE,
|
||||
DATA,
|
||||
KEY,
|
||||
};
|
||||
enum InputType
|
||||
{
|
||||
FROM_RDBL,
|
||||
FROM_RDSC,
|
||||
FROM_CHK,
|
||||
FROM_NESTED,
|
||||
};
|
||||
|
||||
void setProcessingState(ProcessingState st);
|
||||
void setInputType(InputType tp);
|
||||
public slots:
|
||||
void processData(const QString str);
|
||||
void processKey(const QString str);
|
||||
signals:
|
||||
|
||||
private:
|
||||
Util* util;
|
||||
bool isProcessingData=false;
|
||||
bool isProcessingKey=false;
|
||||
InputType inputType;
|
||||
QStringList dataList;
|
||||
QStringList keyList[2];
|
||||
};
|
||||
|
||||
#endif // MIFARE_H
|
||||
Reference in New Issue
Block a user