diff --git a/pySim-read.py b/pySim-read.py index ed6cb29e..083f91b5 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -114,7 +114,7 @@ if __name__ == '__main__': # EF.GID1 try: - (res, sw) = scc.read_binary(EF['GID1']) + (res, sw) = card.read_gid1() if sw == '9000': print("GID1: %s" % (res,)) else: diff --git a/pySim/cards.py b/pySim/cards.py index a43da9c9..61a37074 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -145,6 +145,13 @@ class Card(object): data, sw = self._scc.update_binary(EF['SPN'], rpad(content, 32)) return sw + def read_gid1(self): + (res, sw) = self._scc.read_binary(EF['GID1']) + if sw == '9000': + return (res, sw) + else: + return (None, sw) + # Read the (full) AID for either ISIM or USIM application def read_aid(self, isim = False):