Reading IMSI, TMSI, ICCID, MNC, MCC and LAC using SimReadRecord API

Download the source code

While searching I found this useful link explaining how to retrieve ICC-ID using Sim Manager APIs. I extended this sample to read IMSI, TMSI, MNC, MCC and LAC. The SimReadRecord API is used to read the records stored in the SIM. The second parameter specifies the address to read and the sixth parameter specifies the size of the data to read. To get more details of the SIM records refer to the GSM 11.11 specification. Below are some of the record address and its length:

ICCID address 0x2FE2, length 10 bytes
IMSI address 0x6F07, length 10 bytes
TMSI, MCC, MNC, LAC address 0x6F7E, length 11 bytes

29 Comments

Add yours →

  1. hi
    I used the SimReadRecord like this:
    HSIM hSim=NULL;
    HRESULT hResult=0;
    hResult=SimInitialize(0,NULL,0,&hSim);
    if (hResult!=S_OK)
    {
    MessageBox(m_hDlg,_T(“初始化失败!”),_T(“提示”),MB_OK);
    }
    else
    {
    DWORD EF_ICCID=0x2FE2;
    BYTE* pbtDate=new BYTE[50];
    DWORD dwSize=0;
    hResult=SimReadRecord(hSim,EF_ICCID,SIM_RECORDTYPE_TRANSPARENT,0,pbtDate,50,&dwSize);
    }

    SimDeinitialize(hSim);
    But the SimReadRecord is return SIM_E_MOBILEERROR, I can’t understand this. By the way, I test the code in Windows Mobile 6.1 and CDMA net.

  2. hi
    I used the SimReadRecord like this:
    HSIM hSim=NULL;
    HRESULT hResult=0;
    hResult=SimInitialize(0,NULL,0,&hSim);
    if (hResult!=S_OK)
    {
    MessageBox(m_hDlg,_T(“初始化失败!”),_T(“提示”),MB_OK);
    }
    else
    {
    DWORD EF_ICCID=0x2FE2;
    BYTE* pbtDate=new BYTE[50];
    DWORD dwSize=0;
    hResult=SimReadRecord(hSim,EF_ICCID,SIM_RECORDTYPE_TRANSPARENT,0,pbtDate,50,&dwSize);
    }

    SimDeinitialize(hSim);
    But the SimReadRecord is return SIM_E_MOBILEERROR, I can’t understand this. By the way, I test the code in Windows Mobile 6.1 and CDMA net.

  3. hi
    I used the SimReadRecord like this:
    HSIM hSim=NULL;
    HRESULT hResult=0;
    hResult=SimInitialize(0,NULL,0,&hSim);
    if (hResult!=S_OK)
    {
    MessageBox(m_hDlg,_T(“初始化失败!”),_T(“提示”),MB_OK);
    }
    else
    {
    DWORD EF_ICCID=0x2FE2;
    BYTE* pbtDate=new BYTE[50];
    DWORD dwSize=0;
    hResult=SimReadRecord(hSim,EF_ICCID,SIM_RECORDTYPE_TRANSPARENT,0,pbtDate,50,&dwSize);
    }

    SimDeinitialize(hSim);
    But the SimReadRecord is return SIM_E_MOBILEERROR, I can’t understand this. By the way, I test the code in Windows Mobile 6.1 and CDMA net.

  4. hi
    I used the SimReadRecord like this:
    HSIM hSim=NULL;
    HRESULT hResult=0;
    hResult=SimInitialize(0,NULL,0,&hSim);
    if (hResult!=S_OK)
    {
    MessageBox(m_hDlg,_T(“初始化失败!”),_T(“提示”),MB_OK);
    }
    else
    {
    DWORD EF_ICCID=0x2FE2;
    BYTE* pbtDate=new BYTE[50];
    DWORD dwSize=0;
    hResult=SimReadRecord(hSim,EF_ICCID,SIM_RECORDTYPE_TRANSPARENT,0,pbtDate,50,&dwSize);
    }

    SimDeinitialize(hSim);
    But the SimReadRecord is return SIM_E_MOBILEERROR, I can’t understand this. By the way, I test the code in Windows Mobile 6.1 and CDMA net.

  5. Thank you very much.
    And do you have any idea for getting ICCID in the CDMA network?
    Thank you angin.

  6. Thank you very much.
    And do you have any idea for getting ICCID in the CDMA network?
    Thank you angin.

  7. Thank you very much.
    And do you have any idea for getting ICCID in the CDMA network?
    Thank you angin.

  8. Thank you very much.
    And do you have any idea for getting ICCID in the CDMA network?
    Thank you angin.

  9. Liu, this document has the address of different records in CDMA. I think the address is 0x6F74 you are looking for. I will work on it and update you here, meanwhile if you get anything post it here.

  10. Liu, this document has the address of different records in CDMA. I think the address is 0x6F74 you are looking for. I will work on it and update you here, meanwhile if you get anything post it here.

  11. Liu, this document has the address of different records in CDMA. I think the address is 0x6F74 you are looking for. I will work on it and update you here, meanwhile if you get anything post it here.

  12. Liu, this document has the address of different records in CDMA. I think the address is 0x6F74 you are looking for. I will work on it and update you here, meanwhile if you get anything post it here.

  13. Hi.
    I have tried the address0x6F74,but it was not working.And,I had searched in MSDN,just found someting like this “CDMA mobile devices do not support SIM Manager”.My god!

  14. Hi.
    I have tried the address0x6F74,but it was not working.And,I had searched in MSDN,just found someting like this “CDMA mobile devices do not support SIM Manager”.My god!

  15. Hi.
    I have tried the address0x6F74,but it was not working.And,I had searched in MSDN,just found someting like this “CDMA mobile devices do not support SIM Manager”.My god!

  16. Hi.
    I have tried the address0x6F74,but it was not working.And,I had searched in MSDN,just found someting like this “CDMA mobile devices do not support SIM Manager”.My god!

  17. God Save Me!
    But,thank you very much.

  18. God Save Me!
    But,thank you very much.

  19. God Save Me!
    But,thank you very much.

  20. God Save Me!
    But,thank you very much.

  21. Sorry sir , i downloaded Sim read put how can i use it ?

Leave a Reply