├── shadysim ├── pySim │ ├── __init__.py │ ├── exceptions.py │ ├── utils.py │ ├── transport │ │ ├── pcsc.py │ │ ├── __init__.py │ │ └── serial.py │ ├── commands.py │ └── cards.py ├── toorsimtool-2014.py ├── sects.py └── shadysim.py ├── bin ├── shadysim └── converter ├── javacard ├── lib │ ├── sim.jar │ └── api21.jar ├── bin │ └── converter.jar ├── api21_export_files │ ├── java │ │ └── lang │ │ │ └── javacard │ │ │ └── lang.exp │ ├── sim │ │ ├── access │ │ │ └── javacard │ │ │ │ ├── access.exp │ │ │ │ └── access_exp.tex │ │ └── toolkit │ │ │ └── javacard │ │ │ └── toolkit.exp │ ├── javacardx │ │ └── crypto │ │ │ └── javacard │ │ │ └── crypto.exp │ └── javacard │ │ ├── security │ │ └── javacard │ │ │ └── security.exp │ │ └── framework │ │ └── javacard │ │ └── framework.exp └── makefiles │ └── applet-project.mk ├── .gitignore ├── README.md └── LICENSE /shadysim/pySim/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/shadysim: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=`dirname $0` 4 | python $DIR/../shadysim/shadysim.py $@ 5 | -------------------------------------------------------------------------------- /javacard/lib/sim.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cheeriotb/osmocom-sim-tools/HEAD/javacard/lib/sim.jar -------------------------------------------------------------------------------- /javacard/lib/api21.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cheeriotb/osmocom-sim-tools/HEAD/javacard/lib/api21.jar -------------------------------------------------------------------------------- /javacard/bin/converter.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cheeriotb/osmocom-sim-tools/HEAD/javacard/bin/converter.jar -------------------------------------------------------------------------------- /javacard/api21_export_files/java/lang/javacard/lang.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cheeriotb/osmocom-sim-tools/HEAD/javacard/api21_export_files/java/lang/javacard/lang.exp -------------------------------------------------------------------------------- /javacard/api21_export_files/sim/access/javacard/access.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cheeriotb/osmocom-sim-tools/HEAD/javacard/api21_export_files/sim/access/javacard/access.exp -------------------------------------------------------------------------------- /javacard/api21_export_files/sim/toolkit/javacard/toolkit.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cheeriotb/osmocom-sim-tools/HEAD/javacard/api21_export_files/sim/toolkit/javacard/toolkit.exp -------------------------------------------------------------------------------- /javacard/api21_export_files/javacardx/crypto/javacard/crypto.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cheeriotb/osmocom-sim-tools/HEAD/javacard/api21_export_files/javacardx/crypto/javacard/crypto.exp -------------------------------------------------------------------------------- /bin/converter: -------------------------------------------------------------------------------- 1 | DIR=`dirname $0` 2 | 3 | CLASSPATH=$DIR/../javacard/bin/converter.jar:$CLASSPATH 4 | JFLAGS="-classpath $CLASSPATH" 5 | 6 | java $JFLAGS com.sun.javacard.converter.Converter "$@" 7 | -------------------------------------------------------------------------------- /javacard/api21_export_files/javacard/security/javacard/security.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cheeriotb/osmocom-sim-tools/HEAD/javacard/api21_export_files/javacard/security/javacard/security.exp -------------------------------------------------------------------------------- /javacard/api21_export_files/javacard/framework/javacard/framework.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cheeriotb/osmocom-sim-tools/HEAD/javacard/api21_export_files/javacard/framework/javacard/framework.exp -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.py[co] 2 | 3 | # Packages 4 | *.egg 5 | *.egg-info 6 | dist 7 | build 8 | eggs 9 | parts 10 | var 11 | sdist 12 | develop-eggs 13 | .installed.cfg 14 | 15 | # Installer logs 16 | pip-log.txt 17 | 18 | # Unit test / coverage reports 19 | .coverage 20 | .tox 21 | 22 | #Translations 23 | *.mo 24 | 25 | #Mr Developer 26 | .mr.developer.cfg 27 | 28 | *.cap 29 | -------------------------------------------------------------------------------- /shadysim/pySim/exceptions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pySim: Exceptions 5 | """ 6 | 7 | # 8 | # Copyright (C) 2009-2010 Sylvain Munaut 9 | # 10 | # This program is free software: you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation, either version 2 of the License, or 13 | # (at your option) any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | # 23 | 24 | 25 | class NoCardError(Exception): 26 | pass 27 | 28 | class ProtocolError(Exception): 29 | pass 30 | -------------------------------------------------------------------------------- /shadysim/pySim/utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pySim: various utilities 5 | """ 6 | 7 | # 8 | # Copyright (C) 2009-2010 Sylvain Munaut 9 | # 10 | # This program is free software: you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation, either version 2 of the License, or 13 | # (at your option) any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | # 23 | 24 | 25 | def h2b(s): 26 | return ''.join([chr((int(x,16)<<4)+int(y,16)) for x,y in zip(s[0::2], s[1::2])]) 27 | 28 | def b2h(s): 29 | return ''.join(['%02x'%ord(x) for x in s]) 30 | 31 | def h2i(s): 32 | return [(int(x,16)<<4)+int(y,16) for x,y in zip(s[0::2], s[1::2])] 33 | 34 | def i2h(s): 35 | return ''.join(['%02x'%(x) for x in s]) 36 | 37 | def swap_nibbles(s): 38 | return ''.join([x+y for x,y in zip(s[1::2], s[0::2])]) 39 | 40 | def rpad(s, l, c='f'): 41 | return s + c * (l - len(s)) 42 | 43 | def lpad(s, l, c='f'): 44 | return c * (l - len(s)) + s 45 | -------------------------------------------------------------------------------- /javacard/makefiles/applet-project.mk: -------------------------------------------------------------------------------- 1 | BUILD_DIR = ./build 2 | BUILD_CLASSES_DIR = $(BUILD_DIR)/classes 3 | BUILD_JAVACARD_DIR = $(BUILD_DIR)/javacard 4 | JAVACARD_SDK_DIR ?= $(SIMTOOLS_DIR)/javacard 5 | JAVACARD_EXPORT_DIR ?= $(JAVACARD_SDK_DIR)/api21_export_files 6 | ifdef COMSPEC 7 | CLASSPATH = $(JAVACARD_SDK_DIR)/lib/api21.jar;$(JAVACARD_SDK_DIR)/lib/sim.jar 8 | else 9 | CLASSPATH = $(JAVACARD_SDK_DIR)/lib/api21.jar:$(JAVACARD_SDK_DIR)/lib/sim.jar 10 | endif 11 | JFLAGS = -target 1.1 -source 1.3 -J-Duser.language=en -g -d $(BUILD_CLASSES_DIR) -classpath "$(CLASSPATH)" 12 | JAVA ?= java 13 | JC ?= javac 14 | 15 | .SUFFIXES: .java .class 16 | .java.class: 17 | mkdir -p $(BUILD_CLASSES_DIR) 18 | mkdir -p $(BUILD_JAVACARD_DIR) 19 | 20 | $(JC) $(JFLAGS) $*.java 21 | 22 | $(JAVA) -jar $(JAVACARD_SDK_DIR)/bin/converter.jar \ 23 | -d $(BUILD_JAVACARD_DIR) \ 24 | -classdir $(BUILD_CLASSES_DIR) \ 25 | -exportpath $(JAVACARD_EXPORT_DIR) \ 26 | -applet $(APPLET_AID) $(APPLET_NAME) \ 27 | $(PACKAGE_NAME) $(PACKAGE_AID) $(PACKAGE_VERSION) 28 | 29 | default: classes 30 | 31 | classes: $(SOURCES:.java=.class) 32 | 33 | clean: 34 | $(RM) -rf $(BUILD_DIR) 35 | 36 | install: 37 | $(eval CAP_FILE := $(shell find $(BUILD_JAVACARD_DIR) -name *.cap)) 38 | $(eval MODULE_AID := $(shell echo $(APPLET_AID) | sed 's/0x//g' | sed 's/\://g')) 39 | $(eval INSTANCE_AID := $(shell echo $(APPLET_AID) | sed 's/0x//g' | sed 's/\://g')) 40 | $(SIMTOOLS_DIR)/bin/shadysim \ 41 | $(SHADYSIM_OPTIONS) \ 42 | -l $(CAP_FILE) \ 43 | -i $(CAP_FILE) \ 44 | --enable-sim-toolkit \ 45 | --module-aid $(MODULE_AID) \ 46 | --instance-aid $(INSTANCE_AID) \ 47 | --nonvolatile-memory-required 0100 \ 48 | --volatile-memory-for-install 0100 \ 49 | --max-menu-entry-text 10 \ 50 | --max-menu-entries 01 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # osmocom-sim-tools 2 | 3 | This is a fork project of OSMOCOM SIM Tools. 4 | There is nothing special added from the functionality viewpoint, but just an adaptation to Python 3 (3.7.0) was done. 5 | Please check the bottom of this file and refer to the original project to have a good understanding regarding the setup and the usage. 6 | 7 | # Usage examples 8 | 9 | The command usages in this readme file are kind of examples with the following conditions. 10 | 11 | - Terminal Interface 12 | - Use PC/SC interface between the terminal and the card. 13 | 14 | - TELECOM Keys 15 | - The KIc of the card is 9A665E9CDA096DAE9C04894785EB0B18. 16 | - The KID of the card is 1A8DD88431450CAF8D3719F6380F0A18. 17 | 18 | - Java Card applet and package 19 | 20 | - The file name of the applet is "cardlet.cap". 21 | - The package AID is A000000476416E64726F6964435453. 22 | - The module AID is A000000476416E64726F696443545331. 23 | - The instance AID is A000000476416E64726F696443545331. 24 | 25 | ## Load 26 | 27 | $ python shadysim.py --pcsc -l ./cardlet.cap --kic 9A665E9CDA096DAE9C04894785EB0B18 --kid 1A8DD88431450CAF8D3719F6380F0A18 28 | 29 | ## Install 30 | 31 | $ python shadysim.py --pcsc -i ./cardlet.cap --module-aid A000000476416E64726F696443545331 --instance-aid A000000476416E64726F696443545331 --nonvolatile-memory-required 0100 --volatile-memory-for-install 0300 --kic 9A665E9CDA096DAE9C04894785EB0B18 --kid 1A8DD88431450CAF8D3719F6380F0A18 32 | 33 | ## List 34 | 35 | $ python shadysim.py --pcsc --list-applets --kic 9A665E9CDA096DAE9C04894785EB0B18 --kid 1A8DD88431450CAF8D3719F6380F0A18 36 | 37 | ## Delete 38 | 39 | $ python shadysim.py --pcsc -d A000000476416E64726F6964435453 --kic 9A665E9CDA096DAE9C04894785EB0B18 --kid 1A8DD88431450CAF8D3719F6380F0A18 40 | 41 | # Licence 42 | 43 | This software is released under the GNU General Public License v2.0, see LICENSE. 44 | 45 | # Author 46 | 47 | cheeriotb 48 | 49 | Please check the original project and its author also. 50 | 51 | # Reference 52 | 53 | * Original Project 54 | * OSMOCOM SIM Tools - https://osmocom.org/projects/cellular-infrastructure/wiki/Shadysimpy 55 | -------------------------------------------------------------------------------- /shadysim/pySim/transport/pcsc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pySim: PCSC reader transport link 5 | """ 6 | 7 | # 8 | # Copyright (C) 2009-2010 Sylvain Munaut 9 | # Copyright (C) 2010 Harald Welte 10 | # 11 | # This program is free software: you can redistribute it and/or modify 12 | # it under the terms of the GNU General Public License as published by 13 | # the Free Software Foundation, either version 2 of the License, or 14 | # (at your option) any later version. 15 | # 16 | # This program is distributed in the hope that it will be useful, 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | # GNU General Public License for more details. 20 | # 21 | # You should have received a copy of the GNU General Public License 22 | # along with this program. If not, see . 23 | # 24 | 25 | from smartcard.CardRequest import CardRequest 26 | from smartcard.Exceptions import NoCardException, CardRequestTimeoutException 27 | from smartcard.System import readers 28 | 29 | from pySim.exceptions import NoCardError 30 | from pySim.transport import LinkBase 31 | from pySim.utils import h2i, i2h 32 | 33 | 34 | class PcscSimLink(LinkBase): 35 | 36 | def __init__(self, reader_number=0, verbose=True): 37 | r = readers(); 38 | self._reader = r[reader_number] 39 | self._con = self._reader.createConnection() 40 | self._verbose = verbose 41 | 42 | def __del__(self): 43 | self._con.disconnect() 44 | return 45 | 46 | def wait_for_card(self, timeout=None, newcardonly=False): 47 | cr = CardRequest(readers=[self._reader], timeout=timeout, newcardonly=newcardonly) 48 | try: 49 | cr.waitforcard() 50 | except CardRequestTimeoutException: 51 | raise NoCardError() 52 | self.connect() 53 | 54 | def connect(self): 55 | try: 56 | self._con.connect() 57 | except NoCardException: 58 | raise NoCardError() 59 | 60 | def disconnect(self): 61 | self._con.disconnect() 62 | 63 | def reset_card(self): 64 | self._con.disconnect() 65 | try: 66 | self._con.connect() 67 | except NoCardException: 68 | raise NoCardError() 69 | return 1 70 | 71 | def send_apdu_raw(self, pdu): 72 | """see LinkBase.send_apdu_raw""" 73 | 74 | if self._verbose is True: 75 | print("C-APDU : " + pdu); 76 | 77 | apdu = h2i(pdu) 78 | 79 | data, sw1, sw2 = self._con.transmit(apdu) 80 | 81 | sw = [sw1, sw2] 82 | 83 | if self._verbose is True: 84 | print("R-APDU + SW : " + i2h(data) + i2h(sw)); 85 | 86 | # Return value 87 | return i2h(data), i2h(sw) 88 | -------------------------------------------------------------------------------- /shadysim/pySim/transport/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pySim: PCSC reader transport link base 5 | """ 6 | 7 | # 8 | # Copyright (C) 2009-2010 Sylvain Munaut 9 | # 10 | # This program is free software: you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation, either version 2 of the License, or 13 | # (at your option) any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | # 23 | 24 | class LinkBase(object): 25 | 26 | def wait_for_card(self, timeout=None, newcardonly=False): 27 | """wait_for_card(): Wait for a card and connect to it 28 | 29 | timeout : Maximum wait time (None=no timeout) 30 | newcardonly : Should we wait for a new card, or an already 31 | inserted one ? 32 | """ 33 | pass 34 | 35 | def connect(self): 36 | """connect(): Connect to a card immediately 37 | """ 38 | pass 39 | 40 | def disconnect(self): 41 | """disconnect(): Disconnect from card 42 | """ 43 | pass 44 | 45 | def reset_card(self): 46 | """reset_card(): Resets the card (power down/up) 47 | """ 48 | pass 49 | 50 | def send_apdu_raw(self, pdu): 51 | """send_apdu_raw(pdu): Sends an APDU with minimal processing 52 | 53 | pdu : string of hexadecimal characters (ex. "A0A40000023F00") 54 | return : tuple(data, sw), where 55 | data : string (in hex) of returned data (ex. "074F4EFFFF") 56 | sw : string (in hex) of status word (ex. "9000") 57 | """ 58 | pass 59 | 60 | def send_apdu(self, pdu): 61 | """send_apdu(pdu): Sends an APDU and auto fetch response data 62 | 63 | pdu : string of hexadecimal characters (ex. "A0A40000023F00") 64 | return : tuple(data, sw), where 65 | data : string (in hex) of returned data (ex. "074F4EFFFF") 66 | sw : string (in hex) of status word (ex. "9000") 67 | """ 68 | data, sw = self.send_apdu_raw(pdu) 69 | 70 | if (sw is not None) and (sw[0:2] == '9f'): 71 | pdu_gr = pdu[0:2] + 'c00000' + sw[2:4] 72 | data, sw = self.send_apdu_raw(pdu_gr) 73 | 74 | return data, sw 75 | 76 | def send_apdu_checksw(self, pdu, sw="9000"): 77 | """send_apdu_checksw(pdu,sw): Sends an APDU and check returned SW 78 | 79 | pdu : string of hexadecimal characters (ex. "A0A40000023F00") 80 | sw : string of 4 hexadecimal characters (ex. "9000") 81 | return : tuple(data, sw), where 82 | data : string (in hex) of returned data (ex. "074F4EFFFF") 83 | sw : string (in hex) of status word (ex. "9000") 84 | """ 85 | rv = self.send_apdu(pdu) 86 | if sw.lower() != rv[1]: 87 | raise RuntimeError("SW match failed ! Expected %s and got %s." % (sw.lower(), rv[1])) 88 | return rv 89 | -------------------------------------------------------------------------------- /shadysim/pySim/commands.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pySim: SIM Card commands according to ISO 7816-4 and TS 11.11 5 | """ 6 | 7 | # 8 | # Copyright (C) 2009-2010 Sylvain Munaut 9 | # Copyright (C) 2010 Harald Welte 10 | # 11 | # This program is free software: you can redistribute it and/or modify 12 | # it under the terms of the GNU General Public License as published by 13 | # the Free Software Foundation, either version 2 of the License, or 14 | # (at your option) any later version. 15 | # 16 | # This program is distributed in the hope that it will be useful, 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | # GNU General Public License for more details. 20 | # 21 | # You should have received a copy of the GNU General Public License 22 | # along with this program. If not, see . 23 | # 24 | 25 | from pySim.utils import rpad, b2h 26 | 27 | 28 | class SimCardCommands(object): 29 | def __init__(self, transport): 30 | self._tp = transport; 31 | 32 | def select_file(self, dir_list): 33 | rv = [] 34 | for i in dir_list: 35 | data, sw = self._tp.send_apdu_checksw("a0a4000002" + i) 36 | rv.append(data) 37 | return rv 38 | 39 | def read_binary(self, ef, length=None, offset=0): 40 | if not hasattr(type(ef), '__iter__'): 41 | ef = [ef] 42 | r = self.select_file(ef) 43 | if length is None: 44 | length = int(r[-1][4:8], 16) - offset 45 | pdu = 'a0b0%04x%02x' % (offset, (min(256, length) & 0xff)) 46 | return self._tp.send_apdu(pdu) 47 | 48 | def update_binary(self, ef, data, offset=0): 49 | if not hasattr(type(ef), '__iter__'): 50 | ef = [ef] 51 | self.select_file(ef) 52 | pdu = 'a0d6%04x%02x' % (offset, len(data)/2) + data 53 | return self._tp.send_apdu_checksw(pdu) 54 | 55 | def read_record(self, ef, rec_no): 56 | if not hasattr(type(ef), '__iter__'): 57 | ef = [ef] 58 | r = self.select_file(ef) 59 | rec_length = int(r[-1][28:30], 16) 60 | pdu = 'a0b2%02x04%02x' % (rec_no, rec_length) 61 | return self._tp.send_apdu(pdu) 62 | 63 | def update_record(self, ef, rec_no, data, force_len=False): 64 | if not hasattr(type(ef), '__iter__'): 65 | ef = [ef] 66 | r = self.select_file(ef) 67 | if not force_len: 68 | rec_length = int(r[-1][28:30], 16) 69 | if (len(data)/2 != rec_length): 70 | raise ValueError('Invalid data length (expected %d, got %d)' % (rec_length, len(data)/2)) 71 | else: 72 | rec_length = len(data)/2 73 | pdu = ('a0dc%02x04%02x' % (rec_no, rec_length)) + data 74 | return self._tp.send_apdu_checksw(pdu) 75 | 76 | def record_size(self, ef): 77 | r = self.select_file(ef) 78 | return int(r[-1][28:30], 16) 79 | 80 | def record_count(self, ef): 81 | r = self.select_file(ef) 82 | return int(r[-1][4:8], 16) // int(r[-1][28:30], 16) 83 | 84 | def run_gsm(self, rand): 85 | if len(rand) != 32: 86 | raise ValueError('Invalid rand') 87 | self.select_file(['3f00', '7f20']) 88 | return self._tp.send_apdu('a088000010' + rand) 89 | 90 | def reset_card(self): 91 | return self._tp.reset_card() 92 | 93 | def verify_chv(self, chv_no, code): 94 | fc = rpad(b2h(code), 16) 95 | return self._tp.send_apdu_checksw('a02000' + ('%02x' % chv_no) + '08' + fc) 96 | -------------------------------------------------------------------------------- /shadysim/pySim/transport/serial.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pySim: Transport Link for serial (RS232) based readers included with simcard 5 | """ 6 | 7 | # 8 | # Copyright (C) 2009-2010 Sylvain Munaut 9 | # 10 | # This program is free software: you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation, either version 2 of the License, or 13 | # (at your option) any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | # 23 | 24 | import serial 25 | import time 26 | 27 | from pySim.exceptions import NoCardError, ProtocolError 28 | from pySim.transport import LinkBase 29 | from pySim.utils import h2b, b2h 30 | 31 | 32 | class SerialSimLink(LinkBase): 33 | 34 | def __init__(self, device='/dev/ttyUSB0', baudrate=9600, rst='-rts', debug=False): 35 | self._sl = serial.Serial( 36 | port = device, 37 | parity = serial.PARITY_EVEN, 38 | bytesize = serial.EIGHTBITS, 39 | stopbits = serial.STOPBITS_TWO, 40 | timeout = 1, 41 | xonxoff = 0, 42 | rtscts = 0, 43 | baudrate = baudrate, 44 | ) 45 | self._rst_pin = rst 46 | self._debug = debug 47 | 48 | def __del__(self): 49 | self._sl.close() 50 | 51 | def wait_for_card(self, timeout=None, newcardonly=False): 52 | # Direct try 53 | existing = False 54 | 55 | try: 56 | self.reset_card() 57 | if not newcardonly: 58 | return 59 | else: 60 | existing = True 61 | except NoCardError: 62 | pass 63 | 64 | # Poll ... 65 | mt = time.time() + timeout if timeout is not None else None 66 | pe = 0 67 | 68 | while (mt is None) or (time.time() < mt): 69 | try: 70 | time.sleep(0.5) 71 | self.reset_card() 72 | if not existing: 73 | return 74 | except NoCardError: 75 | existing = False 76 | except ProtocolError: 77 | if existing: 78 | existing = False 79 | else: 80 | # Tolerate a couple of protocol error ... can happen if 81 | # we try when the card is 'half' inserted 82 | pe += 1 83 | if (pe > 2): 84 | raise 85 | 86 | # Timed out ... 87 | raise NoCardError() 88 | 89 | def connect(self): 90 | self.reset_card() 91 | 92 | def disconnect(self): 93 | pass # Nothing to do really ... 94 | 95 | def reset_card(self): 96 | rv = self._reset_card() 97 | if rv == 0: 98 | raise NoCardError() 99 | elif rv < 0: 100 | raise ProtocolError() 101 | 102 | def _reset_card(self): 103 | rst_meth_map = { 104 | 'rts': self._sl.setRTS, 105 | 'dtr': self._sl.setDTR, 106 | } 107 | rst_val_map = { '+':0, '-':1 } 108 | 109 | try: 110 | rst_meth = rst_meth_map[self._rst_pin[1:]] 111 | rst_val = rst_val_map[self._rst_pin[0]] 112 | except: 113 | raise ValueError('Invalid reset pin %s' % self._rst_pin); 114 | 115 | rst_meth(rst_val) 116 | time.sleep(0.1) # 100 ms 117 | self._sl.flushInput() 118 | rst_meth(rst_val ^ 1) 119 | 120 | b = self._rx_byte() 121 | if not b: 122 | return 0 123 | if ord(b) != 0x3b: 124 | return -1; 125 | self._dbg_print("TS: 0x%x Direct convention" % ord(b)) 126 | 127 | while ord(b) == 0x3b: 128 | b = self._rx_byte() 129 | 130 | if not b: 131 | return -1 132 | t0 = ord(b) 133 | self._dbg_print("T0: 0x%x" % t0) 134 | 135 | for i in range(4): 136 | if t0 & (0x10 << i): 137 | self._dbg_print("T%si = %x" % (chr(ord('A')+i), ord(self._rx_byte()))) 138 | 139 | for i in range(0, t0 & 0xf): 140 | self._dbg_print("Historical = %x" % ord(self._rx_byte())) 141 | 142 | while True: 143 | x = self._rx_byte() 144 | if not x: 145 | break 146 | self._dbg_print("Extra: %x" % ord(x)) 147 | 148 | return 1 149 | 150 | def _dbg_print(self, s): 151 | if self._debug: 152 | print(s) 153 | 154 | def _tx_byte(self, b): 155 | self._sl.write(b) 156 | r = self._sl.read() 157 | if r != b: # TX and RX are tied, so we must clear the echo 158 | raise ProtocolError("Bad echo value. Expected %02x, got %s)" % (ord(b), '%02x'%ord(r) if r else '(nil)')) 159 | 160 | def _tx_string(self, s): 161 | """This is only safe if it's guaranteed the card won't send any data 162 | during the time of tx of the string !!!""" 163 | self._sl.write(s) 164 | r = self._sl.read(len(s)) 165 | if r != s: # TX and RX are tied, so we must clear the echo 166 | raise ProtocolError("Bad echo value (Expected: %s, got %s)" % (b2h(s), b2h(r))) 167 | 168 | def _rx_byte(self): 169 | return self._sl.read() 170 | 171 | def send_apdu_raw(self, pdu): 172 | """see LinkBase.send_apdu_raw""" 173 | 174 | pdu = h2b(pdu) 175 | data_len = ord(pdu[4]) # P3 176 | 177 | # Send first CLASS,INS,P1,P2,P3 178 | self._tx_string(pdu[0:5]) 179 | 180 | # Wait ack which can be 181 | # - INS: Command acked -> go ahead 182 | # - 0x60: NULL, just wait some more 183 | # - SW1: The card can apparently proceed ... 184 | while True: 185 | b = self._rx_byte() 186 | if b == pdu[1]: 187 | break 188 | elif b != '\x60': 189 | # Ok, it 'could' be SW1 190 | sw1 = b 191 | sw2 = self._rx_byte() 192 | nil = self._rx_byte() 193 | if (sw2 and not nil): 194 | return '', b2h(sw1+sw2) 195 | 196 | raise ProtocolError() 197 | 198 | # Send data (if any) 199 | if len(pdu) > 5: 200 | self._tx_string(pdu[5:]) 201 | 202 | # Receive data (including SW !) 203 | # length = [P3 - tx_data (=len(pdu)-len(hdr)) + 2 (SW1/2) ] 204 | to_recv = data_len - len(pdu) + 5 + 2 205 | 206 | data = '' 207 | while (len(data) < to_recv): 208 | b = self._rx_byte() 209 | if (to_recv == 2) and (b == '\x60'): # Ignore NIL if we have no RX data (hack ?) 210 | continue 211 | if not b: 212 | break; 213 | data += b 214 | 215 | # Split datafield from SW 216 | if len(data) < 2: 217 | return None, None 218 | sw = data[-2:] 219 | data = data[0:-2] 220 | 221 | # Return value 222 | return b2h(data), b2h(sw) 223 | -------------------------------------------------------------------------------- /shadysim/toorsimtool-2014.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ simprep-2014.py: A tool for the Toorcamp SIM cards in 2014 5 | 6 | Requires the pySim libraries (http://cgit.osmocom.org/cgit/pysim/) 7 | """ 8 | 9 | # 10 | # Copyright (C) 2012 Karl Koscher 11 | # Portions copyright (C) 2014 Duncan Smith 12 | # 13 | # This program is free software: you can redistribute it and/or modify 14 | # it under the terms of the GNU General Public License as published by 15 | # the Free Software Foundation, either version 2 of the License, or 16 | # (at your option) any later version. 17 | # 18 | # This program is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | # GNU General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU General Public License 24 | # along with this program. If not, see . 25 | # 26 | 27 | # I think the only thing holding us back from python3 is: 28 | # ImportError: No module named 'smartcard' 29 | # ? 30 | 31 | from pySim.commands import SimCardCommands 32 | from pySim.utils import swap_nibbles, rpad, b2h 33 | import argparse 34 | import zipfile 35 | import time 36 | import struct 37 | import sqlite3 38 | 39 | #------ 40 | 41 | def hex_ber_length(data): 42 | dataLen = len(data) / 2 43 | if dataLen < 0x80: 44 | return '%02x' % dataLen 45 | dataLen = '%x' % dataLen 46 | lenDataLen = len(dataLen) 47 | if lenDataLen % 2: 48 | dataLen = '0' + dataLen 49 | lenDataLen = lenDataLen + 1 50 | return ('%02x' % (0x80 + (lenDataLen / 2))) + dataLen 51 | 52 | def clear_phonebook(): 53 | for record_num in range(1, sc.record_count(['3f00', '7f10', '6f3a'])): 54 | sc.update_record(['3f00', '7f10', '6f3a'], 55 | record_num, 56 | 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff') 57 | 58 | def set_phonebook(slot, name, number, capability='ff'): 59 | num_records = sc.record_count(['3f00','7f10','6f3a']) 60 | record_size = sc.record_size(['3f00','7f10','6f3a']) 61 | record_num = int(slot) 62 | if (record_num < 1) or (record_num > num_records): 63 | raise RuntimeError("Invalid phonebook record number") 64 | encoded_name = rpad(b2h(name), (record_size - 14) * 2) 65 | if len(encoded_name) > ((record_size - 14) * 2): 66 | raise RuntimeError("Name is longer than %s bytes" % ((record_size-14))) 67 | if len(number) > 20: 68 | raise RuntimeError("Number is too long") 69 | encoded_number = swap_nibbles(rpad(number, 20)) 70 | record = encoded_name + ('%02x' % len(number)) + capability + encoded_number + 'ffff' 71 | sc.update_record(['3f00','7f10','6f3a'], record_num, record) 72 | 73 | def get_imsi(): 74 | imsi_raw = (sc.read_binary(['3f00', '7f20', '6f07'])[0]) 75 | imsi_len = imsi_raw[1] 76 | imsi = swap_nibbles(imsi_raw[2:])[1:] 77 | print(("IMSI: %s" % imsi)) 78 | return imsi 79 | 80 | # Ask the user for the name of the customer 81 | def get_name(): 82 | return input("Enter subscriber name: ") 83 | 84 | def get_next_extension(db): 85 | cur = db.cursor() 86 | last_extn = cur.execute("select extension from subscriber where extension like '22____' order by extension desc limit 1;").fetchone()[0] 87 | return "%06d" % (int(last_extn) + 1) 88 | 89 | 90 | 91 | parser = argparse.ArgumentParser(description='Tool for Toorcamp 2014 SIMs.') 92 | parser.add_argument('-s', '--serialport') 93 | parser.add_argument('-p', '--pcsc', nargs='?', const=0, type=int) 94 | parser.add_argument('-i', '--install') 95 | parser.add_argument('--print-info', action='store_true') 96 | parser.add_argument('-n', '--new-card-required', action='store_true') 97 | parser.add_argument('-z', '--sleep_after_insertion', type=float, default=0.0) 98 | parser.add_argument('--disable-pin') 99 | parser.add_argument('--pin') 100 | parser.add_argument('--tar') 101 | parser.add_argument('--dump-phonebook', action='store_true') 102 | parser.add_argument('--set-phonebook-entry', nargs=4) 103 | 104 | parser.add_argument('--record', action="store_true") 105 | parser.add_argument('--print') 106 | parser.add_argument('--sqlite-db', nargs=1) 107 | 108 | args = parser.parse_args() 109 | 110 | if args.pcsc is not None: 111 | from pySim.transport.pcsc import PcscSimLink 112 | sl = PcscSimLink(args.pcsc) 113 | elif args.serialport is not None: 114 | from pySim.transport.serial import SerialSimLink 115 | sl = SerialSimLink(device=args.serialport, baudrate=9600) 116 | else: 117 | raise RuntimeError("Need to specify either --serialport or --pcsc") 118 | 119 | sc = SimCardCommands(sl) 120 | 121 | sl.wait_for_card(newcardonly=args.new_card_required) 122 | time.sleep(args.sleep_after_insertion) 123 | 124 | # Get the ICCID 125 | print(("ICCID: %s" % swap_nibbles(sc.read_binary(['3f00', '2fe2'])[0]))) 126 | 127 | if args.pin: 128 | sc.verify_chv(1, args.pin) 129 | 130 | if args.print_info: 131 | print("--print-info not implemented yet.") 132 | 133 | if args.disable_pin: 134 | sl.send_apdu_checksw('0026000108' + args.disable_pin.encode("hex") + 'ff' * (8 - len(args.disable_pin))) 135 | 136 | if args.dump_phonebook: 137 | num_records = sc.record_count(['3f00','7f10','6f3a']) 138 | print(("Phonebook: %d records available" % num_records)) 139 | for record_id in range(1, num_records + 1): 140 | print((sc.read_record(['3f00','7f10','6f3a'], record_id))) 141 | 142 | if args.sqlite_db: 143 | dbh = sqlite3.connect(args.sqlite_db[0]) 144 | 145 | if args.set_phonebook_entry: 146 | set_phonebook(args.set_phonebook_entry[0], 147 | args.set_phonebook_entry[1], 148 | args.set_phonebook_entry[2], 149 | args.set_phonebook_entry[3]) 150 | 151 | # This is a SIM card to put into the HLR. 152 | """ 153 | CREATE TABLE Subscriber ( 154 | id INTEGER PRIMARY KEY AUTOINCREMENT, 155 | created TIMESTAMP NOT NULL, 156 | updated TIMESTAMP NOT NULL, 157 | imsi NUMERIC UNIQUE NOT NULL, 158 | name TEXT, 159 | extension TEXT UNIQUE, 160 | authorized INTEGER NOT NULL DEFAULT 0, 161 | tmsi TEXT UNIQUE, 162 | lac INTEGER NOT NULL DEFAULT 0, 163 | expire_lu TIMESTAMP DEFAULT NULL 164 | ); 165 | """ 166 | # 167 | if args.record: 168 | name = get_name() 169 | imsi = get_imsi() 170 | # takes a minute or two 171 | clear_phonebook() 172 | set_phonebook(1, "Shadytel", "3000") 173 | set_phonebook(2, "Toorcamp Reg", "3001") 174 | set_phonebook(3, "Toorcamp Admin", "3002") 175 | set_phonebook(4, "Tone test", "720") 176 | set_phonebook(5, "Echo test", "722") 177 | 178 | extn = get_next_extension(dbh) 179 | print(("Extension: %s" % extn)) 180 | 181 | dbh.cursor().execute("insert into subscriber (name, imsi, extension, authorized, created, updated) values (?, ?, ?, 1, datetime('now'), datetime('now') );", (name, imsi, extn)) 182 | dbh.commit() 183 | 184 | -------------------------------------------------------------------------------- /shadysim/pySim/cards.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pySim: Card programmation logic 5 | """ 6 | 7 | # 8 | # Copyright (C) 2009-2010 Sylvain Munaut 9 | # Copyright (C) 2011 Harald Welte 10 | # 11 | # This program is free software: you can redistribute it and/or modify 12 | # it under the terms of the GNU General Public License as published by 13 | # the Free Software Foundation, either version 2 of the License, or 14 | # (at your option) any later version. 15 | # 16 | # This program is distributed in the hope that it will be useful, 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | # GNU General Public License for more details. 20 | # 21 | # You should have received a copy of the GNU General Public License 22 | # along with this program. If not, see . 23 | # 24 | 25 | from pySim.utils import b2h, h2b, swap_nibbles, rpad, lpad 26 | 27 | 28 | class Card(object): 29 | 30 | def __init__(self, scc): 31 | self._scc = scc 32 | 33 | def _e_iccid(self, iccid): 34 | return swap_nibbles(rpad(iccid, 20)) 35 | 36 | def _e_imsi(self, imsi): 37 | """Converts a string imsi into the value of the EF""" 38 | l = (len(imsi) + 1) // 2 # Required bytes 39 | oe = len(imsi) & 1 # Odd (1) / Even (0) 40 | ei = '%02x' % l + swap_nibbles(lpad('%01x%s' % ((oe<<3)|1, imsi), 16)) 41 | return ei 42 | 43 | def _e_plmn(self, mcc, mnc): 44 | """Converts integer MCC/MNC into 6 bytes for EF""" 45 | return swap_nibbles(lpad('%d' % mcc, 3) + lpad('%d' % mnc, 3)) 46 | 47 | def reset(self): 48 | self._scc.reset_card() 49 | 50 | 51 | class _MagicSimBase(Card): 52 | """ 53 | Theses cards uses several record based EFs to store the provider infos, 54 | each possible provider uses a specific record number in each EF. The 55 | indexes used are ( where N is the number of providers supported ) : 56 | - [2 .. N+1] for the operator name 57 | - [1 .. N] for the programable EFs 58 | 59 | * 3f00/7f4d/8f0c : Operator Name 60 | 61 | bytes 0-15 : provider name, padded with 0xff 62 | byte 16 : length of the provider name 63 | byte 17 : 01 for valid records, 00 otherwise 64 | 65 | * 3f00/7f4d/8f0d : Programmable Binary EFs 66 | 67 | * 3f00/7f4d/8f0e : Programmable Record EFs 68 | 69 | """ 70 | 71 | @classmethod 72 | def autodetect(kls, scc): 73 | try: 74 | for p, l, t in list(kls._files.values()): 75 | if not t: 76 | continue 77 | if scc.record_size(['3f00', '7f4d', p]) != l: 78 | return None 79 | except: 80 | return None 81 | 82 | return kls(scc) 83 | 84 | def _get_count(self): 85 | """ 86 | Selects the file and returns the total number of entries 87 | and entry size 88 | """ 89 | f = self._files['name'] 90 | 91 | r = self._scc.select_file(['3f00', '7f4d', f[0]]) 92 | rec_len = int(r[-1][28:30], 16) 93 | tlen = int(r[-1][4:8],16) 94 | rec_cnt = (tlen / rec_len) - 1; 95 | 96 | if (rec_cnt < 1) or (rec_len != f[1]): 97 | raise RuntimeError('Bad card type') 98 | 99 | return rec_cnt 100 | 101 | def program(self, p): 102 | # Go to dir 103 | self._scc.select_file(['3f00', '7f4d']) 104 | 105 | # Home PLMN in PLMN_Sel format 106 | hplmn = self._e_plmn(p['mcc'], p['mnc']) 107 | 108 | # Operator name ( 3f00/7f4d/8f0c ) 109 | self._scc.update_record(self._files['name'][0], 2, 110 | rpad(b2h(p['name']), 32) + ('%02x' % len(p['name'])) + '01' 111 | ) 112 | 113 | # ICCID/IMSI/Ki/HPLMN ( 3f00/7f4d/8f0d ) 114 | v = '' 115 | 116 | # inline Ki 117 | if self._ki_file is None: 118 | v += p['ki'] 119 | 120 | # ICCID 121 | v += '3f00' + '2fe2' + '0a' + self._e_iccid(p['iccid']) 122 | 123 | # IMSI 124 | v += '7f20' + '6f07' + '09' + self._e_imsi(p['imsi']) 125 | 126 | # Ki 127 | if self._ki_file: 128 | v += self._ki_file + '10' + p['ki'] 129 | 130 | # PLMN_Sel 131 | v+= '6f30' + '18' + rpad(hplmn, 36) 132 | 133 | self._scc.update_record(self._files['b_ef'][0], 1, 134 | rpad(v, self._files['b_ef'][1]*2) 135 | ) 136 | 137 | # SMSP ( 3f00/7f4d/8f0e ) 138 | # FIXME 139 | 140 | # Write PLMN_Sel forcefully as well 141 | r = self._scc.select_file(['3f00', '7f20', '6f30']) 142 | tl = int(r[-1][4:8], 16) 143 | 144 | hplmn = self._e_plmn(p['mcc'], p['mnc']) 145 | self._scc.update_binary('6f30', hplmn + 'ff' * (tl-3)) 146 | 147 | def erase(self): 148 | # Dummy 149 | df = {} 150 | for k, v in self._files.items(): 151 | ofs = 1 152 | fv = v[1] * 'ff' 153 | if k == 'name': 154 | ofs = 2 155 | fv = fv[0:-4] + '0000' 156 | df[v[0]] = (fv, ofs) 157 | 158 | # Write 159 | for n in range(0,self._get_count()): 160 | for k, (msg, ofs) in df.items(): 161 | self._scc.update_record(['3f00', '7f4d', k], n + ofs, msg) 162 | 163 | 164 | class SuperSim(_MagicSimBase): 165 | 166 | name = 'supersim' 167 | 168 | _files = { 169 | 'name' : ('8f0c', 18, True), 170 | 'b_ef' : ('8f0d', 74, True), 171 | 'r_ef' : ('8f0e', 50, True), 172 | } 173 | 174 | _ki_file = None 175 | 176 | 177 | class MagicSim(_MagicSimBase): 178 | 179 | name = 'magicsim' 180 | 181 | _files = { 182 | 'name' : ('8f0c', 18, True), 183 | 'b_ef' : ('8f0d', 130, True), 184 | 'r_ef' : ('8f0e', 102, False), 185 | } 186 | 187 | _ki_file = '6f1b' 188 | 189 | 190 | class FakeMagicSim(Card): 191 | """ 192 | Theses cards have a record based EF 3f00/000c that contains the provider 193 | informations. See the program method for its format. The records go from 194 | 1 to N. 195 | """ 196 | 197 | name = 'fakemagicsim' 198 | 199 | @classmethod 200 | def autodetect(kls, scc): 201 | try: 202 | if scc.record_size(['3f00', '000c']) != 0x5a: 203 | return None 204 | except: 205 | return None 206 | 207 | return kls(scc) 208 | 209 | def _get_infos(self): 210 | """ 211 | Selects the file and returns the total number of entries 212 | and entry size 213 | """ 214 | 215 | r = self._scc.select_file(['3f00', '000c']) 216 | rec_len = int(r[-1][28:30], 16) 217 | tlen = int(r[-1][4:8],16) 218 | rec_cnt = (tlen / rec_len) - 1; 219 | 220 | if (rec_cnt < 1) or (rec_len != 0x5a): 221 | raise RuntimeError('Bad card type') 222 | 223 | return rec_cnt, rec_len 224 | 225 | def program(self, p): 226 | # Home PLMN 227 | r = self._scc.select_file(['3f00', '7f20', '6f30']) 228 | tl = int(r[-1][4:8], 16) 229 | 230 | hplmn = self._e_plmn(p['mcc'], p['mnc']) 231 | self._scc.update_binary('6f30', hplmn + 'ff' * (tl-3)) 232 | 233 | # Get total number of entries and entry size 234 | rec_cnt, rec_len = self._get_infos() 235 | 236 | # Set first entry 237 | entry = ( 238 | '81' + # 1b Status: Valid & Active 239 | rpad(b2h(p['name'][0:14]), 28) + # 14b Entry Name 240 | self._e_iccid(p['iccid']) + # 10b ICCID 241 | self._e_imsi(p['imsi']) + # 9b IMSI_len + id_type(9) + IMSI 242 | p['ki'] + # 16b Ki 243 | lpad(p['smsp'], 80) # 40b SMSP (padded with ff if needed) 244 | ) 245 | self._scc.update_record('000c', 1, entry) 246 | 247 | def erase(self): 248 | # Get total number of entries and entry size 249 | rec_cnt, rec_len = self._get_infos() 250 | 251 | # Erase all entries 252 | entry = 'ff' * rec_len 253 | for i in range(0, rec_cnt): 254 | self._scc.update_record('000c', 1+i, entry) 255 | 256 | class GrcardSim(Card): 257 | """ 258 | Greencard (grcard.cn) HZCOS GSM SIM 259 | These cards have a much more regular ISO 7816-4 / TS 11.11 structure, 260 | and use standard UPDATE RECORD / UPDATE BINARY commands except for Ki. 261 | """ 262 | 263 | name = 'grcardsim' 264 | 265 | @classmethod 266 | def autodetect(kls, scc): 267 | return None 268 | 269 | def program(self, p): 270 | # We don't really know yet what ADM PIN 4 is about 271 | #self._scc.verify_chv(4, h2b("4444444444444444")) 272 | 273 | # Authenticate using ADM PIN 5 274 | self._scc.verify_chv(5, h2b("4444444444444444")) 275 | 276 | # EF.ICCID 277 | r = self._scc.select_file(['3f00', '2fe2']) 278 | data, sw = self._scc.update_binary('2fe2', self._e_iccid(p['iccid'])) 279 | 280 | # EF.IMSI 281 | r = self._scc.select_file(['3f00', '7f20', '6f07']) 282 | data, sw = self._scc.update_binary('6f07', self._e_imsi(p['imsi'])) 283 | 284 | # EF.ACC 285 | #r = self._scc.select_file(['3f00', '7f20', '6f78']) 286 | #self._scc.update_binary('6f78', self._e_imsi(p['imsi']) 287 | 288 | # EF.SMSP 289 | r = self._scc.select_file(['3f00', '7f10', '6f42']) 290 | data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 80)) 291 | 292 | # Set the Ki using proprietary command 293 | pdu = '80d4020010' + p['ki'] 294 | data, sw = self._scc._tp.send_apdu(pdu) 295 | 296 | # EF.HPLMN 297 | r = self._scc.select_file(['3f00', '7f20', '6f30']) 298 | size = int(r[-1][4:8], 16) 299 | hplmn = self._e_plmn(p['mcc'], p['mnc']) 300 | self._scc.update_binary('6f30', hplmn + 'ff' * (size-3)) 301 | 302 | # EF.SPN (Service Provider Name) 303 | r = self._scc.select_file(['3f00', '7f20', '6f30']) 304 | size = int(r[-1][4:8], 16) 305 | # FIXME 306 | 307 | # FIXME: EF.MSISDN 308 | 309 | def erase(self): 310 | return 311 | 312 | class SysmoSIMgr1(GrcardSim): 313 | """ 314 | sysmocom sysmoSIM-GR1 315 | These cards have a much more regular ISO 7816-4 / TS 11.11 structure, 316 | and use standard UPDATE RECORD / UPDATE BINARY commands except for Ki. 317 | """ 318 | name = 'sysmosim-gr1' 319 | 320 | # In order for autodetection ... 321 | 322 | class SysmoUSIMgr1(Card): 323 | """ 324 | sysmocom sysmoUSIM-GR1 325 | """ 326 | name = 'sysmoUSIM-GR1' 327 | 328 | @classmethod 329 | def autodetect(kls, scc): 330 | # TODO: Access the ATR 331 | return None 332 | 333 | def program(self, p): 334 | # TODO: check if verify_chv could be used or what it needs 335 | # self._scc.verify_chv(0x0A, [0x33,0x32,0x32,0x31,0x33,0x32,0x33,0x32]) 336 | # Unlock the card.. 337 | data, sw = self._scc._tp.send_apdu_checksw("0020000A083332323133323332") 338 | 339 | # TODO: move into SimCardCommands 340 | par = ( p['ki'] + # 16b K 341 | p['opc'] + # 32b OPC 342 | self._e_iccid(p['iccid']) + # 10b ICCID 343 | self._e_imsi(p['imsi']) # 9b IMSI_len + id_type(9) + IMSI 344 | ) 345 | data, sw = self._scc._tp.send_apdu_checksw("0099000033" + par) 346 | 347 | def erase(self): 348 | return 349 | 350 | _cards_classes = [ FakeMagicSim, SuperSim, MagicSim, GrcardSim, 351 | SysmoSIMgr1, SysmoUSIMgr1 ] 352 | -------------------------------------------------------------------------------- /shadysim/sects.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # 5 | # Copyright (C) 2018 cheeriotb 6 | # 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License version 2 as 9 | # published by the Free Software Foundation. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | # MA 02110-1301, USA. 20 | #/ 21 | 22 | from pySim.transport.pcsc import PcscSimLink 23 | 24 | import argparse 25 | import sys 26 | 27 | class CommandInterface(object): 28 | def __init__(self, transport): 29 | self.transport = transport 30 | 31 | def extract_value(self, response): 32 | tag_first = int(response[0:2], 16) 33 | response = response[2:] 34 | 35 | # If all the bits 1-5 in the first byte are 1, the tag is encoded in the long format. 36 | # The tag number is encoded in the following octets, 37 | # where bit 8 of each is 1 if there are more octets, and bits 1–7 encode the tag number. 38 | if (tag_first & 0x1F) == 0x1F: 39 | while True: 40 | tag_subsequent = int(response[0:2], 16) 41 | response = response[2:] 42 | if (tag_subsequent & 0x80) != 0x80: 43 | break 44 | 45 | length = 0 46 | length_byte = int(response[0:2], 16) 47 | response = response[2:] 48 | 49 | # The long form consist of 1 initial octet followed by 1 or more subsequent octets, 50 | # containing the length. In the initial octet, bit 8 is 1, 51 | # and bits 1–7 (excluding the values 0 and 127) encode the number of octets that follow. 52 | if length_byte > 127: 53 | length_size = length_byte - 128 54 | while length_size: 55 | length_byte = int(response[0:2], 16) 56 | response = response[2:] 57 | length = (length << 8) + length_byte 58 | length_size -= 1 59 | else: 60 | length = length_byte 61 | 62 | return (response[:length * 2], response[length * 2:]) 63 | 64 | def send_apdu_raw(self, apdu): 65 | if len(apdu) < (4 * 2): 66 | raise ValueError("Specified C-APDU is too short : " + apdu) 67 | (response, sw) = self.transport.send_apdu(apdu) 68 | sw1 = int(sw[0:2], 16) 69 | if sw1 == 0x6C: 70 | if len(apdu) > 8: 71 | apdu = apdu[:-2] + sw[2:4] 72 | else: 73 | apdu = apdu[:8] + sw[2:4] 74 | (response, sw) = self.transport.send_apdu(apdu) 75 | sw1 = int(sw[0:2], 16) 76 | output = response 77 | while sw1 == 0x61 or sw1 == 0x9F: 78 | apdu = apdu[0:2] + 'C00000' + sw[2:4] 79 | (response, sw) = self.transport.send_apdu(apdu) 80 | output = output + response 81 | sw1 = int(sw[0:2], 16) 82 | return (output, sw) 83 | 84 | def send_terminal_profile(self): 85 | (response, sw) = self.transport.send_apdu('A010000011FFFF000000000000000000000000000000') 86 | if sw[0:2] == '91': 87 | self.transport.send_apdu('A0120000' + sw[2:4]) 88 | return self.transport.send_apdu('A01400000C810301030002028281030100') 89 | return (response, sw) 90 | 91 | def open_logical_channel(self): 92 | (response, sw) = self.transport.send_apdu('0070000001') 93 | if sw[0:2] != '90': 94 | raise RuntimeError('Unexpected SW for MANAGE CHANNEL : ' + sw) 95 | if len(response) != 2: 96 | raise RuntimeError('The size of the response data is wrong : ' + response) 97 | return int(response[0:2], 16) 98 | 99 | def close_logical_channel(self, channel_number): 100 | (response, sw) = self.transport.send_apdu('007080' + format(channel_number, '02X')) 101 | if sw[0:2] != '90': 102 | raise RuntimeError('Unexpected SW for MANAGE CHANNEL : ' + sw) 103 | 104 | def select_application(self, channel_number, aid): 105 | (response, sw) = self.send_apdu_raw(format(channel_number, '02X') + 'A40400' \ 106 | + format(len(aid) // 2, '02X') + aid + '00') 107 | if sw[0:2] != '90': 108 | raise RuntimeError('Unexpected SW for SELECT : ' + sw) 109 | return response 110 | 111 | def select_application_with_check_response(self, channel_number, aid): 112 | response = self.select_application(channel_number, aid) 113 | 114 | # The length of the select response shall be greater than 2 bytes 115 | if len(response) < 3: 116 | raise RuntimeError('The size of the response data is wrong : ' + response) 117 | 118 | (target, remain) = self.extract_value(response) 119 | while len(target) > 0: 120 | (value, target) = self.extract_value(target) 121 | 122 | def send_apdu_on_channel(self, channel_number, apdu): 123 | cla = int(apdu[0:2], 16) 124 | if channel_number < 4: 125 | cla = (cla & 0xBC) | channel_number 126 | elif channel_number < 20: 127 | secure = False if (cla & 0x0C) != 0 else True 128 | cla = (cla & 0xB0) | 0x40 | (channel_number - 4) 129 | if secure: 130 | cla = cla | 0x20 131 | else: 132 | raise ValueError("Specified channel number is out of range : " + channel_number) 133 | apdu = format(cla, '02X') + apdu[2:] 134 | 135 | return self.send_apdu_raw(apdu) 136 | 137 | def send_apdu(self, aid, apdu): 138 | channel_number = self.open_logical_channel() 139 | self.select_application(channel_number, aid) 140 | (response, sw) = self.send_apdu_on_channel(channel_number, apdu) 141 | self.close_logical_channel(channel_number) 142 | return (response, sw) 143 | 144 | class OmapiTest(object): 145 | def __init__(self, commandif): 146 | self.commandif = commandif 147 | 148 | def testTransmitApdu(self, aid): 149 | print('started: ' + sys._getframe().f_code.co_name) 150 | 151 | # a. 0xA000000476416E64726F696443545331 152 | # ii.The applet should return no data when it receives the following APDUs in Transmit: 153 | # i.0x00060000 154 | # ii.0x80060000 155 | # iii.0xA0060000 156 | # iv.0x94060000 157 | # v.0x000A000001AA 158 | # vi.0x800A000001AA 159 | # vii.0xA00A000001AA 160 | # viii.0x940A000001AA 161 | 162 | no_data_apdu_list = [ 163 | '00060000', 164 | '80060000', 165 | 'A0060000', 166 | '94060000', 167 | '000A000001AA', 168 | '800A000001AA', 169 | 'A00A000001AA', 170 | '940A000001AA' 171 | ] 172 | 173 | for apdu in no_data_apdu_list: 174 | (response, sw) = self.commandif.send_apdu(aid, apdu) 175 | if len(response) > 0: 176 | raise RuntimeError('Unexpected output data is received : ' + response) 177 | if sw != '9000': 178 | raise RuntimeError('SW is not 9000 : ' + sw) 179 | 180 | # a. 0xA000000476416E64726F696443545331 181 | # iii. The applet should return 256-byte data for the following Transmit APDUs: 182 | # i.0x0008000000 183 | # ii.0x8008000000 184 | # iii.0xA008000000 185 | # iv.0x9408000000 186 | # v.0x000C000001AA00 187 | # vi.0x800C000001AA00 188 | # vii.0xA00C000001AA00 189 | # viii.0x940C000001AA00 190 | 191 | data_apdu_list = [ 192 | '0008000000', 193 | '8008000000', 194 | 'A008000000', 195 | '9408000000', 196 | '000C000001AA00', 197 | '800C000001AA00', 198 | 'A00C000001AA00', 199 | '940C000001AA00' 200 | ] 201 | 202 | for apdu in data_apdu_list: 203 | (response, sw) = self.commandif.send_apdu(aid, apdu) 204 | if len(response) != (256 * 2): 205 | raise RuntimeError('The length of output data is unexpected : ' + response) 206 | if sw != '9000': 207 | raise RuntimeError('SW is not 9000 : ' + sw) 208 | 209 | print('finished: ' + sys._getframe().f_code.co_name) 210 | 211 | def testLongSelectResponse(self, aid): 212 | print('started: ' + sys._getframe().f_code.co_name) 213 | 214 | channel_number = self.commandif.open_logical_channel() 215 | response = self.commandif.select_application_with_check_response(channel_number, aid) 216 | self.commandif.close_logical_channel(channel_number) 217 | 218 | print('finished: ' + sys._getframe().f_code.co_name) 219 | 220 | def testSegmentedResponseTransmit(self, aid): 221 | print('started: ' + sys._getframe().f_code.co_name) 222 | 223 | # a. 0xA000000476416E64726F696443545331 224 | # v. The applet should return segmented responses with 0xFF as the last data byte and 225 | # have the respective status words and response lengths for the following APDUs: 226 | # i.0x00C2080000 227 | # ii.0x00C4080002123400 228 | # iii.0x00C6080000 229 | # iv.0x00C8080002123400 230 | # v.0x00C27FFF00 231 | # vi.0x00CF080000 232 | # vii.0x94C2080000 233 | 234 | segmented_response_apdu_list = [ 235 | '00C2080000', 236 | '00C4080002123400', 237 | '00C6080000', 238 | '00C8080002123400', 239 | '00C27FFF00', 240 | '00CF080000', 241 | '94C2080000' 242 | ] 243 | 244 | for apdu in segmented_response_apdu_list: 245 | (response, sw) = self.commandif.send_apdu(aid, apdu) 246 | 247 | # P1 + P2 indicates the expected length of the output data. 248 | if len(response) != (int(apdu[4:8], 16) * 2): 249 | raise RuntimeError('Unexpected length of data is received : ' + str(len(response))) 250 | 251 | # The last data byte shall be 0xFF though the other bytes are not cared at all. 252 | if int(response[-2:], 16) != 0xFF: 253 | raise RuntimeError('Unexpected byte is received : ' + response[-2:]) 254 | 255 | if sw != '9000': 256 | raise RuntimeError('SW is not 9000 : ' + sw) 257 | 258 | print('finished: ' + sys._getframe().f_code.co_name) 259 | 260 | def testStatusWordTransmit(self, aid): 261 | print('started: ' + sys._getframe().f_code.co_name) 262 | 263 | # a. 0xA000000476416E64726F696443545331 264 | # iv. The applet should return the following status word responses 265 | # for the respective Transmit APDU: 266 | # 267 | # ... (see https://source.android.com/compatibility/cts/secure-element) 268 | # 269 | # * The response should contain data that is the same as input APDU, 270 | # except the first byte is 0x01 instead of 0x00. 271 | 272 | apdu_list = [ 273 | '00F30006', 274 | '00F3000A01AA', 275 | '00F3000800', 276 | '00F3000C01AA00', 277 | ] 278 | 279 | warning_sw_list = [ 280 | '6200', '6281', '6282', '6283', '6285', '62F1', '62F2', '63F1', 281 | '63F2', '63C2', '6202', '6280', '6284', '6286', '6300', '6381' 282 | ] 283 | 284 | for apdu in apdu_list: 285 | for p1 in range(0x10): 286 | apdu = apdu[:4] + format(p1 + 1, '02X') + apdu[6:] 287 | (response, sw) = self.commandif.send_apdu(aid, apdu) 288 | 289 | if sw.upper() != warning_sw_list[p1]: 290 | raise RuntimeError('Unexpected warning SW : ' + sw) 291 | 292 | p2 = apdu[6:8] 293 | if p2 in {'06', '0A'}: 294 | if len(response) > 0: 295 | raise RuntimeError('Unexpected outgoing data : ' + response) 296 | elif p2 == '08': 297 | if len(response) == 0: 298 | raise RuntimeError('Outgoing data is expected') 299 | elif p2 == '0C': 300 | if apdu[2:] != response[2:len(apdu)].upper(): 301 | raise RuntimeError('Outgoing data is different from APDU') 302 | else: 303 | raise RuntimeError('Program error - P2 : ' + p2) 304 | 305 | print('finished: ' + sys._getframe().f_code.co_name) 306 | 307 | def testP2Value(self, aid): 308 | print('started: ' + sys._getframe().f_code.co_name) 309 | apdu = '00F40000' 310 | 311 | (response, sw) = self.commandif.send_apdu(aid, apdu) 312 | if response != '00': 313 | raise RuntimeError('Unexpected outgoing data : ' + response) 314 | if sw != '9000': 315 | raise RuntimeError('Unexpected status word : ' + sw) 316 | 317 | print('finished: ' + sys._getframe().f_code.co_name) 318 | 319 | def execute_all(self): 320 | 321 | selectable_aids = [ 322 | 'A000000476416E64726F696443545331', 323 | 'A000000476416E64726F696443545332', 324 | 'A000000476416E64726F696443545340', 325 | 'A000000476416E64726F696443545341', 326 | 'A000000476416E64726F696443545342', 327 | 'A000000476416E64726F696443545343', 328 | 'A000000476416E64726F696443545344', 329 | 'A000000476416E64726F696443545345', 330 | 'A000000476416E64726F696443545346', 331 | 'A000000476416E64726F696443545347', 332 | 'A000000476416E64726F696443545348', 333 | 'A000000476416E64726F696443545349', 334 | 'A000000476416E64726F69644354534A', 335 | 'A000000476416E64726F69644354534B', 336 | 'A000000476416E64726F69644354534C', 337 | 'A000000476416E64726F69644354534D', 338 | 'A000000476416E64726F69644354534E', 339 | 'A000000476416E64726F69644354534F', 340 | ] 341 | 342 | for aid in selectable_aids: 343 | self.testTransmitApdu(aid) 344 | self.testLongSelectResponse(aid) 345 | self.testSegmentedResponseTransmit(aid) 346 | self.testStatusWordTransmit(aid) 347 | self.testP2Value(aid) 348 | 349 | parser = argparse.ArgumentParser(description='Android Secure Element CTS') 350 | parser.add_argument('-p', '--pcsc', nargs='?', const=0, type=int) 351 | args = parser.parse_args() 352 | 353 | transport = None 354 | if args.pcsc is not None: 355 | transport = PcscSimLink(args.pcsc) 356 | else: 357 | transport = PcscSimLink() 358 | 359 | commandif = CommandInterface(transport) 360 | transport.wait_for_card() 361 | commandif.send_terminal_profile() 362 | 363 | omapi = OmapiTest(commandif) 364 | omapi.execute_all() 365 | 366 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /shadysim/shadysim.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ toorsimtool.py: A toolkit for the Toorcamp SIM cards 5 | 6 | Requires the pySim libraries (http://cgit.osmocom.org/cgit/pysim/) 7 | """ 8 | 9 | # 10 | # Copyright (C) 2012 Karl Koscher 11 | # 12 | # This program is free software: you can redistribute it and/or modify 13 | # it under the terms of the GNU General Public License as published by 14 | # the Free Software Foundation, either version 2 of the License, or 15 | # (at your option) any later version. 16 | # 17 | # This program is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | # GNU General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU General Public License 23 | # along with this program. If not, see . 24 | # 25 | # December 2014, Dieter Spaar: add OTA security for sysmoSIM SJS1 26 | 27 | from pySim.commands import SimCardCommands 28 | from pySim.utils import swap_nibbles, rpad, b2h, i2h 29 | try: 30 | import argparse 31 | except Exception as err: 32 | print("Missing argparse -- try apt-get install python-argparse") 33 | import zipfile 34 | import time 35 | import struct 36 | import binascii 37 | 38 | # Python Cryptography Toolkit (pycrypto) 39 | 40 | from Crypto.Cipher import DES3 41 | 42 | #------ 43 | 44 | def hex_ber_length(data): 45 | dataLen = len(data) // 2 46 | if dataLen < 0x80: 47 | return '%02x' % dataLen 48 | dataLen = '%x' % dataLen 49 | lenDataLen = len(dataLen) 50 | if lenDataLen % 2: 51 | dataLen = '0' + dataLen 52 | lenDataLen = lenDataLen + 1 53 | return ('%02x' % (0x80 + (lenDataLen // 2))) + dataLen 54 | 55 | class AppLoaderCommands(object): 56 | def __init__(self, transport): 57 | self._tp = transport 58 | self._apduCounter = 0; 59 | 60 | def test_rfm(self): 61 | 62 | # use only one of the following 63 | 64 | if (1): 65 | # SIM: select MF/GSM/EF_IMSI and read content (requires keyset two) 66 | if not args.smpp: 67 | print(self.send_wrapped_apdu_rfm_sim('A0A40000023F00' + 'A0A40000027F20' + 'A0A40000026F07' + 'A0B0000009')); 68 | else: 69 | self.send_wrapped_apdu_rfm_sim('A0A40000023F00' + 'A0A40000027F20' + 'A0A40000026F07' + 'A0B0000009'); 70 | else: 71 | # USIM: select MF/GSM/EF_IMSI and read content (requires keyset three) 72 | if not args.smpp: 73 | print(self.send_wrapped_apdu_rfm_usim('00A40004023F00' + '00A40004027F20' + '00A40004026F07' + '00B0000009')); 74 | else: 75 | self.send_wrapped_apdu_rfm_usim('00A40004023F00' + '00A40004027F20' + '00A40004026F07' + '00B0000009'); 76 | 77 | return; 78 | 79 | def send_terminal_profile(self): 80 | rv = self._tp.send_apdu('A010000011FFFF000000000000000000000000000000') 81 | if "91" == rv[1][0:2]: 82 | # In case of "91xx" -> Fetch data, execute cmd and reply 83 | self._tp.send_apdu('A0120000' + rv[1][2:4]) # FETCH 84 | # otherwise "9300" (SIM Busy) 85 | return self._tp.send_apdu('A01400000C810301030002028281030100') # TERMINAL RESPONSE 86 | return rv; 87 | 88 | # Wrap an APDU inside an SMS-PP APDU 89 | def send_wrapped_apdu_internal(self, data, tar, msl, kic_index, kid_index): 90 | # 91 | # See ETSI TS 102 225 and ETSI TS 102 226 for more details 92 | # about OTA security. 93 | # 94 | # So far only no signature check, RC or CC are supported. 95 | # The only supported ciphering mode is "Triple DES in outer-CBC 96 | # mode using two different keys" which is also used for CC. 97 | 98 | # SPI first octet: set to MSL 99 | spi_1 = msl; 100 | 101 | # length of signature 102 | 103 | if ((spi_1 & 0x03) == 0): # no integrity check 104 | len_sig = 0; 105 | elif ((spi_1 & 0x03) == 1): # RC 106 | len_sig = 4; 107 | elif ((spi_1 & 0x03) == 2): # CC 108 | len_sig = 8; 109 | else: 110 | print("Invalid spi_1") 111 | exit(0); 112 | 113 | pad_cnt = 0; 114 | # Padding if Ciphering is used 115 | if ((spi_1 & 0x04) != 0): # check ciphering bit 116 | len_cipher = 6 + len_sig + (len(data) // 2) 117 | pad_cnt = 8 - (len_cipher % 8) # 8 Byte blocksize for DES-CBC (TODO: different padding) 118 | # TODO: there is probably a better way to add "pad_cnt" padding bytes 119 | for i in range(0, pad_cnt): 120 | data = data + '00'; 121 | 122 | # CHL + SPI first octet 123 | part_head = ('%02x' % (0x0D + len_sig)) + ('%02x' % (spi_1)) 124 | 125 | Kic = '00'; 126 | KID = '00'; 127 | if ((spi_1 & 0x04) != 0): # check ciphering bit 128 | Kic = ('%02x' % (0x05 + (kic_index << 4))) # 05: Triple DES in outer-CBC mode using two different keys 129 | if ((spi_1 & 0x03) == 2): # CC 130 | KID = ('%02x' % (0x05 + (kid_index << 4))) # 05: Triple DES in outer-CBC mode using two different keys 131 | 132 | # SPI second octet (01: POR required) + Kic + KID + TAR 133 | # TODO: depending on the returned data use ciphering (10) and/or a signature (08) 134 | part_head = part_head + '01' + Kic + KID + tar; 135 | 136 | # CNTR + PCNTR (CNTR not used) 137 | part_cnt = '0000000000' + ('%02x' % (pad_cnt)) 138 | 139 | envelopeData = part_head + part_cnt + data; 140 | 141 | # two bytes CPL, CPL is part of RC/CC/DS 142 | envelopeData = ('%04x' % (len(envelopeData) // 2 + len_sig)) + envelopeData 143 | 144 | if (len_sig == 8): 145 | # Padding 146 | temp_data = envelopeData 147 | len_cipher = (len(temp_data) // 2) 148 | pad_cnt = 8 - (len_cipher % 8) # 8 Byte blocksize for DES-CBC (TODO: add different padding) 149 | # TODO: there is probably a better way to add "pad_cnt" padding bytes 150 | for i in range(0, pad_cnt): 151 | temp_data = temp_data + '00'; 152 | 153 | key = binascii.a2b_hex(args.kid); 154 | iv = binascii.a2b_hex('0000000000000000'); 155 | cipher = DES3.new(key, DES3.MODE_CBC, iv); 156 | ciph = cipher.encrypt(binascii.a2b_hex(temp_data)); 157 | envelopeData = part_cnt + str(binascii.b2a_hex(ciph[len(ciph) - 8:]), 'utf-8') + data; 158 | elif (len_sig == 4): 159 | crc32 = binascii.crc32(binascii.a2b_hex(envelopeData)) 160 | envelopeData = part_cnt + ('%08x' % (crc32 & 0xFFFFFFFF)) + data; 161 | elif (len_sig == 0): 162 | envelopeData = part_cnt + data; 163 | else: 164 | print("Invalid len_sig") 165 | exit(0) 166 | 167 | # Ciphering (CNTR + PCNTR + RC/CC/DS + data) 168 | 169 | if ((spi_1 & 0x04) != 0): # check ciphering bit 170 | key = binascii.a2b_hex(args.kic); 171 | iv = binascii.a2b_hex('0000000000000000'); 172 | cipher = DES3.new(key, DES3.MODE_CBC, iv); 173 | ciph = cipher.encrypt(binascii.a2b_hex(envelopeData)); 174 | envelopeData = part_head + str(binascii.b2a_hex(ciph), 'utf-8') 175 | else: 176 | envelopeData = part_head + envelopeData; 177 | 178 | # ------------------------------------------------------------- 179 | 180 | # Command (add UDHI: USIM Toolkit Security Header) 181 | # TS 23.048 182 | # 183 | # 02: UDHDL 184 | # 70: IEIA (CPI=70) 185 | # 00: IEIDLa 186 | # 187 | # two bytes CPL 188 | # no CHI 189 | # 190 | envelopeData = '027000' + ('%04x' % (len(envelopeData) // 2)) + envelopeData; 191 | 192 | # For sending via SMPP, those are the data which can be put into 193 | # the "hex" field of the "sendwp" XML file (see examples in libsmpp34). 194 | 195 | if args.smpp: 196 | print("SMPP: " + envelopeData); 197 | return ('00', '9000'); 198 | 199 | # SMS-TDPU header: MS-Delivery, no more messages, TP-UD header, no reply path, 200 | # TP-OA = TON/NPI 55667788, TP-PID = SIM Download, BS timestamp 201 | envelopeData = '400881556677887ff600112912000004' + ('%02x' % (len(envelopeData) // 2)) + envelopeData; 202 | 203 | # (82) Device Identities: (83) Network to (81) USIM 204 | # (8b) SMS-TPDU 205 | envelopeData = '820283818B' + hex_ber_length(envelopeData) + envelopeData 206 | 207 | # d1 = SMS-PP Download, d2 = Cell Broadcast Download 208 | envelopeData = 'd1' + hex_ber_length(envelopeData) + envelopeData; 209 | (response, sw) = self._tp.send_apdu('a0c20000' + ('%02x' % (len(envelopeData) // 2)) + envelopeData) 210 | if "9e" == sw[0:2]: # more bytes available, get response 211 | response = self._tp.send_apdu_checksw('A0C00000' + sw[2:4])[0] # GET RESPONSE 212 | 213 | # Unwrap response 214 | response = response[(int(response[10:12],16)*2)+12:] 215 | return (response[6:], response[2:6]) 216 | 217 | def send_wrapped_apdu_ram(self, data): 218 | if (len(args.kic) == 0) and (len(args.kid) == 0): 219 | # TAR RAM: 000000, no security (JLM SIM) 220 | return self.send_wrapped_apdu_internal(data, '000000', 0, 0, 0) 221 | else: 222 | # TAR RAM: 000000, sysmoSIM SJS1: MSL = 6, first keyset 223 | return self.send_wrapped_apdu_internal(data, '000000', 6, 1, 1) 224 | 225 | def send_wrapped_apdu_rfm_sim(self, data): 226 | # TAR RFM SIM: B00010, sysmoSIM SJS1: MSL = 6, second keyset 227 | return self.send_wrapped_apdu_internal(data, 'B00010', 6, 2, 2) 228 | 229 | def send_wrapped_apdu_rfm_usim(self, data): 230 | # TAR RFM USIM: B00011, sysmoSIM SJS1: MSL = 6, third keyset 231 | return self.send_wrapped_apdu_internal(data, 'B00011', 6, 3, 3) 232 | 233 | def send_wrapped_apdu_checksw(self, data, sw="9000"): 234 | response = self.send_wrapped_apdu_ram(data) 235 | if response[1] != sw: 236 | raise RuntimeError("SW match failed! Expected %s and got %s." % (sw.lower(), response[1])) 237 | return response 238 | 239 | def get_security_domain_aid(self): 240 | # Get Status followed by Get Response 241 | response = self.send_wrapped_apdu_checksw('80F28000024F0000C0000000')[0] 242 | return response[2:(int(response[0:2],16)*2)+2] 243 | 244 | def delete_aid(self, aid, delete_related=True): 245 | aidDesc = '4f' + ('%02x' % (len(aid) // 2)) + aid 246 | apdu = '80e400' + ('80' if delete_related else '00') + ('%02x' % (len(aidDesc) // 2)) + aidDesc + '00c0000000' 247 | return self.send_wrapped_apdu_checksw(apdu) 248 | 249 | def load_aid_raw(self, aid, executable, codeSize, volatileDataSize = 0, nonvolatileDataSize = 0): 250 | loadParameters = 'c602' + ('%04x' % codeSize) 251 | if volatileDataSize > 0: 252 | loadParameters = loadParameters + 'c702' ('%04x' % volatileDataSize) 253 | if nonvolatileDataSize > 0: 254 | loadParameters = loadParameters + 'c802' ('%04x' % nonvolatileDataSize) 255 | loadParameters = 'ef' + ('%02x' % (len(loadParameters) // 2)) + loadParameters 256 | 257 | # Install for load APDU, no security domain or hash specified 258 | data = ('%02x' % (len(aid) // 2)) + aid + '0000' + ('%02x' % (len(loadParameters) // 2)) + loadParameters + '0000' 259 | self.send_wrapped_apdu_checksw('80e60200' + ('%02x' % (len(data) // 2)) + data + '00c0000000') 260 | 261 | # Load APDUs 262 | loadData = 'c4' + hex_ber_length(executable) + executable 263 | loadBlock = 0; 264 | 265 | while len(loadData): 266 | if len(loadData) > 0xd8: 267 | apdu = '80e800' + ('%02x' % loadBlock) + '6c' + loadData[:0xd8] 268 | loadData = loadData[0xd8:] 269 | loadBlock = loadBlock + 1 270 | else: 271 | apdu = '80e880' + ('%02x' % loadBlock) + ('%02x' % (len(loadData) // 2)) + loadData 272 | loadData = '' 273 | 274 | self.send_wrapped_apdu_checksw(apdu + '00c0000000') 275 | 276 | def generate_load_file(self, capfile): 277 | zipcap = zipfile.ZipFile(capfile) 278 | zipfiles = zipcap.namelist() 279 | 280 | header = None 281 | directory = None 282 | impt = None 283 | applet = None 284 | clas = None 285 | method = None 286 | staticfield = None 287 | export = None 288 | constpool = None 289 | reflocation = None 290 | 291 | for i, filename in enumerate(zipfiles): 292 | if filename.lower().endswith('header.cap'): 293 | header = zipcap.read(filename) 294 | elif filename.lower().endswith('directory.cap'): 295 | directory = zipcap.read(filename) 296 | elif filename.lower().endswith('import.cap'): 297 | impt = zipcap.read(filename) 298 | elif filename.lower().endswith('applet.cap'): 299 | applet = zipcap.read(filename) 300 | elif filename.lower().endswith('class.cap'): 301 | clas = zipcap.read(filename) 302 | elif filename.lower().endswith('method.cap'): 303 | method = zipcap.read(filename) 304 | elif filename.lower().endswith('staticfield.cap'): 305 | staticfield = zipcap.read(filename) 306 | elif filename.lower().endswith('export.cap'): 307 | export = zipcap.read(filename) 308 | elif filename.lower().endswith('constantpool.cap'): 309 | constpool = zipcap.read(filename) 310 | elif filename.lower().endswith('reflocation.cap'): 311 | reflocation = zipcap.read(filename) 312 | 313 | data = str(binascii.hexlify(header), 'utf-8') 314 | if directory: 315 | data = data + str(binascii.hexlify(directory), 'utf-8') 316 | if impt: 317 | data = data + str(binascii.hexlify(impt), 'utf-8') 318 | if applet: 319 | data = data + str(binascii.hexlify(applet), 'utf-8') 320 | if clas: 321 | data = data + str(binascii.hexlify(clas), 'utf-8') 322 | if method: 323 | data = data + str(binascii.hexlify(method), 'utf-8') 324 | if staticfield: 325 | data = data + str(binascii.hexlify(staticfield), 'utf-8') 326 | if export: 327 | data = data + str(binascii.hexlify(export), 'utf-8') 328 | if constpool: 329 | data = data + str(binascii.hexlify(constpool), 'utf-8') 330 | if reflocation: 331 | data = data + str(binascii.hexlify(reflocation), 'utf-8') 332 | 333 | return data 334 | 335 | def get_aid_from_load_file(self, data): 336 | return data[26:26+(int(data[24:26],16)*2)] 337 | 338 | def load_app(self, capfile): 339 | data = self.generate_load_file(capfile) 340 | aid = self.get_aid_from_load_file(data) 341 | self.load_aid_raw(aid, data, len(data) // 2) 342 | 343 | def install_app(self, args): 344 | loadfile = self.generate_load_file(args.install) 345 | aid = self.get_aid_from_load_file(loadfile) 346 | 347 | toolkit_params = '' 348 | if args.enable_sim_toolkit: 349 | assert len(args.access_domain) % 2 == 0 350 | assert len(args.priority_level) == 2 351 | toolkit_params = ('%02x' % (len(args.access_domain) // 2)) + args.access_domain 352 | toolkit_params = toolkit_params + args.priority_level + ('%02x' % args.max_timers) 353 | toolkit_params = toolkit_params + ('%02x' % args.max_menu_entry_text) 354 | toolkit_params = toolkit_params + ('%02x' % args.max_menu_entries) + '0000' * args.max_menu_entries + '0000' 355 | if args.tar: 356 | assert len(args.tar) % 6 == 0 357 | toolkit_params = toolkit_params + ('%02x' % (len(args.tar) // 2)) + args.tar 358 | toolkit_params = 'ca' + ('%02x' % (len(toolkit_params) // 2)) + toolkit_params 359 | 360 | assert len(args.nonvolatile_memory_required) == 4 361 | assert len(args.volatile_memory_for_install) == 4 362 | parameters = 'c802' + args.nonvolatile_memory_required + 'c702' + args.volatile_memory_for_install 363 | if toolkit_params: 364 | parameters = parameters + toolkit_params 365 | parameters = 'ef' + ('%02x' % (len(parameters) // 2)) + parameters + 'c9' + ('%02x' % (len(args.app_parameters) // 2)) + args.app_parameters 366 | 367 | data = ('%02x' % (len(aid) // 2)) + aid + ('%02x' % (len(args.module_aid) // 2)) + args.module_aid + ('%02x' % (len(args.instance_aid) // 2)) + \ 368 | args.instance_aid + '0100' + ('%02x' % (len(parameters) // 2)) + parameters + '00' 369 | self.send_wrapped_apdu_checksw('80e60c00' + ('%02x' % (len(data) // 2)) + data + '00c0000000') 370 | #------ 371 | 372 | parser = argparse.ArgumentParser(description='Tool for Toorcamp SIMs.') 373 | parser.add_argument('-s', '--serialport') 374 | parser.add_argument('-p', '--pcsc', nargs='?', const=0, type=int) 375 | parser.add_argument('-d', '--delete-app') 376 | parser.add_argument('-l', '--load-app') 377 | parser.add_argument('-i', '--install') 378 | parser.add_argument('--module-aid') 379 | parser.add_argument('--instance-aid') 380 | parser.add_argument('--nonvolatile-memory-required', default='0000') 381 | parser.add_argument('--volatile-memory-for-install', default='0000') 382 | parser.add_argument('--enable-sim-toolkit', action='store_true') 383 | parser.add_argument('--access-domain', default='ff') 384 | parser.add_argument('--priority-level', default='01') 385 | parser.add_argument('--max-timers', type=int, default=0) 386 | parser.add_argument('--max-menu-entry-text', type=int, default=16) 387 | parser.add_argument('--max-menu-entries', type=int, default=0) 388 | parser.add_argument('--app-parameters', default='') 389 | parser.add_argument('--print-info', action='store_true') 390 | parser.add_argument('-n', '--new-card-required', action='store_true') 391 | parser.add_argument('-z', '--sleep_after_insertion', type=float, default=0.0) 392 | parser.add_argument('--disable-pin') 393 | parser.add_argument('--pin') 394 | parser.add_argument('-t', '--list-applets', action='store_true') 395 | parser.add_argument('--tar') 396 | parser.add_argument('--dump-phonebook', action='store_true') 397 | parser.add_argument('--set-phonebook-entry', nargs=4) 398 | parser.add_argument('--kic', default='') 399 | parser.add_argument('--kid', default='') 400 | parser.add_argument('--smpp', action='store_true') 401 | 402 | args = parser.parse_args() 403 | 404 | if args.pcsc is not None: 405 | from pySim.transport.pcsc import PcscSimLink 406 | sl = PcscSimLink(args.pcsc) 407 | elif args.serialport is not None: 408 | from pySim.transport.serial import SerialSimLink 409 | sl = SerialSimLink(device=args.serialport, baudrate=9600) 410 | elif args.smpp is not None: 411 | class DummySL: 412 | pass 413 | sl = DummySL() 414 | pass 415 | else: 416 | raise RuntimeError("Need to specify either --serialport, --pcsc or --smpp") 417 | 418 | sc = SimCardCommands(sl) 419 | ac = AppLoaderCommands(sl) 420 | 421 | if not args.smpp: 422 | sl.wait_for_card(newcardonly=args.new_card_required) 423 | time.sleep(args.sleep_after_insertion) 424 | 425 | if not args.smpp: 426 | # Get the ICCID 427 | print("ICCID: " + swap_nibbles(sc.read_binary(['3f00', '2fe2'])[0])) 428 | ac.send_terminal_profile() 429 | 430 | # for RFM testing 431 | #ac.test_rfm() 432 | #exit(0) 433 | 434 | if args.pin: 435 | sc.verify_chv(1, args.pin) 436 | 437 | if args.delete_app: 438 | ac.delete_aid(args.delete_app) 439 | 440 | if args.load_app: 441 | ac.load_app(args.load_app) 442 | 443 | if args.install: 444 | ac.install_app(args) 445 | 446 | if args.print_info: 447 | print("--print-info not implemented yet.") 448 | 449 | if args.disable_pin: 450 | sl.send_apdu_checksw('0026000108' + args.disable_pin.encode("hex") + 'ff' * (8 - len(args.disable_pin))) 451 | 452 | if args.dump_phonebook: 453 | num_records = sc.record_count(['3f00','7f10','6f3a']) 454 | print(("Phonebook: %d records available" % num_records)) 455 | for record_id in range(1, num_records + 1): 456 | print(sc.read_record(['3f00','7f10','6f3a'], record_id)) 457 | 458 | if args.set_phonebook_entry: 459 | num_records = sc.record_count(['3f00','7f10','6f3a']) 460 | record_size = sc.record_size(['3f00','7f10','6f3a']) 461 | record_num = int(args.set_phonebook_entry[0]) 462 | if (record_num < 1) or (record_num > num_records): 463 | raise RuntimeError("Invalid phonebook record number") 464 | encoded_name = rpad(b2h(args.set_phonebook_entry[1]), (record_size - 14) * 2) 465 | if len(encoded_name) > ((record_size - 14) * 2): 466 | raise RuntimeError("Name is too long") 467 | if len(args.set_phonebook_entry[2]) > 20: 468 | raise RuntimeError("Number is too long") 469 | encoded_number = swap_nibbles(rpad(args.set_phonebook_entry[2], 20)) 470 | record = encoded_name + ('%02x' % len(args.set_phonebook_entry[2])) + args.set_phonebook_entry[3] + encoded_number + 'ffff' 471 | sc.update_record(['3f00','7f10','6f3a'], record_num, record) 472 | 473 | if args.list_applets: 474 | (data, status) = ac.send_wrapped_apdu_ram('80f21000024f0000c0000000') 475 | while status == '6310': 476 | (partData, status) = ac.send_wrapped_apdu_ram('80f21001024f0000c0000000') 477 | data = data + partData 478 | 479 | while len(data) > 0: 480 | aidlen = int(data[0:2],16) * 2 481 | aid = data[2:aidlen + 2] 482 | state = data[aidlen + 2:aidlen + 4] 483 | privs = data[aidlen + 4:aidlen + 6] 484 | num_instances = int(data[aidlen + 6:aidlen + 8], 16) 485 | print('AID: ' + aid + ', State: ' + state + ', Privs: ' + privs) 486 | data = data[aidlen + 8:] 487 | while num_instances > 0: 488 | aidlen = int(data[0:2],16) * 2 489 | aid = data[2:aidlen + 2] 490 | print("\tInstance AID: " + aid) 491 | data = data[aidlen + 2:] 492 | num_instances = num_instances - 1 493 | -------------------------------------------------------------------------------- /javacard/api21_export_files/sim/access/javacard/access_exp.tex: -------------------------------------------------------------------------------- 1 | export file { // sim/access 2 | magic 00FACADE // in hex 3 | minor_version 1 4 | major_version 2 5 | constant_pool_count 293 6 | constant_pool { 7 | Constant_Utf8_info { 8 | tag 1 9 | length 6 10 | bytes FID_MF 11 | } 12 | Constant_Utf8_info { 13 | tag 1 14 | length 1 15 | bytes S 16 | } 17 | Constant_Utf8_info { 18 | tag 1 19 | length 13 20 | bytes ConstantValue 21 | } 22 | Constant_Integer_info { 23 | tag 3 24 | bytes 16128 25 | } 26 | Constant_Utf8_info { 27 | tag 1 28 | length 14 29 | bytes FID_DF_TELECOM 30 | } 31 | Constant_Integer_info { 32 | tag 3 33 | bytes 32528 34 | } 35 | Constant_Utf8_info { 36 | tag 1 37 | length 10 38 | bytes FID_DF_GSM 39 | } 40 | Constant_Integer_info { 41 | tag 3 42 | bytes 32544 43 | } 44 | Constant_Utf8_info { 45 | tag 1 46 | length 15 47 | bytes FID_DF_DCS_1800 48 | } 49 | Constant_Integer_info { 50 | tag 3 51 | bytes 32545 52 | } 53 | Constant_Utf8_info { 54 | tag 1 55 | length 12 56 | bytes FID_DF_IS_41 57 | } 58 | Constant_Integer_info { 59 | tag 3 60 | bytes 32546 61 | } 62 | Constant_Utf8_info { 63 | tag 1 64 | length 13 65 | bytes FID_DF_FP_CTS 66 | } 67 | Constant_Integer_info { 68 | tag 3 69 | bytes 32547 70 | } 71 | Constant_Utf8_info { 72 | tag 1 73 | length 10 74 | bytes FID_DF_PDC 75 | } 76 | Constant_Integer_info { 77 | tag 3 78 | bytes 32640 79 | } 80 | Constant_Utf8_info { 81 | tag 1 82 | length 12 83 | bytes FID_DF_TETRA 84 | } 85 | Constant_Integer_info { 86 | tag 3 87 | bytes 32656 88 | } 89 | Constant_Utf8_info { 90 | tag 1 91 | length 18 92 | bytes FID_DF_TIA_EIA_136 93 | } 94 | Constant_Integer_info { 95 | tag 3 96 | bytes 32548 97 | } 98 | Constant_Utf8_info { 99 | tag 1 100 | length 17 101 | bytes FID_DF_TIA_EIA_95 102 | } 103 | Constant_Integer_info { 104 | tag 3 105 | bytes 32549 106 | } 107 | Constant_Utf8_info { 108 | tag 1 109 | length 15 110 | bytes FID_DF_Graphics 111 | } 112 | Constant_Integer_info { 113 | tag 3 114 | bytes 24400 115 | } 116 | Constant_Utf8_info { 117 | tag 1 118 | length 15 119 | bytes FID_DF_GRAPHICS 120 | } 121 | Constant_Utf8_info { 122 | tag 1 123 | length 14 124 | bytes FID_DF_IRIDIUM 125 | } 126 | Constant_Integer_info { 127 | tag 3 128 | bytes 24368 129 | } 130 | Constant_Utf8_info { 131 | tag 1 132 | length 17 133 | bytes FID_DF_GLOBALSTAR 134 | } 135 | Constant_Integer_info { 136 | tag 3 137 | bytes 24369 138 | } 139 | Constant_Utf8_info { 140 | tag 1 141 | length 10 142 | bytes FID_DF_ICO 143 | } 144 | Constant_Integer_info { 145 | tag 3 146 | bytes 24370 147 | } 148 | Constant_Utf8_info { 149 | tag 1 150 | length 11 151 | bytes FID_DF_ACES 152 | } 153 | Constant_Integer_info { 154 | tag 3 155 | bytes 24371 156 | } 157 | Constant_Utf8_info { 158 | tag 1 159 | length 15 160 | bytes FID_DF_PCS_1900 161 | } 162 | Constant_Integer_info { 163 | tag 3 164 | bytes 24384 165 | } 166 | Constant_Utf8_info { 167 | tag 1 168 | length 10 169 | bytes FID_DF_CTS 170 | } 171 | Constant_Integer_info { 172 | tag 3 173 | bytes 24416 174 | } 175 | Constant_Utf8_info { 176 | tag 1 177 | length 12 178 | bytes FID_DF_SOLSA 179 | } 180 | Constant_Integer_info { 181 | tag 3 182 | bytes 24432 183 | } 184 | Constant_Utf8_info { 185 | tag 1 186 | length 18 187 | bytes FID_DF_TIA_EIA_553 188 | } 189 | Constant_Utf8_info { 190 | tag 1 191 | length 11 192 | bytes FID_DF_MEXE 193 | } 194 | Constant_Integer_info { 195 | tag 3 196 | bytes 24380 197 | } 198 | Constant_Utf8_info { 199 | tag 1 200 | length 12 201 | bytes FID_EF_ICCID 202 | } 203 | Constant_Integer_info { 204 | tag 3 205 | bytes 12258 206 | } 207 | Constant_Utf8_info { 208 | tag 1 209 | length 10 210 | bytes FID_EF_ELP 211 | } 212 | Constant_Integer_info { 213 | tag 3 214 | bytes 12037 215 | } 216 | Constant_Utf8_info { 217 | tag 1 218 | length 10 219 | bytes FID_EF_ADN 220 | } 221 | Constant_Integer_info { 222 | tag 3 223 | bytes 28474 224 | } 225 | Constant_Utf8_info { 226 | tag 1 227 | length 10 228 | bytes FID_EF_FDN 229 | } 230 | Constant_Integer_info { 231 | tag 3 232 | bytes 28475 233 | } 234 | Constant_Utf8_info { 235 | tag 1 236 | length 10 237 | bytes FID_EF_SMS 238 | } 239 | Constant_Integer_info { 240 | tag 3 241 | bytes 28476 242 | } 243 | Constant_Utf8_info { 244 | tag 1 245 | length 10 246 | bytes FID_EF_CCP 247 | } 248 | Constant_Integer_info { 249 | tag 3 250 | bytes 28477 251 | } 252 | Constant_Utf8_info { 253 | tag 1 254 | length 13 255 | bytes FID_EF_MSISDN 256 | } 257 | Constant_Integer_info { 258 | tag 3 259 | bytes 28480 260 | } 261 | Constant_Utf8_info { 262 | tag 1 263 | length 11 264 | bytes FID_EF_SMSP 265 | } 266 | Constant_Integer_info { 267 | tag 3 268 | bytes 28482 269 | } 270 | Constant_Utf8_info { 271 | tag 1 272 | length 11 273 | bytes FID_EF_SMSS 274 | } 275 | Constant_Integer_info { 276 | tag 3 277 | bytes 28483 278 | } 279 | Constant_Utf8_info { 280 | tag 1 281 | length 10 282 | bytes FID_EF_LND 283 | } 284 | Constant_Integer_info { 285 | tag 3 286 | bytes 28484 287 | } 288 | Constant_Utf8_info { 289 | tag 1 290 | length 10 291 | bytes FID_EF_SDN 292 | } 293 | Constant_Integer_info { 294 | tag 3 295 | bytes 28489 296 | } 297 | Constant_Utf8_info { 298 | tag 1 299 | length 11 300 | bytes FID_EF_EXT1 301 | } 302 | Constant_Integer_info { 303 | tag 3 304 | bytes 28490 305 | } 306 | Constant_Utf8_info { 307 | tag 1 308 | length 11 309 | bytes FID_EF_EXT2 310 | } 311 | Constant_Integer_info { 312 | tag 3 313 | bytes 28491 314 | } 315 | Constant_Utf8_info { 316 | tag 1 317 | length 11 318 | bytes FID_EF_EXT3 319 | } 320 | Constant_Integer_info { 321 | tag 3 322 | bytes 28492 323 | } 324 | Constant_Utf8_info { 325 | tag 1 326 | length 10 327 | bytes FID_EF_BDN 328 | } 329 | Constant_Integer_info { 330 | tag 3 331 | bytes 28493 332 | } 333 | Constant_Utf8_info { 334 | tag 1 335 | length 11 336 | bytes FID_EF_EXT4 337 | } 338 | Constant_Integer_info { 339 | tag 3 340 | bytes 28494 341 | } 342 | Constant_Utf8_info { 343 | tag 1 344 | length 11 345 | bytes FID_EF_SMSR 346 | } 347 | Constant_Integer_info { 348 | tag 3 349 | bytes 28487 350 | } 351 | Constant_Utf8_info { 352 | tag 1 353 | length 11 354 | bytes FID_EF_ECCP 355 | } 356 | Constant_Integer_info { 357 | tag 3 358 | bytes 28495 359 | } 360 | Constant_Utf8_info { 361 | tag 1 362 | length 10 363 | bytes FID_EF_CMI 364 | } 365 | Constant_Integer_info { 366 | tag 3 367 | bytes 28504 368 | } 369 | Constant_Utf8_info { 370 | tag 1 371 | length 10 372 | bytes FID_EF_IMG 373 | } 374 | Constant_Integer_info { 375 | tag 3 376 | bytes 20256 377 | } 378 | Constant_Utf8_info { 379 | tag 1 380 | length 9 381 | bytes FID_EF_LP 382 | } 383 | Constant_Integer_info { 384 | tag 3 385 | bytes 28421 386 | } 387 | Constant_Utf8_info { 388 | tag 1 389 | length 11 390 | bytes FID_EF_IMSI 391 | } 392 | Constant_Integer_info { 393 | tag 3 394 | bytes 28423 395 | } 396 | Constant_Utf8_info { 397 | tag 1 398 | length 9 399 | bytes FID_EF_KC 400 | } 401 | Constant_Integer_info { 402 | tag 3 403 | bytes 28448 404 | } 405 | Constant_Utf8_info { 406 | tag 1 407 | length 14 408 | bytes FID_EF_PLMNSEL 409 | } 410 | Constant_Integer_info { 411 | tag 3 412 | bytes 28464 413 | } 414 | Constant_Utf8_info { 415 | tag 1 416 | length 12 417 | bytes FID_EF_HPLMN 418 | } 419 | Constant_Integer_info { 420 | tag 3 421 | bytes 28465 422 | } 423 | Constant_Utf8_info { 424 | tag 1 425 | length 13 426 | bytes FID_EF_ACMMAX 427 | } 428 | Constant_Integer_info { 429 | tag 3 430 | bytes 28471 431 | } 432 | Constant_Utf8_info { 433 | tag 1 434 | length 10 435 | bytes FID_EF_SST 436 | } 437 | Constant_Integer_info { 438 | tag 3 439 | bytes 28472 440 | } 441 | Constant_Utf8_info { 442 | tag 1 443 | length 10 444 | bytes FID_EF_ACM 445 | } 446 | Constant_Integer_info { 447 | tag 3 448 | bytes 28473 449 | } 450 | Constant_Utf8_info { 451 | tag 1 452 | length 11 453 | bytes FID_EF_GID1 454 | } 455 | Constant_Integer_info { 456 | tag 3 457 | bytes 28478 458 | } 459 | Constant_Utf8_info { 460 | tag 1 461 | length 11 462 | bytes FID_EF_GID2 463 | } 464 | Constant_Integer_info { 465 | tag 3 466 | bytes 28479 467 | } 468 | Constant_Utf8_info { 469 | tag 1 470 | length 10 471 | bytes FID_EF_SPN 472 | } 473 | Constant_Integer_info { 474 | tag 3 475 | bytes 28486 476 | } 477 | Constant_Utf8_info { 478 | tag 1 479 | length 11 480 | bytes FID_EF_PUCT 481 | } 482 | Constant_Integer_info { 483 | tag 3 484 | bytes 28481 485 | } 486 | Constant_Utf8_info { 487 | tag 1 488 | length 11 489 | bytes FID_EF_CBMI 490 | } 491 | Constant_Integer_info { 492 | tag 3 493 | bytes 28485 494 | } 495 | Constant_Utf8_info { 496 | tag 1 497 | length 11 498 | bytes FID_EF_BCCH 499 | } 500 | Constant_Integer_info { 501 | tag 3 502 | bytes 28532 503 | } 504 | Constant_Utf8_info { 505 | tag 1 506 | length 10 507 | bytes FID_EF_ACC 508 | } 509 | Constant_Integer_info { 510 | tag 3 511 | bytes 28536 512 | } 513 | Constant_Utf8_info { 514 | tag 1 515 | length 12 516 | bytes FID_EF_FPLMN 517 | } 518 | Constant_Integer_info { 519 | tag 3 520 | bytes 28539 521 | } 522 | Constant_Utf8_info { 523 | tag 1 524 | length 11 525 | bytes FID_EF_LOCI 526 | } 527 | Constant_Integer_info { 528 | tag 3 529 | bytes 28542 530 | } 531 | Constant_Utf8_info { 532 | tag 1 533 | length 9 534 | bytes FID_EF_AD 535 | } 536 | Constant_Integer_info { 537 | tag 3 538 | bytes 28589 539 | } 540 | Constant_Utf8_info { 541 | tag 1 542 | length 12 543 | bytes FID_EF_PHASE 544 | } 545 | Constant_Integer_info { 546 | tag 3 547 | bytes 28590 548 | } 549 | Constant_Utf8_info { 550 | tag 1 551 | length 11 552 | bytes FID_EF_VGCS 553 | } 554 | Constant_Integer_info { 555 | tag 3 556 | bytes 28593 557 | } 558 | Constant_Utf8_info { 559 | tag 1 560 | length 12 561 | bytes FID_EF_VGCSS 562 | } 563 | Constant_Integer_info { 564 | tag 3 565 | bytes 28594 566 | } 567 | Constant_Utf8_info { 568 | tag 1 569 | length 10 570 | bytes FID_EF_VBS 571 | } 572 | Constant_Integer_info { 573 | tag 3 574 | bytes 28595 575 | } 576 | Constant_Utf8_info { 577 | tag 1 578 | length 11 579 | bytes FID_EF_VBSS 580 | } 581 | Constant_Integer_info { 582 | tag 3 583 | bytes 28596 584 | } 585 | Constant_Utf8_info { 586 | tag 1 587 | length 12 588 | bytes FID_EF_EMLPP 589 | } 590 | Constant_Integer_info { 591 | tag 3 592 | bytes 28597 593 | } 594 | Constant_Utf8_info { 595 | tag 1 596 | length 11 597 | bytes FID_EF_AAEM 598 | } 599 | Constant_Integer_info { 600 | tag 3 601 | bytes 28598 602 | } 603 | Constant_Utf8_info { 604 | tag 1 605 | length 12 606 | bytes FID_EF_CBMID 607 | } 608 | Constant_Integer_info { 609 | tag 3 610 | bytes 28488 611 | } 612 | Constant_Utf8_info { 613 | tag 1 614 | length 10 615 | bytes FID_EF_ECC 616 | } 617 | Constant_Integer_info { 618 | tag 3 619 | bytes 28599 620 | } 621 | Constant_Utf8_info { 622 | tag 1 623 | length 12 624 | bytes FID_EF_CBMIR 625 | } 626 | Constant_Integer_info { 627 | tag 3 628 | bytes 28496 629 | } 630 | Constant_Utf8_info { 631 | tag 1 632 | length 10 633 | bytes FID_EF_DCK 634 | } 635 | Constant_Integer_info { 636 | tag 3 637 | bytes 28460 638 | } 639 | Constant_Utf8_info { 640 | tag 1 641 | length 10 642 | bytes FID_EF_CNL 643 | } 644 | Constant_Integer_info { 645 | tag 3 646 | bytes 28466 647 | } 648 | Constant_Utf8_info { 649 | tag 1 650 | length 10 651 | bytes FID_EF_NIA 652 | } 653 | Constant_Integer_info { 654 | tag 3 655 | bytes 28497 656 | } 657 | Constant_Utf8_info { 658 | tag 1 659 | length 13 660 | bytes FID_EF_KCGPRS 661 | } 662 | Constant_Integer_info { 663 | tag 3 664 | bytes 28498 665 | } 666 | Constant_Utf8_info { 667 | tag 1 668 | length 15 669 | bytes FID_EF_LOCIGPRS 670 | } 671 | Constant_Integer_info { 672 | tag 3 673 | bytes 28499 674 | } 675 | Constant_Utf8_info { 676 | tag 1 677 | length 11 678 | bytes FID_EF_SUME 679 | } 680 | Constant_Integer_info { 681 | tag 3 682 | bytes 28500 683 | } 684 | Constant_Utf8_info { 685 | tag 1 686 | length 15 687 | bytes FID_EF_PLMNWACT 688 | } 689 | Constant_Integer_info { 690 | tag 3 691 | bytes 28512 692 | } 693 | Constant_Utf8_info { 694 | tag 1 695 | length 16 696 | bytes FID_EF_OPLMNWACT 697 | } 698 | Constant_Integer_info { 699 | tag 3 700 | bytes 28513 701 | } 702 | Constant_Utf8_info { 703 | tag 1 704 | length 16 705 | bytes FID_EF_HPLMNWACT 706 | } 707 | Constant_Integer_info { 708 | tag 3 709 | bytes 28514 710 | } 711 | Constant_Utf8_info { 712 | tag 1 713 | length 13 714 | bytes FID_EF_CPBCCH 715 | } 716 | Constant_Integer_info { 717 | tag 3 718 | bytes 28515 719 | } 720 | Constant_Utf8_info { 721 | tag 1 722 | length 14 723 | bytes FID_EF_INVSCAN 724 | } 725 | Constant_Integer_info { 726 | tag 3 727 | bytes 28516 728 | } 729 | Constant_Utf8_info { 730 | tag 1 731 | length 10 732 | bytes FID_EF_SAI 733 | } 734 | Constant_Integer_info { 735 | tag 3 736 | bytes 20272 737 | } 738 | Constant_Utf8_info { 739 | tag 1 740 | length 10 741 | bytes FID_EF_SLL 742 | } 743 | Constant_Integer_info { 744 | tag 3 745 | bytes 20273 746 | } 747 | Constant_Utf8_info { 748 | tag 1 749 | length 10 750 | bytes FID_EF_SID 751 | } 752 | Constant_Integer_info { 753 | tag 3 754 | bytes 20352 755 | } 756 | Constant_Utf8_info { 757 | tag 1 758 | length 10 759 | bytes FID_EF_GPI 760 | } 761 | Constant_Integer_info { 762 | tag 3 763 | bytes 20353 764 | } 765 | Constant_Utf8_info { 766 | tag 1 767 | length 10 768 | bytes FID_EF_IPC 769 | } 770 | Constant_Integer_info { 771 | tag 3 772 | bytes 20354 773 | } 774 | Constant_Utf8_info { 775 | tag 1 776 | length 12 777 | bytes FID_EF_COUNT 778 | } 779 | Constant_Integer_info { 780 | tag 3 781 | bytes 20355 782 | } 783 | Constant_Utf8_info { 784 | tag 1 785 | length 11 786 | bytes FID_EF_NSID 787 | } 788 | Constant_Integer_info { 789 | tag 3 790 | bytes 20356 791 | } 792 | Constant_Utf8_info { 793 | tag 1 794 | length 11 795 | bytes FID_EF_PSID 796 | } 797 | Constant_Integer_info { 798 | tag 3 799 | bytes 20357 800 | } 801 | Constant_Utf8_info { 802 | tag 1 803 | length 13 804 | bytes FID_EF_NETSEL 805 | } 806 | Constant_Integer_info { 807 | tag 3 808 | bytes 20358 809 | } 810 | Constant_Utf8_info { 811 | tag 1 812 | length 10 813 | bytes FID_EF_SPL 814 | } 815 | Constant_Integer_info { 816 | tag 3 817 | bytes 20359 818 | } 819 | Constant_Utf8_info { 820 | tag 1 821 | length 10 822 | bytes FID_EF_MIN 823 | } 824 | Constant_Integer_info { 825 | tag 3 826 | bytes 20360 827 | } 828 | Constant_Utf8_info { 829 | tag 1 830 | length 13 831 | bytes FID_EF_ACCOLC 832 | } 833 | Constant_Integer_info { 834 | tag 3 835 | bytes 20361 836 | } 837 | Constant_Utf8_info { 838 | tag 1 839 | length 10 840 | bytes FID_EF_FC1 841 | } 842 | Constant_Integer_info { 843 | tag 3 844 | bytes 20362 845 | } 846 | Constant_Utf8_info { 847 | tag 1 848 | length 12 849 | bytes FID_EF_S_ESN 850 | } 851 | Constant_Integer_info { 852 | tag 3 853 | bytes 20363 854 | } 855 | Constant_Utf8_info { 856 | tag 1 857 | length 11 858 | bytes FID_EF_CSID 859 | } 860 | Constant_Integer_info { 861 | tag 3 862 | bytes 20364 863 | } 864 | Constant_Utf8_info { 865 | tag 1 866 | length 17 867 | bytes FID_EF_REG_THRESH 868 | } 869 | Constant_Integer_info { 870 | tag 3 871 | bytes 20365 872 | } 873 | Constant_Utf8_info { 874 | tag 1 875 | length 11 876 | bytes FID_EF_CCCH 877 | } 878 | Constant_Integer_info { 879 | tag 3 880 | bytes 20366 881 | } 882 | Constant_Utf8_info { 883 | tag 1 884 | length 11 885 | bytes FID_EF_LDCC 886 | } 887 | Constant_Integer_info { 888 | tag 3 889 | bytes 20367 890 | } 891 | Constant_Utf8_info { 892 | tag 1 893 | length 16 894 | bytes FID_EF_GSM_RECON 895 | } 896 | Constant_Integer_info { 897 | tag 3 898 | bytes 20368 899 | } 900 | Constant_Utf8_info { 901 | tag 1 902 | length 17 903 | bytes FID_EF_AMPS_2_GSM 904 | } 905 | Constant_Integer_info { 906 | tag 3 907 | bytes 20369 908 | } 909 | Constant_Utf8_info { 910 | tag 1 911 | length 14 912 | bytes FID_EF_AMPS_UI 913 | } 914 | Constant_Integer_info { 915 | tag 3 916 | bytes 20371 917 | } 918 | Constant_Utf8_info { 919 | tag 1 920 | length 14 921 | bytes FID_EF_MEXE_ST 922 | } 923 | Constant_Integer_info { 924 | tag 3 925 | bytes 20288 926 | } 927 | Constant_Utf8_info { 928 | tag 1 929 | length 11 930 | bytes FID_EF_ORPK 931 | } 932 | Constant_Integer_info { 933 | tag 3 934 | bytes 20289 935 | } 936 | Constant_Utf8_info { 937 | tag 1 938 | length 11 939 | bytes FID_EF_ARPK 940 | } 941 | Constant_Integer_info { 942 | tag 3 943 | bytes 20290 944 | } 945 | Constant_Utf8_info { 946 | tag 1 947 | length 12 948 | bytes FID_EF_TPRPK 949 | } 950 | Constant_Integer_info { 951 | tag 3 952 | bytes 20291 953 | } 954 | Constant_Utf8_info { 955 | tag 1 956 | length 17 957 | bytes REC_ACC_MODE_NEXT 958 | } 959 | Constant_Utf8_info { 960 | tag 1 961 | length 1 962 | bytes B 963 | } 964 | Constant_Integer_info { 965 | tag 3 966 | bytes 2 967 | } 968 | Constant_Utf8_info { 969 | tag 1 970 | length 21 971 | bytes REC_ACC_MODE_PREVIOUS 972 | } 973 | Constant_Integer_info { 974 | tag 3 975 | bytes 3 976 | } 977 | Constant_Utf8_info { 978 | tag 1 979 | length 29 980 | bytes REC_ACC_MODE_ABSOLUTE_CURRENT 981 | } 982 | Constant_Integer_info { 983 | tag 3 984 | bytes 4 985 | } 986 | Constant_Utf8_info { 987 | tag 1 988 | length 27 989 | bytes SEEK_FROM_BEGINNING_FORWARD 990 | } 991 | Constant_Integer_info { 992 | tag 3 993 | bytes 0 994 | } 995 | Constant_Utf8_info { 996 | tag 1 997 | length 22 998 | bytes SEEK_FROM_END_BACKWARD 999 | } 1000 | Constant_Integer_info { 1001 | tag 3 1002 | bytes 1 1003 | } 1004 | Constant_Utf8_info { 1005 | tag 1 1006 | length 22 1007 | bytes SEEK_FROM_NEXT_FORWARD 1008 | } 1009 | Constant_Utf8_info { 1010 | tag 1 1011 | length 27 1012 | bytes SEEK_FROM_PREVIOUS_BACKWARD 1013 | } 1014 | Constant_Utf8_info { 1015 | tag 1 1016 | length 6 1017 | bytes status 1018 | } 1019 | Constant_Utf8_info { 1020 | tag 1 1021 | length 7 1022 | bytes ([BSS)S 1023 | } 1024 | Constant_Utf8_info { 1025 | tag 1 1026 | length 8 1027 | bytes increase 1028 | } 1029 | Constant_Utf8_info { 1030 | tag 1 1031 | length 9 1032 | bytes ([BS[BS)S 1033 | } 1034 | Constant_Utf8_info { 1035 | tag 1 1036 | length 10 1037 | bytes invalidate 1038 | } 1039 | Constant_Utf8_info { 1040 | tag 1 1041 | length 3 1042 | bytes ()V 1043 | } 1044 | Constant_Utf8_info { 1045 | tag 1 1046 | length 12 1047 | bytes rehabilitate 1048 | } 1049 | Constant_Utf8_info { 1050 | tag 1 1051 | length 10 1052 | bytes readRecord 1053 | } 1054 | Constant_Utf8_info { 1055 | tag 1 1056 | length 10 1057 | bytes (SBS[BSS)S 1058 | } 1059 | Constant_Utf8_info { 1060 | tag 1 1061 | length 12 1062 | bytes updateRecord 1063 | } 1064 | Constant_Utf8_info { 1065 | tag 1 1066 | length 10 1067 | bytes (SBS[BSS)V 1068 | } 1069 | Constant_Utf8_info { 1070 | tag 1 1071 | length 6 1072 | bytes select 1073 | } 1074 | Constant_Utf8_info { 1075 | tag 1 1076 | length 8 1077 | bytes (S[BSS)S 1078 | } 1079 | Constant_Utf8_info { 1080 | tag 1 1081 | length 4 1082 | bytes (S)V 1083 | } 1084 | Constant_Utf8_info { 1085 | tag 1 1086 | length 4 1087 | bytes seek 1088 | } 1089 | Constant_Utf8_info { 1090 | tag 1 1091 | length 8 1092 | bytes (B[BSS)S 1093 | } 1094 | Constant_Utf8_info { 1095 | tag 1 1096 | length 10 1097 | bytes readBinary 1098 | } 1099 | Constant_Utf8_info { 1100 | tag 1 1101 | length 12 1102 | bytes updateBinary 1103 | } 1104 | Constant_Utf8_info { 1105 | tag 1 1106 | length 8 1107 | bytes (S[BSS)V 1108 | } 1109 | Constant_Utf8_info { 1110 | tag 1 1111 | length 18 1112 | bytes sim/access/SIMView 1113 | } 1114 | Constant_Classref_info { 1115 | tag 7 1116 | name_index 242 // sim/access/SIMView 1117 | } 1118 | Constant_Utf8_info { 1119 | tag 1 1120 | length 16 1121 | bytes java/lang/Object 1122 | } 1123 | Constant_Classref_info { 1124 | tag 7 1125 | name_index 244 // java/lang/Object 1126 | } 1127 | Constant_Utf8_info { 1128 | tag 1 1129 | length 28 1130 | bytes javacard/framework/Shareable 1131 | } 1132 | Constant_Classref_info { 1133 | tag 7 1134 | name_index 246 // javacard/framework/Shareable 1135 | } 1136 | Constant_Utf8_info { 1137 | tag 1 1138 | length 13 1139 | bytes getTheSIMView 1140 | } 1141 | Constant_Utf8_info { 1142 | tag 1 1143 | length 22 1144 | bytes ()Lsim/access/SIMView; 1145 | } 1146 | Constant_Utf8_info { 1147 | tag 1 1148 | length 6 1149 | bytes equals 1150 | } 1151 | Constant_Utf8_info { 1152 | tag 1 1153 | length 21 1154 | bytes (Ljava/lang/Object;)Z 1155 | } 1156 | Constant_Utf8_info { 1157 | tag 1 1158 | length 20 1159 | bytes sim/access/SIMSystem 1160 | } 1161 | Constant_Classref_info { 1162 | tag 7 1163 | name_index 252 // sim/access/SIMSystem 1164 | } 1165 | Constant_Utf8_info { 1166 | tag 1 1167 | length 14 1168 | bytes NO_EF_SELECTED 1169 | } 1170 | Constant_Utf8_info { 1171 | tag 1 1172 | length 17 1173 | bytes FILE_INCONSISTENT 1174 | } 1175 | Constant_Utf8_info { 1176 | tag 1 1177 | length 16 1178 | bytes AC_NOT_FULFILLED 1179 | } 1180 | Constant_Utf8_info { 1181 | tag 1 1182 | length 14 1183 | bytes FILE_NOT_FOUND 1184 | } 1185 | Constant_Utf8_info { 1186 | tag 1 1187 | length 14 1188 | bytes INTERNAL_ERROR 1189 | } 1190 | Constant_Integer_info { 1191 | tag 3 1192 | bytes 5 1193 | } 1194 | Constant_Utf8_info { 1195 | tag 1 1196 | length 33 1197 | bytes INVALIDATION_STATUS_CONTRADICTION 1198 | } 1199 | Constant_Integer_info { 1200 | tag 3 1201 | bytes 6 1202 | } 1203 | Constant_Utf8_info { 1204 | tag 1 1205 | length 22 1206 | bytes OUT_OF_FILE_BOUNDARIES 1207 | } 1208 | Constant_Integer_info { 1209 | tag 3 1210 | bytes 7 1211 | } 1212 | Constant_Utf8_info { 1213 | tag 1 1214 | length 24 1215 | bytes OUT_OF_RECORD_BOUNDARIES 1216 | } 1217 | Constant_Integer_info { 1218 | tag 3 1219 | bytes 8 1220 | } 1221 | Constant_Utf8_info { 1222 | tag 1 1223 | length 27 1224 | bytes RECORD_NUMBER_NOT_AVAILABLE 1225 | } 1226 | Constant_Integer_info { 1227 | tag 3 1228 | bytes 9 1229 | } 1230 | Constant_Utf8_info { 1231 | tag 1 1232 | length 12 1233 | bytes INVALID_MODE 1234 | } 1235 | Constant_Integer_info { 1236 | tag 3 1237 | bytes 10 1238 | } 1239 | Constant_Utf8_info { 1240 | tag 1 1241 | length 17 1242 | bytes PATTERN_NOT_FOUND 1243 | } 1244 | Constant_Integer_info { 1245 | tag 3 1246 | bytes 11 1247 | } 1248 | Constant_Utf8_info { 1249 | tag 1 1250 | length 17 1251 | bytes MAX_VALUE_REACHED 1252 | } 1253 | Constant_Integer_info { 1254 | tag 3 1255 | bytes 12 1256 | } 1257 | Constant_Utf8_info { 1258 | tag 1 1259 | length 14 1260 | bytes MEMORY_PROBLEM 1261 | } 1262 | Constant_Integer_info { 1263 | tag 3 1264 | bytes 13 1265 | } 1266 | Constant_Utf8_info { 1267 | tag 1 1268 | length 6 1269 | bytes 1270 | } 1271 | Constant_Utf8_info { 1272 | tag 1 1273 | length 7 1274 | bytes throwIt 1275 | } 1276 | Constant_Utf8_info { 1277 | tag 1 1278 | length 9 1279 | bytes getReason 1280 | } 1281 | Constant_Utf8_info { 1282 | tag 1 1283 | length 3 1284 | bytes ()S 1285 | } 1286 | Constant_Utf8_info { 1287 | tag 1 1288 | length 9 1289 | bytes setReason 1290 | } 1291 | Constant_Utf8_info { 1292 | tag 1 1293 | length 27 1294 | bytes sim/access/SIMViewException 1295 | } 1296 | Constant_Classref_info { 1297 | tag 7 1298 | name_index 281 // sim/access/SIMViewException 1299 | } 1300 | Constant_Utf8_info { 1301 | tag 1 1302 | length 19 1303 | bytes java/lang/Throwable 1304 | } 1305 | Constant_Classref_info { 1306 | tag 7 1307 | name_index 283 // java/lang/Throwable 1308 | } 1309 | Constant_Utf8_info { 1310 | tag 1 1311 | length 19 1312 | bytes java/lang/Exception 1313 | } 1314 | Constant_Classref_info { 1315 | tag 7 1316 | name_index 285 // java/lang/Exception 1317 | } 1318 | Constant_Utf8_info { 1319 | tag 1 1320 | length 26 1321 | bytes java/lang/RuntimeException 1322 | } 1323 | Constant_Classref_info { 1324 | tag 7 1325 | name_index 287 // java/lang/RuntimeException 1326 | } 1327 | Constant_Utf8_info { 1328 | tag 1 1329 | length 39 1330 | bytes javacard/framework/CardRuntimeException 1331 | } 1332 | Constant_Classref_info { 1333 | tag 7 1334 | name_index 289 // javacard/framework/CardRuntimeException 1335 | } 1336 | Constant_Utf8_info { 1337 | tag 1 1338 | length 10 1339 | bytes sim/access 1340 | } 1341 | CONSTANT_Package_info { 1342 | tag 13 1343 | flags 1 1344 | name_index 291 // sim/access 1345 | minor_version 2 1346 | major_version 2 1347 | aid_length 16 1348 | aid 0xA0:0x0:0x0:0x0:0x9:0x0:0x3:0xFF:0xFF:0xFF:0xFF:0x89:0x10:0x71:0x0:0x1 1349 | } 1350 | } 1351 | this_package 292 1352 | export_class_count 3 1353 | export_classes { 1354 | class_info { // sim/access/SIMView 1355 | token 0 1356 | access_flags public abstract interface shareable 1357 | name_index 243 // sim/access/SIMView 1358 | export_supers_count 1 1359 | supers { 1360 | constant_pool_index 245 // java/lang/Object 1361 | } 1362 | export_interfaces_count 1 1363 | interfaces { 1364 | constant_pool_index 247 // javacard/framework/Shareable 1365 | } 1366 | export_fields_count 112 1367 | fields { 1368 | field_info { 1369 | token 255 1370 | access_flags public static final 1371 | name_index 0 // FID_MF 1372 | Descriptor_Index 1 // S 1373 | attributes_count 1 1374 | attributes { 1375 | ConstantValue_attribute { 1376 | attribute_name_index 2 // ConstantValue 1377 | attribute_length 2 1378 | constantvalue_index 3 // value = 16128 1379 | } 1380 | } 1381 | } 1382 | field_info { 1383 | token 255 1384 | access_flags public static final 1385 | name_index 4 // FID_DF_TELECOM 1386 | Descriptor_Index 1 // S 1387 | attributes_count 1 1388 | attributes { 1389 | ConstantValue_attribute { 1390 | attribute_name_index 2 // ConstantValue 1391 | attribute_length 2 1392 | constantvalue_index 5 // value = 32528 1393 | } 1394 | } 1395 | } 1396 | field_info { 1397 | token 255 1398 | access_flags public static final 1399 | name_index 6 // FID_DF_GSM 1400 | Descriptor_Index 1 // S 1401 | attributes_count 1 1402 | attributes { 1403 | ConstantValue_attribute { 1404 | attribute_name_index 2 // ConstantValue 1405 | attribute_length 2 1406 | constantvalue_index 7 // value = 32544 1407 | } 1408 | } 1409 | } 1410 | field_info { 1411 | token 255 1412 | access_flags public static final 1413 | name_index 8 // FID_DF_DCS_1800 1414 | Descriptor_Index 1 // S 1415 | attributes_count 1 1416 | attributes { 1417 | ConstantValue_attribute { 1418 | attribute_name_index 2 // ConstantValue 1419 | attribute_length 2 1420 | constantvalue_index 9 // value = 32545 1421 | } 1422 | } 1423 | } 1424 | field_info { 1425 | token 255 1426 | access_flags public static final 1427 | name_index 10 // FID_DF_IS_41 1428 | Descriptor_Index 1 // S 1429 | attributes_count 1 1430 | attributes { 1431 | ConstantValue_attribute { 1432 | attribute_name_index 2 // ConstantValue 1433 | attribute_length 2 1434 | constantvalue_index 11 // value = 32546 1435 | } 1436 | } 1437 | } 1438 | field_info { 1439 | token 255 1440 | access_flags public static final 1441 | name_index 12 // FID_DF_FP_CTS 1442 | Descriptor_Index 1 // S 1443 | attributes_count 1 1444 | attributes { 1445 | ConstantValue_attribute { 1446 | attribute_name_index 2 // ConstantValue 1447 | attribute_length 2 1448 | constantvalue_index 13 // value = 32547 1449 | } 1450 | } 1451 | } 1452 | field_info { 1453 | token 255 1454 | access_flags public static final 1455 | name_index 14 // FID_DF_PDC 1456 | Descriptor_Index 1 // S 1457 | attributes_count 1 1458 | attributes { 1459 | ConstantValue_attribute { 1460 | attribute_name_index 2 // ConstantValue 1461 | attribute_length 2 1462 | constantvalue_index 15 // value = 32640 1463 | } 1464 | } 1465 | } 1466 | field_info { 1467 | token 255 1468 | access_flags public static final 1469 | name_index 16 // FID_DF_TETRA 1470 | Descriptor_Index 1 // S 1471 | attributes_count 1 1472 | attributes { 1473 | ConstantValue_attribute { 1474 | attribute_name_index 2 // ConstantValue 1475 | attribute_length 2 1476 | constantvalue_index 17 // value = 32656 1477 | } 1478 | } 1479 | } 1480 | field_info { 1481 | token 255 1482 | access_flags public static final 1483 | name_index 18 // FID_DF_TIA_EIA_136 1484 | Descriptor_Index 1 // S 1485 | attributes_count 1 1486 | attributes { 1487 | ConstantValue_attribute { 1488 | attribute_name_index 2 // ConstantValue 1489 | attribute_length 2 1490 | constantvalue_index 19 // value = 32548 1491 | } 1492 | } 1493 | } 1494 | field_info { 1495 | token 255 1496 | access_flags public static final 1497 | name_index 20 // FID_DF_TIA_EIA_95 1498 | Descriptor_Index 1 // S 1499 | attributes_count 1 1500 | attributes { 1501 | ConstantValue_attribute { 1502 | attribute_name_index 2 // ConstantValue 1503 | attribute_length 2 1504 | constantvalue_index 21 // value = 32549 1505 | } 1506 | } 1507 | } 1508 | field_info { 1509 | token 255 1510 | access_flags public static final 1511 | name_index 22 // FID_DF_Graphics 1512 | Descriptor_Index 1 // S 1513 | attributes_count 1 1514 | attributes { 1515 | ConstantValue_attribute { 1516 | attribute_name_index 2 // ConstantValue 1517 | attribute_length 2 1518 | constantvalue_index 23 // value = 24400 1519 | } 1520 | } 1521 | } 1522 | field_info { 1523 | token 255 1524 | access_flags public static final 1525 | name_index 24 // FID_DF_GRAPHICS 1526 | Descriptor_Index 1 // S 1527 | attributes_count 1 1528 | attributes { 1529 | ConstantValue_attribute { 1530 | attribute_name_index 2 // ConstantValue 1531 | attribute_length 2 1532 | constantvalue_index 23 // value = 24400 1533 | } 1534 | } 1535 | } 1536 | field_info { 1537 | token 255 1538 | access_flags public static final 1539 | name_index 25 // FID_DF_IRIDIUM 1540 | Descriptor_Index 1 // S 1541 | attributes_count 1 1542 | attributes { 1543 | ConstantValue_attribute { 1544 | attribute_name_index 2 // ConstantValue 1545 | attribute_length 2 1546 | constantvalue_index 26 // value = 24368 1547 | } 1548 | } 1549 | } 1550 | field_info { 1551 | token 255 1552 | access_flags public static final 1553 | name_index 27 // FID_DF_GLOBALSTAR 1554 | Descriptor_Index 1 // S 1555 | attributes_count 1 1556 | attributes { 1557 | ConstantValue_attribute { 1558 | attribute_name_index 2 // ConstantValue 1559 | attribute_length 2 1560 | constantvalue_index 28 // value = 24369 1561 | } 1562 | } 1563 | } 1564 | field_info { 1565 | token 255 1566 | access_flags public static final 1567 | name_index 29 // FID_DF_ICO 1568 | Descriptor_Index 1 // S 1569 | attributes_count 1 1570 | attributes { 1571 | ConstantValue_attribute { 1572 | attribute_name_index 2 // ConstantValue 1573 | attribute_length 2 1574 | constantvalue_index 30 // value = 24370 1575 | } 1576 | } 1577 | } 1578 | field_info { 1579 | token 255 1580 | access_flags public static final 1581 | name_index 31 // FID_DF_ACES 1582 | Descriptor_Index 1 // S 1583 | attributes_count 1 1584 | attributes { 1585 | ConstantValue_attribute { 1586 | attribute_name_index 2 // ConstantValue 1587 | attribute_length 2 1588 | constantvalue_index 32 // value = 24371 1589 | } 1590 | } 1591 | } 1592 | field_info { 1593 | token 255 1594 | access_flags public static final 1595 | name_index 33 // FID_DF_PCS_1900 1596 | Descriptor_Index 1 // S 1597 | attributes_count 1 1598 | attributes { 1599 | ConstantValue_attribute { 1600 | attribute_name_index 2 // ConstantValue 1601 | attribute_length 2 1602 | constantvalue_index 34 // value = 24384 1603 | } 1604 | } 1605 | } 1606 | field_info { 1607 | token 255 1608 | access_flags public static final 1609 | name_index 35 // FID_DF_CTS 1610 | Descriptor_Index 1 // S 1611 | attributes_count 1 1612 | attributes { 1613 | ConstantValue_attribute { 1614 | attribute_name_index 2 // ConstantValue 1615 | attribute_length 2 1616 | constantvalue_index 36 // value = 24416 1617 | } 1618 | } 1619 | } 1620 | field_info { 1621 | token 255 1622 | access_flags public static final 1623 | name_index 37 // FID_DF_SOLSA 1624 | Descriptor_Index 1 // S 1625 | attributes_count 1 1626 | attributes { 1627 | ConstantValue_attribute { 1628 | attribute_name_index 2 // ConstantValue 1629 | attribute_length 2 1630 | constantvalue_index 38 // value = 24432 1631 | } 1632 | } 1633 | } 1634 | field_info { 1635 | token 255 1636 | access_flags public static final 1637 | name_index 39 // FID_DF_TIA_EIA_553 1638 | Descriptor_Index 1 // S 1639 | attributes_count 1 1640 | attributes { 1641 | ConstantValue_attribute { 1642 | attribute_name_index 2 // ConstantValue 1643 | attribute_length 2 1644 | constantvalue_index 34 // value = 24384 1645 | } 1646 | } 1647 | } 1648 | field_info { 1649 | token 255 1650 | access_flags public static final 1651 | name_index 40 // FID_DF_MEXE 1652 | Descriptor_Index 1 // S 1653 | attributes_count 1 1654 | attributes { 1655 | ConstantValue_attribute { 1656 | attribute_name_index 2 // ConstantValue 1657 | attribute_length 2 1658 | constantvalue_index 41 // value = 24380 1659 | } 1660 | } 1661 | } 1662 | field_info { 1663 | token 255 1664 | access_flags public static final 1665 | name_index 42 // FID_EF_ICCID 1666 | Descriptor_Index 1 // S 1667 | attributes_count 1 1668 | attributes { 1669 | ConstantValue_attribute { 1670 | attribute_name_index 2 // ConstantValue 1671 | attribute_length 2 1672 | constantvalue_index 43 // value = 12258 1673 | } 1674 | } 1675 | } 1676 | field_info { 1677 | token 255 1678 | access_flags public static final 1679 | name_index 44 // FID_EF_ELP 1680 | Descriptor_Index 1 // S 1681 | attributes_count 1 1682 | attributes { 1683 | ConstantValue_attribute { 1684 | attribute_name_index 2 // ConstantValue 1685 | attribute_length 2 1686 | constantvalue_index 45 // value = 12037 1687 | } 1688 | } 1689 | } 1690 | field_info { 1691 | token 255 1692 | access_flags public static final 1693 | name_index 46 // FID_EF_ADN 1694 | Descriptor_Index 1 // S 1695 | attributes_count 1 1696 | attributes { 1697 | ConstantValue_attribute { 1698 | attribute_name_index 2 // ConstantValue 1699 | attribute_length 2 1700 | constantvalue_index 47 // value = 28474 1701 | } 1702 | } 1703 | } 1704 | field_info { 1705 | token 255 1706 | access_flags public static final 1707 | name_index 48 // FID_EF_FDN 1708 | Descriptor_Index 1 // S 1709 | attributes_count 1 1710 | attributes { 1711 | ConstantValue_attribute { 1712 | attribute_name_index 2 // ConstantValue 1713 | attribute_length 2 1714 | constantvalue_index 49 // value = 28475 1715 | } 1716 | } 1717 | } 1718 | field_info { 1719 | token 255 1720 | access_flags public static final 1721 | name_index 50 // FID_EF_SMS 1722 | Descriptor_Index 1 // S 1723 | attributes_count 1 1724 | attributes { 1725 | ConstantValue_attribute { 1726 | attribute_name_index 2 // ConstantValue 1727 | attribute_length 2 1728 | constantvalue_index 51 // value = 28476 1729 | } 1730 | } 1731 | } 1732 | field_info { 1733 | token 255 1734 | access_flags public static final 1735 | name_index 52 // FID_EF_CCP 1736 | Descriptor_Index 1 // S 1737 | attributes_count 1 1738 | attributes { 1739 | ConstantValue_attribute { 1740 | attribute_name_index 2 // ConstantValue 1741 | attribute_length 2 1742 | constantvalue_index 53 // value = 28477 1743 | } 1744 | } 1745 | } 1746 | field_info { 1747 | token 255 1748 | access_flags public static final 1749 | name_index 54 // FID_EF_MSISDN 1750 | Descriptor_Index 1 // S 1751 | attributes_count 1 1752 | attributes { 1753 | ConstantValue_attribute { 1754 | attribute_name_index 2 // ConstantValue 1755 | attribute_length 2 1756 | constantvalue_index 55 // value = 28480 1757 | } 1758 | } 1759 | } 1760 | field_info { 1761 | token 255 1762 | access_flags public static final 1763 | name_index 56 // FID_EF_SMSP 1764 | Descriptor_Index 1 // S 1765 | attributes_count 1 1766 | attributes { 1767 | ConstantValue_attribute { 1768 | attribute_name_index 2 // ConstantValue 1769 | attribute_length 2 1770 | constantvalue_index 57 // value = 28482 1771 | } 1772 | } 1773 | } 1774 | field_info { 1775 | token 255 1776 | access_flags public static final 1777 | name_index 58 // FID_EF_SMSS 1778 | Descriptor_Index 1 // S 1779 | attributes_count 1 1780 | attributes { 1781 | ConstantValue_attribute { 1782 | attribute_name_index 2 // ConstantValue 1783 | attribute_length 2 1784 | constantvalue_index 59 // value = 28483 1785 | } 1786 | } 1787 | } 1788 | field_info { 1789 | token 255 1790 | access_flags public static final 1791 | name_index 60 // FID_EF_LND 1792 | Descriptor_Index 1 // S 1793 | attributes_count 1 1794 | attributes { 1795 | ConstantValue_attribute { 1796 | attribute_name_index 2 // ConstantValue 1797 | attribute_length 2 1798 | constantvalue_index 61 // value = 28484 1799 | } 1800 | } 1801 | } 1802 | field_info { 1803 | token 255 1804 | access_flags public static final 1805 | name_index 62 // FID_EF_SDN 1806 | Descriptor_Index 1 // S 1807 | attributes_count 1 1808 | attributes { 1809 | ConstantValue_attribute { 1810 | attribute_name_index 2 // ConstantValue 1811 | attribute_length 2 1812 | constantvalue_index 63 // value = 28489 1813 | } 1814 | } 1815 | } 1816 | field_info { 1817 | token 255 1818 | access_flags public static final 1819 | name_index 64 // FID_EF_EXT1 1820 | Descriptor_Index 1 // S 1821 | attributes_count 1 1822 | attributes { 1823 | ConstantValue_attribute { 1824 | attribute_name_index 2 // ConstantValue 1825 | attribute_length 2 1826 | constantvalue_index 65 // value = 28490 1827 | } 1828 | } 1829 | } 1830 | field_info { 1831 | token 255 1832 | access_flags public static final 1833 | name_index 66 // FID_EF_EXT2 1834 | Descriptor_Index 1 // S 1835 | attributes_count 1 1836 | attributes { 1837 | ConstantValue_attribute { 1838 | attribute_name_index 2 // ConstantValue 1839 | attribute_length 2 1840 | constantvalue_index 67 // value = 28491 1841 | } 1842 | } 1843 | } 1844 | field_info { 1845 | token 255 1846 | access_flags public static final 1847 | name_index 68 // FID_EF_EXT3 1848 | Descriptor_Index 1 // S 1849 | attributes_count 1 1850 | attributes { 1851 | ConstantValue_attribute { 1852 | attribute_name_index 2 // ConstantValue 1853 | attribute_length 2 1854 | constantvalue_index 69 // value = 28492 1855 | } 1856 | } 1857 | } 1858 | field_info { 1859 | token 255 1860 | access_flags public static final 1861 | name_index 70 // FID_EF_BDN 1862 | Descriptor_Index 1 // S 1863 | attributes_count 1 1864 | attributes { 1865 | ConstantValue_attribute { 1866 | attribute_name_index 2 // ConstantValue 1867 | attribute_length 2 1868 | constantvalue_index 71 // value = 28493 1869 | } 1870 | } 1871 | } 1872 | field_info { 1873 | token 255 1874 | access_flags public static final 1875 | name_index 72 // FID_EF_EXT4 1876 | Descriptor_Index 1 // S 1877 | attributes_count 1 1878 | attributes { 1879 | ConstantValue_attribute { 1880 | attribute_name_index 2 // ConstantValue 1881 | attribute_length 2 1882 | constantvalue_index 73 // value = 28494 1883 | } 1884 | } 1885 | } 1886 | field_info { 1887 | token 255 1888 | access_flags public static final 1889 | name_index 74 // FID_EF_SMSR 1890 | Descriptor_Index 1 // S 1891 | attributes_count 1 1892 | attributes { 1893 | ConstantValue_attribute { 1894 | attribute_name_index 2 // ConstantValue 1895 | attribute_length 2 1896 | constantvalue_index 75 // value = 28487 1897 | } 1898 | } 1899 | } 1900 | field_info { 1901 | token 255 1902 | access_flags public static final 1903 | name_index 76 // FID_EF_ECCP 1904 | Descriptor_Index 1 // S 1905 | attributes_count 1 1906 | attributes { 1907 | ConstantValue_attribute { 1908 | attribute_name_index 2 // ConstantValue 1909 | attribute_length 2 1910 | constantvalue_index 77 // value = 28495 1911 | } 1912 | } 1913 | } 1914 | field_info { 1915 | token 255 1916 | access_flags public static final 1917 | name_index 78 // FID_EF_CMI 1918 | Descriptor_Index 1 // S 1919 | attributes_count 1 1920 | attributes { 1921 | ConstantValue_attribute { 1922 | attribute_name_index 2 // ConstantValue 1923 | attribute_length 2 1924 | constantvalue_index 79 // value = 28504 1925 | } 1926 | } 1927 | } 1928 | field_info { 1929 | token 255 1930 | access_flags public static final 1931 | name_index 80 // FID_EF_IMG 1932 | Descriptor_Index 1 // S 1933 | attributes_count 1 1934 | attributes { 1935 | ConstantValue_attribute { 1936 | attribute_name_index 2 // ConstantValue 1937 | attribute_length 2 1938 | constantvalue_index 81 // value = 20256 1939 | } 1940 | } 1941 | } 1942 | field_info { 1943 | token 255 1944 | access_flags public static final 1945 | name_index 82 // FID_EF_LP 1946 | Descriptor_Index 1 // S 1947 | attributes_count 1 1948 | attributes { 1949 | ConstantValue_attribute { 1950 | attribute_name_index 2 // ConstantValue 1951 | attribute_length 2 1952 | constantvalue_index 83 // value = 28421 1953 | } 1954 | } 1955 | } 1956 | field_info { 1957 | token 255 1958 | access_flags public static final 1959 | name_index 84 // FID_EF_IMSI 1960 | Descriptor_Index 1 // S 1961 | attributes_count 1 1962 | attributes { 1963 | ConstantValue_attribute { 1964 | attribute_name_index 2 // ConstantValue 1965 | attribute_length 2 1966 | constantvalue_index 85 // value = 28423 1967 | } 1968 | } 1969 | } 1970 | field_info { 1971 | token 255 1972 | access_flags public static final 1973 | name_index 86 // FID_EF_KC 1974 | Descriptor_Index 1 // S 1975 | attributes_count 1 1976 | attributes { 1977 | ConstantValue_attribute { 1978 | attribute_name_index 2 // ConstantValue 1979 | attribute_length 2 1980 | constantvalue_index 87 // value = 28448 1981 | } 1982 | } 1983 | } 1984 | field_info { 1985 | token 255 1986 | access_flags public static final 1987 | name_index 88 // FID_EF_PLMNSEL 1988 | Descriptor_Index 1 // S 1989 | attributes_count 1 1990 | attributes { 1991 | ConstantValue_attribute { 1992 | attribute_name_index 2 // ConstantValue 1993 | attribute_length 2 1994 | constantvalue_index 89 // value = 28464 1995 | } 1996 | } 1997 | } 1998 | field_info { 1999 | token 255 2000 | access_flags public static final 2001 | name_index 90 // FID_EF_HPLMN 2002 | Descriptor_Index 1 // S 2003 | attributes_count 1 2004 | attributes { 2005 | ConstantValue_attribute { 2006 | attribute_name_index 2 // ConstantValue 2007 | attribute_length 2 2008 | constantvalue_index 91 // value = 28465 2009 | } 2010 | } 2011 | } 2012 | field_info { 2013 | token 255 2014 | access_flags public static final 2015 | name_index 92 // FID_EF_ACMMAX 2016 | Descriptor_Index 1 // S 2017 | attributes_count 1 2018 | attributes { 2019 | ConstantValue_attribute { 2020 | attribute_name_index 2 // ConstantValue 2021 | attribute_length 2 2022 | constantvalue_index 93 // value = 28471 2023 | } 2024 | } 2025 | } 2026 | field_info { 2027 | token 255 2028 | access_flags public static final 2029 | name_index 94 // FID_EF_SST 2030 | Descriptor_Index 1 // S 2031 | attributes_count 1 2032 | attributes { 2033 | ConstantValue_attribute { 2034 | attribute_name_index 2 // ConstantValue 2035 | attribute_length 2 2036 | constantvalue_index 95 // value = 28472 2037 | } 2038 | } 2039 | } 2040 | field_info { 2041 | token 255 2042 | access_flags public static final 2043 | name_index 96 // FID_EF_ACM 2044 | Descriptor_Index 1 // S 2045 | attributes_count 1 2046 | attributes { 2047 | ConstantValue_attribute { 2048 | attribute_name_index 2 // ConstantValue 2049 | attribute_length 2 2050 | constantvalue_index 97 // value = 28473 2051 | } 2052 | } 2053 | } 2054 | field_info { 2055 | token 255 2056 | access_flags public static final 2057 | name_index 98 // FID_EF_GID1 2058 | Descriptor_Index 1 // S 2059 | attributes_count 1 2060 | attributes { 2061 | ConstantValue_attribute { 2062 | attribute_name_index 2 // ConstantValue 2063 | attribute_length 2 2064 | constantvalue_index 99 // value = 28478 2065 | } 2066 | } 2067 | } 2068 | field_info { 2069 | token 255 2070 | access_flags public static final 2071 | name_index 100 // FID_EF_GID2 2072 | Descriptor_Index 1 // S 2073 | attributes_count 1 2074 | attributes { 2075 | ConstantValue_attribute { 2076 | attribute_name_index 2 // ConstantValue 2077 | attribute_length 2 2078 | constantvalue_index 101 // value = 28479 2079 | } 2080 | } 2081 | } 2082 | field_info { 2083 | token 255 2084 | access_flags public static final 2085 | name_index 102 // FID_EF_SPN 2086 | Descriptor_Index 1 // S 2087 | attributes_count 1 2088 | attributes { 2089 | ConstantValue_attribute { 2090 | attribute_name_index 2 // ConstantValue 2091 | attribute_length 2 2092 | constantvalue_index 103 // value = 28486 2093 | } 2094 | } 2095 | } 2096 | field_info { 2097 | token 255 2098 | access_flags public static final 2099 | name_index 104 // FID_EF_PUCT 2100 | Descriptor_Index 1 // S 2101 | attributes_count 1 2102 | attributes { 2103 | ConstantValue_attribute { 2104 | attribute_name_index 2 // ConstantValue 2105 | attribute_length 2 2106 | constantvalue_index 105 // value = 28481 2107 | } 2108 | } 2109 | } 2110 | field_info { 2111 | token 255 2112 | access_flags public static final 2113 | name_index 106 // FID_EF_CBMI 2114 | Descriptor_Index 1 // S 2115 | attributes_count 1 2116 | attributes { 2117 | ConstantValue_attribute { 2118 | attribute_name_index 2 // ConstantValue 2119 | attribute_length 2 2120 | constantvalue_index 107 // value = 28485 2121 | } 2122 | } 2123 | } 2124 | field_info { 2125 | token 255 2126 | access_flags public static final 2127 | name_index 108 // FID_EF_BCCH 2128 | Descriptor_Index 1 // S 2129 | attributes_count 1 2130 | attributes { 2131 | ConstantValue_attribute { 2132 | attribute_name_index 2 // ConstantValue 2133 | attribute_length 2 2134 | constantvalue_index 109 // value = 28532 2135 | } 2136 | } 2137 | } 2138 | field_info { 2139 | token 255 2140 | access_flags public static final 2141 | name_index 110 // FID_EF_ACC 2142 | Descriptor_Index 1 // S 2143 | attributes_count 1 2144 | attributes { 2145 | ConstantValue_attribute { 2146 | attribute_name_index 2 // ConstantValue 2147 | attribute_length 2 2148 | constantvalue_index 111 // value = 28536 2149 | } 2150 | } 2151 | } 2152 | field_info { 2153 | token 255 2154 | access_flags public static final 2155 | name_index 112 // FID_EF_FPLMN 2156 | Descriptor_Index 1 // S 2157 | attributes_count 1 2158 | attributes { 2159 | ConstantValue_attribute { 2160 | attribute_name_index 2 // ConstantValue 2161 | attribute_length 2 2162 | constantvalue_index 113 // value = 28539 2163 | } 2164 | } 2165 | } 2166 | field_info { 2167 | token 255 2168 | access_flags public static final 2169 | name_index 114 // FID_EF_LOCI 2170 | Descriptor_Index 1 // S 2171 | attributes_count 1 2172 | attributes { 2173 | ConstantValue_attribute { 2174 | attribute_name_index 2 // ConstantValue 2175 | attribute_length 2 2176 | constantvalue_index 115 // value = 28542 2177 | } 2178 | } 2179 | } 2180 | field_info { 2181 | token 255 2182 | access_flags public static final 2183 | name_index 116 // FID_EF_AD 2184 | Descriptor_Index 1 // S 2185 | attributes_count 1 2186 | attributes { 2187 | ConstantValue_attribute { 2188 | attribute_name_index 2 // ConstantValue 2189 | attribute_length 2 2190 | constantvalue_index 117 // value = 28589 2191 | } 2192 | } 2193 | } 2194 | field_info { 2195 | token 255 2196 | access_flags public static final 2197 | name_index 118 // FID_EF_PHASE 2198 | Descriptor_Index 1 // S 2199 | attributes_count 1 2200 | attributes { 2201 | ConstantValue_attribute { 2202 | attribute_name_index 2 // ConstantValue 2203 | attribute_length 2 2204 | constantvalue_index 119 // value = 28590 2205 | } 2206 | } 2207 | } 2208 | field_info { 2209 | token 255 2210 | access_flags public static final 2211 | name_index 120 // FID_EF_VGCS 2212 | Descriptor_Index 1 // S 2213 | attributes_count 1 2214 | attributes { 2215 | ConstantValue_attribute { 2216 | attribute_name_index 2 // ConstantValue 2217 | attribute_length 2 2218 | constantvalue_index 121 // value = 28593 2219 | } 2220 | } 2221 | } 2222 | field_info { 2223 | token 255 2224 | access_flags public static final 2225 | name_index 122 // FID_EF_VGCSS 2226 | Descriptor_Index 1 // S 2227 | attributes_count 1 2228 | attributes { 2229 | ConstantValue_attribute { 2230 | attribute_name_index 2 // ConstantValue 2231 | attribute_length 2 2232 | constantvalue_index 123 // value = 28594 2233 | } 2234 | } 2235 | } 2236 | field_info { 2237 | token 255 2238 | access_flags public static final 2239 | name_index 124 // FID_EF_VBS 2240 | Descriptor_Index 1 // S 2241 | attributes_count 1 2242 | attributes { 2243 | ConstantValue_attribute { 2244 | attribute_name_index 2 // ConstantValue 2245 | attribute_length 2 2246 | constantvalue_index 125 // value = 28595 2247 | } 2248 | } 2249 | } 2250 | field_info { 2251 | token 255 2252 | access_flags public static final 2253 | name_index 126 // FID_EF_VBSS 2254 | Descriptor_Index 1 // S 2255 | attributes_count 1 2256 | attributes { 2257 | ConstantValue_attribute { 2258 | attribute_name_index 2 // ConstantValue 2259 | attribute_length 2 2260 | constantvalue_index 127 // value = 28596 2261 | } 2262 | } 2263 | } 2264 | field_info { 2265 | token 255 2266 | access_flags public static final 2267 | name_index 128 // FID_EF_EMLPP 2268 | Descriptor_Index 1 // S 2269 | attributes_count 1 2270 | attributes { 2271 | ConstantValue_attribute { 2272 | attribute_name_index 2 // ConstantValue 2273 | attribute_length 2 2274 | constantvalue_index 129 // value = 28597 2275 | } 2276 | } 2277 | } 2278 | field_info { 2279 | token 255 2280 | access_flags public static final 2281 | name_index 130 // FID_EF_AAEM 2282 | Descriptor_Index 1 // S 2283 | attributes_count 1 2284 | attributes { 2285 | ConstantValue_attribute { 2286 | attribute_name_index 2 // ConstantValue 2287 | attribute_length 2 2288 | constantvalue_index 131 // value = 28598 2289 | } 2290 | } 2291 | } 2292 | field_info { 2293 | token 255 2294 | access_flags public static final 2295 | name_index 132 // FID_EF_CBMID 2296 | Descriptor_Index 1 // S 2297 | attributes_count 1 2298 | attributes { 2299 | ConstantValue_attribute { 2300 | attribute_name_index 2 // ConstantValue 2301 | attribute_length 2 2302 | constantvalue_index 133 // value = 28488 2303 | } 2304 | } 2305 | } 2306 | field_info { 2307 | token 255 2308 | access_flags public static final 2309 | name_index 134 // FID_EF_ECC 2310 | Descriptor_Index 1 // S 2311 | attributes_count 1 2312 | attributes { 2313 | ConstantValue_attribute { 2314 | attribute_name_index 2 // ConstantValue 2315 | attribute_length 2 2316 | constantvalue_index 135 // value = 28599 2317 | } 2318 | } 2319 | } 2320 | field_info { 2321 | token 255 2322 | access_flags public static final 2323 | name_index 136 // FID_EF_CBMIR 2324 | Descriptor_Index 1 // S 2325 | attributes_count 1 2326 | attributes { 2327 | ConstantValue_attribute { 2328 | attribute_name_index 2 // ConstantValue 2329 | attribute_length 2 2330 | constantvalue_index 137 // value = 28496 2331 | } 2332 | } 2333 | } 2334 | field_info { 2335 | token 255 2336 | access_flags public static final 2337 | name_index 138 // FID_EF_DCK 2338 | Descriptor_Index 1 // S 2339 | attributes_count 1 2340 | attributes { 2341 | ConstantValue_attribute { 2342 | attribute_name_index 2 // ConstantValue 2343 | attribute_length 2 2344 | constantvalue_index 139 // value = 28460 2345 | } 2346 | } 2347 | } 2348 | field_info { 2349 | token 255 2350 | access_flags public static final 2351 | name_index 140 // FID_EF_CNL 2352 | Descriptor_Index 1 // S 2353 | attributes_count 1 2354 | attributes { 2355 | ConstantValue_attribute { 2356 | attribute_name_index 2 // ConstantValue 2357 | attribute_length 2 2358 | constantvalue_index 141 // value = 28466 2359 | } 2360 | } 2361 | } 2362 | field_info { 2363 | token 255 2364 | access_flags public static final 2365 | name_index 142 // FID_EF_NIA 2366 | Descriptor_Index 1 // S 2367 | attributes_count 1 2368 | attributes { 2369 | ConstantValue_attribute { 2370 | attribute_name_index 2 // ConstantValue 2371 | attribute_length 2 2372 | constantvalue_index 143 // value = 28497 2373 | } 2374 | } 2375 | } 2376 | field_info { 2377 | token 255 2378 | access_flags public static final 2379 | name_index 144 // FID_EF_KCGPRS 2380 | Descriptor_Index 1 // S 2381 | attributes_count 1 2382 | attributes { 2383 | ConstantValue_attribute { 2384 | attribute_name_index 2 // ConstantValue 2385 | attribute_length 2 2386 | constantvalue_index 145 // value = 28498 2387 | } 2388 | } 2389 | } 2390 | field_info { 2391 | token 255 2392 | access_flags public static final 2393 | name_index 146 // FID_EF_LOCIGPRS 2394 | Descriptor_Index 1 // S 2395 | attributes_count 1 2396 | attributes { 2397 | ConstantValue_attribute { 2398 | attribute_name_index 2 // ConstantValue 2399 | attribute_length 2 2400 | constantvalue_index 147 // value = 28499 2401 | } 2402 | } 2403 | } 2404 | field_info { 2405 | token 255 2406 | access_flags public static final 2407 | name_index 148 // FID_EF_SUME 2408 | Descriptor_Index 1 // S 2409 | attributes_count 1 2410 | attributes { 2411 | ConstantValue_attribute { 2412 | attribute_name_index 2 // ConstantValue 2413 | attribute_length 2 2414 | constantvalue_index 149 // value = 28500 2415 | } 2416 | } 2417 | } 2418 | field_info { 2419 | token 255 2420 | access_flags public static final 2421 | name_index 150 // FID_EF_PLMNWACT 2422 | Descriptor_Index 1 // S 2423 | attributes_count 1 2424 | attributes { 2425 | ConstantValue_attribute { 2426 | attribute_name_index 2 // ConstantValue 2427 | attribute_length 2 2428 | constantvalue_index 151 // value = 28512 2429 | } 2430 | } 2431 | } 2432 | field_info { 2433 | token 255 2434 | access_flags public static final 2435 | name_index 152 // FID_EF_OPLMNWACT 2436 | Descriptor_Index 1 // S 2437 | attributes_count 1 2438 | attributes { 2439 | ConstantValue_attribute { 2440 | attribute_name_index 2 // ConstantValue 2441 | attribute_length 2 2442 | constantvalue_index 153 // value = 28513 2443 | } 2444 | } 2445 | } 2446 | field_info { 2447 | token 255 2448 | access_flags public static final 2449 | name_index 154 // FID_EF_HPLMNWACT 2450 | Descriptor_Index 1 // S 2451 | attributes_count 1 2452 | attributes { 2453 | ConstantValue_attribute { 2454 | attribute_name_index 2 // ConstantValue 2455 | attribute_length 2 2456 | constantvalue_index 155 // value = 28514 2457 | } 2458 | } 2459 | } 2460 | field_info { 2461 | token 255 2462 | access_flags public static final 2463 | name_index 156 // FID_EF_CPBCCH 2464 | Descriptor_Index 1 // S 2465 | attributes_count 1 2466 | attributes { 2467 | ConstantValue_attribute { 2468 | attribute_name_index 2 // ConstantValue 2469 | attribute_length 2 2470 | constantvalue_index 157 // value = 28515 2471 | } 2472 | } 2473 | } 2474 | field_info { 2475 | token 255 2476 | access_flags public static final 2477 | name_index 158 // FID_EF_INVSCAN 2478 | Descriptor_Index 1 // S 2479 | attributes_count 1 2480 | attributes { 2481 | ConstantValue_attribute { 2482 | attribute_name_index 2 // ConstantValue 2483 | attribute_length 2 2484 | constantvalue_index 159 // value = 28516 2485 | } 2486 | } 2487 | } 2488 | field_info { 2489 | token 255 2490 | access_flags public static final 2491 | name_index 160 // FID_EF_SAI 2492 | Descriptor_Index 1 // S 2493 | attributes_count 1 2494 | attributes { 2495 | ConstantValue_attribute { 2496 | attribute_name_index 2 // ConstantValue 2497 | attribute_length 2 2498 | constantvalue_index 161 // value = 20272 2499 | } 2500 | } 2501 | } 2502 | field_info { 2503 | token 255 2504 | access_flags public static final 2505 | name_index 162 // FID_EF_SLL 2506 | Descriptor_Index 1 // S 2507 | attributes_count 1 2508 | attributes { 2509 | ConstantValue_attribute { 2510 | attribute_name_index 2 // ConstantValue 2511 | attribute_length 2 2512 | constantvalue_index 163 // value = 20273 2513 | } 2514 | } 2515 | } 2516 | field_info { 2517 | token 255 2518 | access_flags public static final 2519 | name_index 164 // FID_EF_SID 2520 | Descriptor_Index 1 // S 2521 | attributes_count 1 2522 | attributes { 2523 | ConstantValue_attribute { 2524 | attribute_name_index 2 // ConstantValue 2525 | attribute_length 2 2526 | constantvalue_index 165 // value = 20352 2527 | } 2528 | } 2529 | } 2530 | field_info { 2531 | token 255 2532 | access_flags public static final 2533 | name_index 166 // FID_EF_GPI 2534 | Descriptor_Index 1 // S 2535 | attributes_count 1 2536 | attributes { 2537 | ConstantValue_attribute { 2538 | attribute_name_index 2 // ConstantValue 2539 | attribute_length 2 2540 | constantvalue_index 167 // value = 20353 2541 | } 2542 | } 2543 | } 2544 | field_info { 2545 | token 255 2546 | access_flags public static final 2547 | name_index 168 // FID_EF_IPC 2548 | Descriptor_Index 1 // S 2549 | attributes_count 1 2550 | attributes { 2551 | ConstantValue_attribute { 2552 | attribute_name_index 2 // ConstantValue 2553 | attribute_length 2 2554 | constantvalue_index 169 // value = 20354 2555 | } 2556 | } 2557 | } 2558 | field_info { 2559 | token 255 2560 | access_flags public static final 2561 | name_index 170 // FID_EF_COUNT 2562 | Descriptor_Index 1 // S 2563 | attributes_count 1 2564 | attributes { 2565 | ConstantValue_attribute { 2566 | attribute_name_index 2 // ConstantValue 2567 | attribute_length 2 2568 | constantvalue_index 171 // value = 20355 2569 | } 2570 | } 2571 | } 2572 | field_info { 2573 | token 255 2574 | access_flags public static final 2575 | name_index 172 // FID_EF_NSID 2576 | Descriptor_Index 1 // S 2577 | attributes_count 1 2578 | attributes { 2579 | ConstantValue_attribute { 2580 | attribute_name_index 2 // ConstantValue 2581 | attribute_length 2 2582 | constantvalue_index 173 // value = 20356 2583 | } 2584 | } 2585 | } 2586 | field_info { 2587 | token 255 2588 | access_flags public static final 2589 | name_index 174 // FID_EF_PSID 2590 | Descriptor_Index 1 // S 2591 | attributes_count 1 2592 | attributes { 2593 | ConstantValue_attribute { 2594 | attribute_name_index 2 // ConstantValue 2595 | attribute_length 2 2596 | constantvalue_index 175 // value = 20357 2597 | } 2598 | } 2599 | } 2600 | field_info { 2601 | token 255 2602 | access_flags public static final 2603 | name_index 176 // FID_EF_NETSEL 2604 | Descriptor_Index 1 // S 2605 | attributes_count 1 2606 | attributes { 2607 | ConstantValue_attribute { 2608 | attribute_name_index 2 // ConstantValue 2609 | attribute_length 2 2610 | constantvalue_index 177 // value = 20358 2611 | } 2612 | } 2613 | } 2614 | field_info { 2615 | token 255 2616 | access_flags public static final 2617 | name_index 178 // FID_EF_SPL 2618 | Descriptor_Index 1 // S 2619 | attributes_count 1 2620 | attributes { 2621 | ConstantValue_attribute { 2622 | attribute_name_index 2 // ConstantValue 2623 | attribute_length 2 2624 | constantvalue_index 179 // value = 20359 2625 | } 2626 | } 2627 | } 2628 | field_info { 2629 | token 255 2630 | access_flags public static final 2631 | name_index 180 // FID_EF_MIN 2632 | Descriptor_Index 1 // S 2633 | attributes_count 1 2634 | attributes { 2635 | ConstantValue_attribute { 2636 | attribute_name_index 2 // ConstantValue 2637 | attribute_length 2 2638 | constantvalue_index 181 // value = 20360 2639 | } 2640 | } 2641 | } 2642 | field_info { 2643 | token 255 2644 | access_flags public static final 2645 | name_index 182 // FID_EF_ACCOLC 2646 | Descriptor_Index 1 // S 2647 | attributes_count 1 2648 | attributes { 2649 | ConstantValue_attribute { 2650 | attribute_name_index 2 // ConstantValue 2651 | attribute_length 2 2652 | constantvalue_index 183 // value = 20361 2653 | } 2654 | } 2655 | } 2656 | field_info { 2657 | token 255 2658 | access_flags public static final 2659 | name_index 184 // FID_EF_FC1 2660 | Descriptor_Index 1 // S 2661 | attributes_count 1 2662 | attributes { 2663 | ConstantValue_attribute { 2664 | attribute_name_index 2 // ConstantValue 2665 | attribute_length 2 2666 | constantvalue_index 185 // value = 20362 2667 | } 2668 | } 2669 | } 2670 | field_info { 2671 | token 255 2672 | access_flags public static final 2673 | name_index 186 // FID_EF_S_ESN 2674 | Descriptor_Index 1 // S 2675 | attributes_count 1 2676 | attributes { 2677 | ConstantValue_attribute { 2678 | attribute_name_index 2 // ConstantValue 2679 | attribute_length 2 2680 | constantvalue_index 187 // value = 20363 2681 | } 2682 | } 2683 | } 2684 | field_info { 2685 | token 255 2686 | access_flags public static final 2687 | name_index 188 // FID_EF_CSID 2688 | Descriptor_Index 1 // S 2689 | attributes_count 1 2690 | attributes { 2691 | ConstantValue_attribute { 2692 | attribute_name_index 2 // ConstantValue 2693 | attribute_length 2 2694 | constantvalue_index 189 // value = 20364 2695 | } 2696 | } 2697 | } 2698 | field_info { 2699 | token 255 2700 | access_flags public static final 2701 | name_index 190 // FID_EF_REG_THRESH 2702 | Descriptor_Index 1 // S 2703 | attributes_count 1 2704 | attributes { 2705 | ConstantValue_attribute { 2706 | attribute_name_index 2 // ConstantValue 2707 | attribute_length 2 2708 | constantvalue_index 191 // value = 20365 2709 | } 2710 | } 2711 | } 2712 | field_info { 2713 | token 255 2714 | access_flags public static final 2715 | name_index 192 // FID_EF_CCCH 2716 | Descriptor_Index 1 // S 2717 | attributes_count 1 2718 | attributes { 2719 | ConstantValue_attribute { 2720 | attribute_name_index 2 // ConstantValue 2721 | attribute_length 2 2722 | constantvalue_index 193 // value = 20366 2723 | } 2724 | } 2725 | } 2726 | field_info { 2727 | token 255 2728 | access_flags public static final 2729 | name_index 194 // FID_EF_LDCC 2730 | Descriptor_Index 1 // S 2731 | attributes_count 1 2732 | attributes { 2733 | ConstantValue_attribute { 2734 | attribute_name_index 2 // ConstantValue 2735 | attribute_length 2 2736 | constantvalue_index 195 // value = 20367 2737 | } 2738 | } 2739 | } 2740 | field_info { 2741 | token 255 2742 | access_flags public static final 2743 | name_index 196 // FID_EF_GSM_RECON 2744 | Descriptor_Index 1 // S 2745 | attributes_count 1 2746 | attributes { 2747 | ConstantValue_attribute { 2748 | attribute_name_index 2 // ConstantValue 2749 | attribute_length 2 2750 | constantvalue_index 197 // value = 20368 2751 | } 2752 | } 2753 | } 2754 | field_info { 2755 | token 255 2756 | access_flags public static final 2757 | name_index 198 // FID_EF_AMPS_2_GSM 2758 | Descriptor_Index 1 // S 2759 | attributes_count 1 2760 | attributes { 2761 | ConstantValue_attribute { 2762 | attribute_name_index 2 // ConstantValue 2763 | attribute_length 2 2764 | constantvalue_index 199 // value = 20369 2765 | } 2766 | } 2767 | } 2768 | field_info { 2769 | token 255 2770 | access_flags public static final 2771 | name_index 200 // FID_EF_AMPS_UI 2772 | Descriptor_Index 1 // S 2773 | attributes_count 1 2774 | attributes { 2775 | ConstantValue_attribute { 2776 | attribute_name_index 2 // ConstantValue 2777 | attribute_length 2 2778 | constantvalue_index 201 // value = 20371 2779 | } 2780 | } 2781 | } 2782 | field_info { 2783 | token 255 2784 | access_flags public static final 2785 | name_index 202 // FID_EF_MEXE_ST 2786 | Descriptor_Index 1 // S 2787 | attributes_count 1 2788 | attributes { 2789 | ConstantValue_attribute { 2790 | attribute_name_index 2 // ConstantValue 2791 | attribute_length 2 2792 | constantvalue_index 203 // value = 20288 2793 | } 2794 | } 2795 | } 2796 | field_info { 2797 | token 255 2798 | access_flags public static final 2799 | name_index 204 // FID_EF_ORPK 2800 | Descriptor_Index 1 // S 2801 | attributes_count 1 2802 | attributes { 2803 | ConstantValue_attribute { 2804 | attribute_name_index 2 // ConstantValue 2805 | attribute_length 2 2806 | constantvalue_index 205 // value = 20289 2807 | } 2808 | } 2809 | } 2810 | field_info { 2811 | token 255 2812 | access_flags public static final 2813 | name_index 206 // FID_EF_ARPK 2814 | Descriptor_Index 1 // S 2815 | attributes_count 1 2816 | attributes { 2817 | ConstantValue_attribute { 2818 | attribute_name_index 2 // ConstantValue 2819 | attribute_length 2 2820 | constantvalue_index 207 // value = 20290 2821 | } 2822 | } 2823 | } 2824 | field_info { 2825 | token 255 2826 | access_flags public static final 2827 | name_index 208 // FID_EF_TPRPK 2828 | Descriptor_Index 1 // S 2829 | attributes_count 1 2830 | attributes { 2831 | ConstantValue_attribute { 2832 | attribute_name_index 2 // ConstantValue 2833 | attribute_length 2 2834 | constantvalue_index 209 // value = 20291 2835 | } 2836 | } 2837 | } 2838 | field_info { 2839 | token 255 2840 | access_flags public static final 2841 | name_index 210 // REC_ACC_MODE_NEXT 2842 | Descriptor_Index 211 // B 2843 | attributes_count 1 2844 | attributes { 2845 | ConstantValue_attribute { 2846 | attribute_name_index 2 // ConstantValue 2847 | attribute_length 2 2848 | constantvalue_index 212 // value = 2 2849 | } 2850 | } 2851 | } 2852 | field_info { 2853 | token 255 2854 | access_flags public static final 2855 | name_index 213 // REC_ACC_MODE_PREVIOUS 2856 | Descriptor_Index 211 // B 2857 | attributes_count 1 2858 | attributes { 2859 | ConstantValue_attribute { 2860 | attribute_name_index 2 // ConstantValue 2861 | attribute_length 2 2862 | constantvalue_index 214 // value = 3 2863 | } 2864 | } 2865 | } 2866 | field_info { 2867 | token 255 2868 | access_flags public static final 2869 | name_index 215 // REC_ACC_MODE_ABSOLUTE_CURRENT 2870 | Descriptor_Index 211 // B 2871 | attributes_count 1 2872 | attributes { 2873 | ConstantValue_attribute { 2874 | attribute_name_index 2 // ConstantValue 2875 | attribute_length 2 2876 | constantvalue_index 216 // value = 4 2877 | } 2878 | } 2879 | } 2880 | field_info { 2881 | token 255 2882 | access_flags public static final 2883 | name_index 217 // SEEK_FROM_BEGINNING_FORWARD 2884 | Descriptor_Index 211 // B 2885 | attributes_count 1 2886 | attributes { 2887 | ConstantValue_attribute { 2888 | attribute_name_index 2 // ConstantValue 2889 | attribute_length 2 2890 | constantvalue_index 218 // value = 0 2891 | } 2892 | } 2893 | } 2894 | field_info { 2895 | token 255 2896 | access_flags public static final 2897 | name_index 219 // SEEK_FROM_END_BACKWARD 2898 | Descriptor_Index 211 // B 2899 | attributes_count 1 2900 | attributes { 2901 | ConstantValue_attribute { 2902 | attribute_name_index 2 // ConstantValue 2903 | attribute_length 2 2904 | constantvalue_index 220 // value = 1 2905 | } 2906 | } 2907 | } 2908 | field_info { 2909 | token 255 2910 | access_flags public static final 2911 | name_index 221 // SEEK_FROM_NEXT_FORWARD 2912 | Descriptor_Index 211 // B 2913 | attributes_count 1 2914 | attributes { 2915 | ConstantValue_attribute { 2916 | attribute_name_index 2 // ConstantValue 2917 | attribute_length 2 2918 | constantvalue_index 212 // value = 2 2919 | } 2920 | } 2921 | } 2922 | field_info { 2923 | token 255 2924 | access_flags public static final 2925 | name_index 222 // SEEK_FROM_PREVIOUS_BACKWARD 2926 | Descriptor_Index 211 // B 2927 | attributes_count 1 2928 | attributes { 2929 | ConstantValue_attribute { 2930 | attribute_name_index 2 // ConstantValue 2931 | attribute_length 2 2932 | constantvalue_index 214 // value = 3 2933 | } 2934 | } 2935 | } 2936 | } 2937 | export_methods_count 11 2938 | methods { 2939 | method_info { 2940 | token 0 2941 | access_flags public abstract 2942 | name_index 223 // status 2943 | Descriptor_Index 224 // ([BSS)S 2944 | } 2945 | method_info { 2946 | token 1 2947 | access_flags public abstract 2948 | name_index 225 // increase 2949 | Descriptor_Index 226 // ([BS[BS)S 2950 | } 2951 | method_info { 2952 | token 2 2953 | access_flags public abstract 2954 | name_index 227 // invalidate 2955 | Descriptor_Index 228 // ()V 2956 | } 2957 | method_info { 2958 | token 3 2959 | access_flags public abstract 2960 | name_index 229 // rehabilitate 2961 | Descriptor_Index 228 // ()V 2962 | } 2963 | method_info { 2964 | token 4 2965 | access_flags public abstract 2966 | name_index 230 // readRecord 2967 | Descriptor_Index 231 // (SBS[BSS)S 2968 | } 2969 | method_info { 2970 | token 5 2971 | access_flags public abstract 2972 | name_index 232 // updateRecord 2973 | Descriptor_Index 233 // (SBS[BSS)V 2974 | } 2975 | method_info { 2976 | token 6 2977 | access_flags public abstract 2978 | name_index 234 // select 2979 | Descriptor_Index 235 // (S[BSS)S 2980 | } 2981 | method_info { 2982 | token 7 2983 | access_flags public abstract 2984 | name_index 234 // select 2985 | Descriptor_Index 236 // (S)V 2986 | } 2987 | method_info { 2988 | token 8 2989 | access_flags public abstract 2990 | name_index 237 // seek 2991 | Descriptor_Index 238 // (B[BSS)S 2992 | } 2993 | method_info { 2994 | token 9 2995 | access_flags public abstract 2996 | name_index 239 // readBinary 2997 | Descriptor_Index 235 // (S[BSS)S 2998 | } 2999 | method_info { 3000 | token 10 3001 | access_flags public abstract 3002 | name_index 240 // updateBinary 3003 | Descriptor_Index 241 // (S[BSS)V 3004 | } 3005 | } 3006 | } 3007 | class_info { // sim/access/SIMSystem 3008 | token 1 3009 | access_flags public 3010 | name_index 253 // sim/access/SIMSystem 3011 | export_supers_count 1 3012 | supers { 3013 | constant_pool_index 245 // java/lang/Object 3014 | } 3015 | export_interfaces_count 0 3016 | interfaces { 3017 | } 3018 | export_fields_count 0 3019 | fields { 3020 | } 3021 | export_methods_count 2 3022 | methods { 3023 | method_info { 3024 | token 0 3025 | access_flags public static 3026 | name_index 248 // getTheSIMView 3027 | Descriptor_Index 249 // ()Lsim/access/SIMView; 3028 | } 3029 | method_info { 3030 | token 0 3031 | access_flags public 3032 | name_index 250 // equals 3033 | Descriptor_Index 251 // (Ljava/lang/Object;)Z 3034 | } 3035 | } 3036 | } 3037 | class_info { // sim/access/SIMViewException 3038 | token 2 3039 | access_flags public 3040 | name_index 282 // sim/access/SIMViewException 3041 | export_supers_count 5 3042 | supers { 3043 | constant_pool_index 245 // java/lang/Object 3044 | constant_pool_index 284 // java/lang/Throwable 3045 | constant_pool_index 286 // java/lang/Exception 3046 | constant_pool_index 288 // java/lang/RuntimeException 3047 | constant_pool_index 290 // javacard/framework/CardRuntimeException 3048 | } 3049 | export_interfaces_count 0 3050 | interfaces { 3051 | } 3052 | export_fields_count 13 3053 | fields { 3054 | field_info { 3055 | token 255 3056 | access_flags public static final 3057 | name_index 254 // NO_EF_SELECTED 3058 | Descriptor_Index 1 // S 3059 | attributes_count 1 3060 | attributes { 3061 | ConstantValue_attribute { 3062 | attribute_name_index 2 // ConstantValue 3063 | attribute_length 2 3064 | constantvalue_index 220 // value = 1 3065 | } 3066 | } 3067 | } 3068 | field_info { 3069 | token 255 3070 | access_flags public static final 3071 | name_index 255 // FILE_INCONSISTENT 3072 | Descriptor_Index 1 // S 3073 | attributes_count 1 3074 | attributes { 3075 | ConstantValue_attribute { 3076 | attribute_name_index 2 // ConstantValue 3077 | attribute_length 2 3078 | constantvalue_index 212 // value = 2 3079 | } 3080 | } 3081 | } 3082 | field_info { 3083 | token 255 3084 | access_flags public static final 3085 | name_index 256 // AC_NOT_FULFILLED 3086 | Descriptor_Index 1 // S 3087 | attributes_count 1 3088 | attributes { 3089 | ConstantValue_attribute { 3090 | attribute_name_index 2 // ConstantValue 3091 | attribute_length 2 3092 | constantvalue_index 214 // value = 3 3093 | } 3094 | } 3095 | } 3096 | field_info { 3097 | token 255 3098 | access_flags public static final 3099 | name_index 257 // FILE_NOT_FOUND 3100 | Descriptor_Index 1 // S 3101 | attributes_count 1 3102 | attributes { 3103 | ConstantValue_attribute { 3104 | attribute_name_index 2 // ConstantValue 3105 | attribute_length 2 3106 | constantvalue_index 216 // value = 4 3107 | } 3108 | } 3109 | } 3110 | field_info { 3111 | token 255 3112 | access_flags public static final 3113 | name_index 258 // INTERNAL_ERROR 3114 | Descriptor_Index 1 // S 3115 | attributes_count 1 3116 | attributes { 3117 | ConstantValue_attribute { 3118 | attribute_name_index 2 // ConstantValue 3119 | attribute_length 2 3120 | constantvalue_index 259 // value = 5 3121 | } 3122 | } 3123 | } 3124 | field_info { 3125 | token 255 3126 | access_flags public static final 3127 | name_index 260 // INVALIDATION_STATUS_CONTRADICTION 3128 | Descriptor_Index 1 // S 3129 | attributes_count 1 3130 | attributes { 3131 | ConstantValue_attribute { 3132 | attribute_name_index 2 // ConstantValue 3133 | attribute_length 2 3134 | constantvalue_index 261 // value = 6 3135 | } 3136 | } 3137 | } 3138 | field_info { 3139 | token 255 3140 | access_flags public static final 3141 | name_index 262 // OUT_OF_FILE_BOUNDARIES 3142 | Descriptor_Index 1 // S 3143 | attributes_count 1 3144 | attributes { 3145 | ConstantValue_attribute { 3146 | attribute_name_index 2 // ConstantValue 3147 | attribute_length 2 3148 | constantvalue_index 263 // value = 7 3149 | } 3150 | } 3151 | } 3152 | field_info { 3153 | token 255 3154 | access_flags public static final 3155 | name_index 264 // OUT_OF_RECORD_BOUNDARIES 3156 | Descriptor_Index 1 // S 3157 | attributes_count 1 3158 | attributes { 3159 | ConstantValue_attribute { 3160 | attribute_name_index 2 // ConstantValue 3161 | attribute_length 2 3162 | constantvalue_index 265 // value = 8 3163 | } 3164 | } 3165 | } 3166 | field_info { 3167 | token 255 3168 | access_flags public static final 3169 | name_index 266 // RECORD_NUMBER_NOT_AVAILABLE 3170 | Descriptor_Index 1 // S 3171 | attributes_count 1 3172 | attributes { 3173 | ConstantValue_attribute { 3174 | attribute_name_index 2 // ConstantValue 3175 | attribute_length 2 3176 | constantvalue_index 267 // value = 9 3177 | } 3178 | } 3179 | } 3180 | field_info { 3181 | token 255 3182 | access_flags public static final 3183 | name_index 268 // INVALID_MODE 3184 | Descriptor_Index 1 // S 3185 | attributes_count 1 3186 | attributes { 3187 | ConstantValue_attribute { 3188 | attribute_name_index 2 // ConstantValue 3189 | attribute_length 2 3190 | constantvalue_index 269 // value = 10 3191 | } 3192 | } 3193 | } 3194 | field_info { 3195 | token 255 3196 | access_flags public static final 3197 | name_index 270 // PATTERN_NOT_FOUND 3198 | Descriptor_Index 1 // S 3199 | attributes_count 1 3200 | attributes { 3201 | ConstantValue_attribute { 3202 | attribute_name_index 2 // ConstantValue 3203 | attribute_length 2 3204 | constantvalue_index 271 // value = 11 3205 | } 3206 | } 3207 | } 3208 | field_info { 3209 | token 255 3210 | access_flags public static final 3211 | name_index 272 // MAX_VALUE_REACHED 3212 | Descriptor_Index 1 // S 3213 | attributes_count 1 3214 | attributes { 3215 | ConstantValue_attribute { 3216 | attribute_name_index 2 // ConstantValue 3217 | attribute_length 2 3218 | constantvalue_index 273 // value = 12 3219 | } 3220 | } 3221 | } 3222 | field_info { 3223 | token 255 3224 | access_flags public static final 3225 | name_index 274 // MEMORY_PROBLEM 3226 | Descriptor_Index 1 // S 3227 | attributes_count 1 3228 | attributes { 3229 | ConstantValue_attribute { 3230 | attribute_name_index 2 // ConstantValue 3231 | attribute_length 2 3232 | constantvalue_index 275 // value = 13 3233 | } 3234 | } 3235 | } 3236 | } 3237 | export_methods_count 5 3238 | methods { 3239 | method_info { 3240 | token 0 3241 | access_flags public 3242 | name_index 276 // 3243 | Descriptor_Index 236 // (S)V 3244 | } 3245 | method_info { 3246 | token 1 3247 | access_flags public static 3248 | name_index 277 // throwIt 3249 | Descriptor_Index 236 // (S)V 3250 | } 3251 | method_info { 3252 | token 0 3253 | access_flags public 3254 | name_index 250 // equals 3255 | Descriptor_Index 251 // (Ljava/lang/Object;)Z 3256 | } 3257 | method_info { 3258 | token 1 3259 | access_flags public 3260 | name_index 278 // getReason 3261 | Descriptor_Index 279 // ()S 3262 | } 3263 | method_info { 3264 | token 2 3265 | access_flags public 3266 | name_index 280 // setReason 3267 | Descriptor_Index 236 // (S)V 3268 | } 3269 | } 3270 | } 3271 | } 3272 | } 3273 | --------------------------------------------------------------------------------