diff --git a/Software/Chameleon/Log.py b/Software/Chameleon/Log.py index da32bc8..524ecab 100644 --- a/Software/Chameleon/Log.py +++ b/Software/Chameleon/Log.py @@ -138,7 +138,7 @@ def parseBinary(binaryStream, decoder=None): note = "" # If we need to decode the data and paritybit check success - if (decoder!=None and logData[-1] != '!'): + if (decoder!=None and len(logData) >0 and logData[-1] != '!'): # Decode the data from Reader if(event == 0x44 or event == 0x45): note = iso14443_3.parseReader(binascii.a2b_hex(logData), decoder) diff --git a/Software/Chameleon/MFDESFire.py b/Software/Chameleon/MFDESFire.py index f66eee6..8237970 100644 --- a/Software/Chameleon/MFDESFire.py +++ b/Software/Chameleon/MFDESFire.py @@ -65,7 +65,7 @@ def decodeRespGetAPPID (data): dataLen = len(data) for i in range (0,int((dataLen-1)/3)): - note += "0x"+hexlify(data[3*i: 3*(i+1)]).decode()+"|" + note += "0x"+hexlify(data[1+3*i: 1+3*(i+1)]).decode()+"|" return note ############################## @@ -368,4 +368,4 @@ def MFDESFireDecode(data, source): else: note += MFDESFireCMDTypes[lastCMD]["RespDecoder"](data) - return note \ No newline at end of file + return note