Hi, I am having a hard time figuring out how to structure an APDU command to update the the first PNN record on a SIM, the main issue is the PNN specific data formatting and figuring out what it is expecting…
I have looked at the 3GPP specs TS 131 102 (go to page 62) TS 124 008 (go to page 537) and will paste a figure below ( I am a new user so I can embed only one…):
Using these my thought process has been the following:
APDU command for updating a record:
| CLA | INS | P1 | P2 | Lc | Data | Le |
| 00 | DC | 01 | 04 | Lc | data | ff |
DC = Update record
P1 = 0x01 specifies record 1 to be updated
P2 = 0x04 = 0 0 0 0 0 (first 5 bits 0 = currently selected EF) 1 0 0 (use Record number given in P1)
Lc = Length, bytes of data field.
Now the data field, this will follow the Network Name info element figure, where
first byte = Network Name IEI = 0x43 for updating the Full Network Name.
second byte = Length of Network Name contents in bytes.
third byte is where I am getting a bit stuck I believe. I am using it to set what I want the actual Full Network Name to be but it doesn’t seem to work.
FYI I have tried in pySIM but also a private tool that can send APDUs to SIMs…
Examples below of the data I want to update the record with:
43 04 48 45 4C 50 ff
where 48 45 4C 50 is just a hex string using GSM3.38 encoding…
with the APDU command this would potentially look like
00 DC 01 04 06 43 04 48 45 4C 50
I have also tried using the third octet defined in Table 10.5.94/3GPP TS 24.008 but that also doesn’t seem to be right.
If anyone has any ideas or guidance, I would be very thankful. Hopefully, this isn’t a silly ask, I am relatively new to the industry.
EDIT: aware it says to-do in the pysim source code for EF.PNN full and short network names
