aboutsummaryrefslogtreecommitdiffstats
path: root/pySim-read.py
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-07-28 05:26:02 +0700
committerfixeria <vyanitskiy@sysmocom.de>2020-09-20 06:58:36 +0000
commitdfe3dbb11700998b52e62906a3a0942670cb49d3 (patch)
tree3e18894c1d8bb8d3ba5ff57bf65e12f0491059ba /pySim-read.py
parenta562ea0351ed7e58bb8784e53bdc34f6fb669a65 (diff)
pySim-read.py: decode contents of EF.AD (Administrative data)
Diffstat (limited to 'pySim-read.py')
-rwxr-xr-xpySim-read.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/pySim-read.py b/pySim-read.py
index d6674a5..2ca0557 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -28,7 +28,7 @@ import os
import random
import re
import sys
-from pySim.ts_51_011 import EF, DF, EF_SST_map
+from pySim.ts_51_011 import EF, DF, EF_SST_map, EF_AD_mode_map
from pySim.ts_31_102 import EF_UST_map, EF_USIM_ADF_map
from pySim.ts_31_103 import EF_IST_map
@@ -225,7 +225,15 @@ if __name__ == '__main__':
# EF.AD
(res, sw) = card.read_binary('AD')
if sw == '9000':
- print("AD: %s" % (res,))
+ print("Administrative data: %s" % (res,))
+ if res[:2] in EF_AD_mode_map:
+ print("\tMS operation mode: %s" % (EF_AD_mode_map[res[:2]],))
+ else:
+ print("\tMS operation mode: (unknown 0x%s)" % (res[:2],))
+ if int(res[4:6], 16) & 0x01:
+ print("\tCiphering Indicator: enabled")
+ else:
+ print("\tCiphering Indicator: disabled")
else:
print("AD: Can't read, response code = %s" % (sw,))