You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Proxmark3GUI/module/mifare.cpp

61 lines
1.1 KiB
C++

5 years ago
#include "mifare.h"
Mifare::Mifare(Util *addr,QObject *parent) : QObject(parent)
5 years ago
{
util=addr;
5 years ago
isProcessingData=false;
isProcessingKey=false;
}
void Mifare::processData(const QString str)
{
if(isProcessingData)
{
if(inputType==FROM_RDBL)
{
}
5 years ago
}
}
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;
}
bool Mifare::isKeyValid(const QString key)
{
if(key.length() != 12)
return false;
for(int i = 0; i < 12; i++)
{
if(!((key[i] >= '0' && key[i] <= '9') || (key[i] >= 'A' && key[i] <= 'F')))
return false;
}
return true;
}