Fix bug(lengthCheck,decodeAPPIDs)

(cherry picked from commit d6ea321)
This commit is contained in:
chenzitai
2018-08-15 23:14:58 +01:00
parent 336a32d1e7
commit 070ed1556b
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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
return note