That looks right. Starting here, I went through the card features. Also try:
sle4442
To probe the card and decode the ATR.
That looks right. Starting here, I went through the card features. Also try:
sle4442
To probe the card and decode the ATR.
Okay. Following along in your notesā¦
First step was the (1) macro - which no longer exists. I assume thatās āsle4442 initā
Second - a minor bug. When I pasted your command
2WIRE> [ 0x34 0 0 ] r:4
Invalid command: [. Type ? for help.
This was caused by a space before the ā[ā
Third - Iām using a blank 3rd party card. 0x34 and ox31 report all ones and I get this error
sle4442 dump
--SLE44xx decoder--
ATR: 0xa2 0x13 0x10 0x91
Protocol Type: S 10
Structure Identifier: General Purpose (Structure 1)
Read: Read to end
Data Units: 256
Data Units Bits: 8
Error reading security memory
Is this because itās locked?
I just tried a SIM card from 2005 (I bought a collection off ebay) using the holder on the upper right.
This worked
HDPLXUART> {
RST HIGH
HDPLXUART> a 2 ; @ 2
IO2 set to OUTPUT: 0
IO2 set to INPUT: 1
HDPLXUART> 0x3b 0xbc 0x94 0x00 0x40 0x14 0x47 0x47 0x33 0x48 0x33 0x35 0x58 0x53 0x32 0x30 0x30 0x30
Although the command āsimā did nothing.
I havenāt had success with the smaller, more recent sim card on the smaller holder on the upper left. I only have a couple to use.
if(secmem[0]<=7){
return true;
}
The error means the remaining number of password attempts is greater than 0b111, which is basically saying the card doesnāt respond (all ones or something).
I pushed an update that will show the security memory contents if there is an error, then we can see whats going on.
If you get all ones for [0x31 0 0] r:4, then there is something going wrong. Power is 3.3v? Pull-ups are on? Speed is <50kHz?
Couple things:
L
, or the commands wonāt be in the right order}D{^}r:4
at the start of each sessionHmm.
Bus Pirate 5 REV10
Firmware main branch (2024-04-16T12:20:49Z)
RP2040 with 264KB RAM, 128Mbit FLASH
S/N: 32104F0B33CC62E4
https://BusPirate.com/
Storage: 0.10GB (FAT16 File System)
Configuration file: Not Detected
Available modes: HiZ 1-WIRE UART HDPLXUART I2C SPI 2WIRE DIO LED
Active mode: HW2WIRE (speed)=(0)
Display format: Auto
Data format: 8 bits, LSB bitorder
Pull-up resistors: ON
Power supply: ON (3.3V/3.29V)
Current limit: OK (9.0mA/100.0mA)
Frequency generators: OFF
WIRE> }D{^}r:4
RST LOW
Delay: 1ms
RST HIGH
Tick clock: 1
RST LOW
RX: 0xA2 0x13 0x10 0x91
2WIRE> [0x31 0 0] r:4
I2C START
TX: 0x31
TX: 0 0
I2C STOP
RX: 0xFF 0xFF 0xFF 0xFF
2WIRE> [0x34 0 0] r:4
I2C START
TX: 0x34
TX: 0 0
I2C STOP
RX: 0xFF 0xFF 0xFF 0xFFI2C START
TX: 0x31
TX: 0 0
I2C STOP
RX: 0xFF 0xFF 0xFF 0xFF
2WIRE> sle4442 init
--SLE44xx decoder--
ATR: 0xa2 0x13 0x10 0x91
Protocol Type: S 10
Structure Identifier: General Purpose (Structure 1)
Read: Read to end
Data Units: 256
Data Units Bits: 8
Error reading security memory
Thank you. Thatās really strange. Does this also happen with the card I sent with the adapter?
Cancel my last post. Really stupid mistake. Continuing with the testingā¦
No stupid mistakes, only opportunity to improve things and add guard rails for us all.
Trust me, it was dumb. But I am a pioneer!
I got a results of
0x3b 0x3d 0x95 0x00 0x80 0x67 0xaf 0x03 0x0f 0x01 0x7c 0x06 0x0e 0x83 0x3e 0x9f 0x16
Nice.
The decoder is actually This link but I could not copy/paste the output because the ATR parser didnāt like the ā0xā prefix.
Wishlist: It would be convenient to output the results in hex without the ā0xā before each byte, so I could paste it as is.
Instead I simply copied the ATR string and in a shell window I typed
echo <pasted result> | sed 's/0x//g'
And I then copied this to paste into the ATR decoder.
And it tells me itās a (Sprint) Nextel USA iDEN SIM card, Itās an old TMobile SIM, so I think thatās rightā¦Excellentā¦
I purchased these old SIM cards 20 years ago - they were expired. Some of them still had text messages in them. Is there any way I can use the BP to dump this data?
Iām not clear how to use the āsimā command.
HDPLXUART> help mode
Peer to peer HALF DUPLEX asynchronous protocol with open drain bus.
Requires pull-up resistors
BPCMD | DATA(8/9 bits) |
IDLE |STRT| D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |PRTY|STOP|IDLE
TXD """""|____|{##}|{##}|{##}|{##}|{##}|{##}|{##}|{##}|{##}|""""|"""""
RXD """""|____|{##}|{##}|{##}|{##}|{##}|{##}|{##}|{##}|{##}|""""|"""""
^sample moment
Connections:
RXTX ------------------ RXTX
GND ------------------ GND
{ use { to print data as it arrives
}/] use } or ] to stop printing data
HDPLXUART mode commands:
sim Description not set. Try -h for command help
HDPLXUART> sim
HDPLXUART> sim -h
usage:
sim [-h(elp)]
open UART with raw data IO, usb to serial bridge mode
-h Get additional help
Love it!
Not yet, I havenāt made it to that yet. The best reference Iāve seen is this thesis paper. It seems like thereās a series of headers that are a little file system and you drill down into the stored data. My goal is to get this going with the sim command.
The sim command is a place holder. I started it, but thereās no accessible functionality yet.
For some exploring I have been using pysim-shell from osmocom.
pySim-shell ā osmopysim-usermanual documentation
Instead of trying to put all this in buspirate might be better to make buspirate look like a pscs readerā¦
(Currently head down with simtrace2, a man in the middle for SIM and mobile data modem)
Thatās an EXCELLENT idea.
BTW, I think I had this kit from Lady Ada and some of the SIMS, when dumped, showed TXT messages. A raw dump would reveal them, I expect.
Oh man, thatās so old school! It comes up in my searches for SIM card stuff from time to time. It really takes me back! Serial ports! That site layout! It was all so fashionable at the time.
Been checking and pysim has a transport for a basic (phoenix) serial card reader. Which appears to be this sort of interface https://circuitsarchive.org/circuits/smartcard/smartcard-pc-serial-reader-writer-phoenix/.
So buspirate as an interface convertor, tty over USB on oine side and card socket on the other.
I think we can support this with a transparent UART bridge command, similar to what is supported in the 2 wire UART mode.
The latest build has a bridge
command in the half duplex uart mode to test with pysim.
bridge
and the Bus Pirate will just convert data back and forth.I jumped the gun on this a bit. It looks like they use the RTS signal to trigger the RESET pin. I need to figure out how to get the RTS signal from TinyUSB and implement this functionality.
I pushed an update that I think will put the RTS signal on IO2 during the bridge command. This should let it work with pysim. Untested at this moment.