Emmc Cid Decoder 🆓
Most Linux systems expose the CID via sysfs. Run:
cat /sys/block/mmcblk0/device/cid
That outputs a 32-character hex string (128 bits). Example:
150100303136473332e03f5d9600b46d
Now, let’s decode it using a simple Python snippet or an online tool.
Quick manual decode (offsets, 0-indexed): emmc cid decoder
cid = "150100303136473332e03f5d9600b46d"
mid = cid[0:2] # 0x15 (Kingston) oem = cid[2:6] # 0x0100 pnm = bytes.fromhex(cid[6:18]).decode() # "016G32" prv = cid[18:20] # 0xe0 → revision 1.0? psn = cid[20:28] # 0x3f5d9600 mdt = cid[28:32] # 0xb46d → year/mon decode
Or use mmc-utils:
sudo mmc extcsd read /dev/mmcblk0 | grep -i cid
For offline or batch decoding, Python scripts are ideal. Below is a simple yet complete eMMC CID decoder.
#!/usr/bin/env python3 # eMMC CID Decoder import sysdef decode_emmc_cid(cid_hex): cid_bytes = bytes.fromhex(cid_hex) if len(cid_bytes) != 16: raise ValueError("CID must be 32 hex chars (16 bytes)")
# MID mid = cid_bytes[0] manufacturers = 0x15: "Samsung", 0x11: "Toshiba", 0xFE: "SanDisk", 0x45: "Sandisk", 0x03: "Hynix", 0x01: "Samsung", 0x00: "No manufacturer" print(f"Manufacturer ID (MID): 0xmid:02X (manufacturers.get(mid, 'Unknown'))") # OID oid = cid_bytes[2] print(f"OEM ID (OID): 0xoid:02X") # Product Name (PNM) - bytes 3 to 8 (6 chars) pnm = cid_bytes[3:9].decode('ascii', errors='ignore').strip('\x00') print(f"Product Name (PNM): pnm") # Product Revision (PRV) prv = cid_bytes[9] rev_major = (prv >> 4) & 0x0F rev_minor = prv & 0x0F print(f"Product Revision (PRV): rev_major.rev_minor (BCD)") # Serial Number (PSN) - bytes 10,11,12,13 psn = int.from_bytes(cid_bytes[10:14], byteorder='big') print(f"Serial Number (PSN): psn (0xpsn:08X)") # Manufacturing Date (MDT) - bits from byte 14 (nibbles) mdt_byte = cid_bytes[14] year_nibble = (mdt_byte >> 4) & 0x0F month_nibble = mdt_byte & 0x0F # Year offset from 1997 (JEDEC standard) year = 1997 + year_nibble print(f"Manufacturing Date: year:04d-month_nibble:02d (nibble year offset)") # CRC7 crc_byte = cid_bytes[15] >> 1 print(f"CRC7: 0xcrc_byte:02X")
if name == "main": if len(sys.argv) != 2: print("Usage: python emmc_cid_decoder.py <32-char-hex-cid>") sys.exit(1) decode_emmc_cid(sys.argv[1])Most Linux systems expose the CID via sysfs
Save as cid_decoder.py and run:
python cid_decoder.py 1501004242473541021A79C0D5012B
The last 7 bits of the CID (bits 7:1) contain a checksum. Advanced decoders verify this CRC. If the CRC is invalid, the CID may have been corrupted due to a bad read or failing chip. That outputs a 32-character hex string (128 bits)