aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-02-15 15:41:55 +0100
committerHarald Welte <laforge@osmocom.org>2022-02-15 15:41:55 +0100
commit2bb17f3df9ffe7ac37df5455e4a1863a39d64546 (patch)
tree8fc3f7acc3a070ecb6f70d47d9ac9ba7429a2339
parent9e241435cc6a6b4b502ffe2e6cab7d12643cbc37 (diff)
pySim-shell: export: Add FCP template to export
The FCP template provides us a lot of context, like the permissions of a given file. Let's make it part of the 'export' output, both in raw and in decoded form. Change-Id: I05f17bbebd7a9b3535204b821900851a5f66e88f Closes: OS#5457
-rwxr-xr-xpySim-shell.py2
-rw-r--r--pySim/filesystem.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/pySim-shell.py b/pySim-shell.py
index 12f35fd..ad76ba0 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -532,6 +532,8 @@ class PySimCommands(CommandSet):
structure = self._cmd.rs.selected_file_structure()
self._cmd.poutput("# structure: %s" % str(structure))
+ self._cmd.poutput("# RAW FCP Template: %s" % str(self._cmd.rs.selected_file_fcp_hex))
+ self._cmd.poutput("# Decoded FCP Template: %s" % str(self._cmd.rs.selected_file_fcp))
for f in df_path_list:
self._cmd.poutput("select " + str(f))
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 8303a4b..f8b86c5 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -1221,6 +1221,8 @@ class RuntimeState(object):
self.card = card
self.selected_file = self.mf # type: CardDF
self.profile = profile
+ self.selected_file_fcp = None
+ self.selected_file_fcp_hex = None
# make sure the class and selection control bytes, which are specified
# by the card profile are used
@@ -1464,7 +1466,8 @@ class RuntimeState(object):
select_resp = f.decode_select_response(data)
else:
select_resp = self.probe_file(name, cmd_app)
- # store the decoded FCP for later reference
+ # store the raw + decoded FCP for later reference
+ self.selected_file_fcp_hex = data
self.selected_file_fcp = select_resp
self._select_post(cmd_app)