|
From: <lu...@us...> - 2012-09-28 12:27:21
|
Revision: 600
http://pyscard.svn.sourceforge.net/pyscard/?rev=600&view=rev
Author: ludov
Date: 2012-09-28 12:27:11 +0000 (Fri, 28 Sep 2012)
Log Message:
-----------
Display ASCII strings for multi-bytes values
After most of the hex dumps of data we also display an ASCII string
equivalent since the data may be or contain text.
Modified Paths:
--------------
trunk/contrib/parseATR/parseATR.py
Modified: trunk/contrib/parseATR/parseATR.py
===================================================================
--- trunk/contrib/parseATR/parseATR.py 2012-09-28 09:23:49 UTC (rev 599)
+++ trunk/contrib/parseATR/parseATR.py 2012-09-28 12:27:11 UTC (rev 600)
@@ -538,15 +538,21 @@
elif tag == 4:
text.append(" (initial access data)\n")
- text.append(" Initial access data: " + toHexString(historical_bytes[:len]) + "\n")
+ text.append(" Initial access data: " +
+ toHexString(historical_bytes[:len]) + " \"" +
+ toASCIIString(historical_bytes[:len]) + "\"\n")
elif tag == 5:
text.append(" (card issuer's data)\n")
- text.append(" Card issuer data: " + toHexString(historical_bytes[:len]) + "\n")
+ text.append(" Card issuer data: " +
+ toHexString(historical_bytes[:len]) + " \"" +
+ toASCIIString(historical_bytes[:len]) + "\"\n")
elif tag == 6:
text.append(" (pre-issuing data)\n")
- text.append(" Data: " + toHexString(historical_bytes[:len]) + "\n")
+ text.append(" Data: " +
+ toHexString(historical_bytes[:len]) + " \"" +
+ toASCIIString(historical_bytes[:len]) + "\"\n")
elif tag == 7:
text.append(" (card capabilities)\n")
@@ -596,11 +602,15 @@
elif tag == 15:
text.append(" (application identifier)\n")
- text.append(" Application identifier: " + toHexString(historical_bytes[:len]))
+ text.append(" Application identifier: " +
+ toHexString(historical_bytes[:len]) + " \"" +
+ toASCIIString(historical_bytes[:len]) + "\"\n")
else:
text.append(" (unknown)\n")
- text.append(" Value: " + toHexString(historical_bytes[:len]))
+ text.append(" Value: " +
+ toHexString(historical_bytes[:len]) + " \"" +
+ toASCIIString(historical_bytes[:len]) + "\"\n")
# consume len bytes of historic
del historical_bytes[0:len]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|