Ejemplo n.º 1
0
        // Token: 0x06000167 RID: 359 RVA: 0x00005164 File Offset: 0x00003364
        public override uint getCardID(bool silent)
        {
            if (!this.checkDevice(true))
            {
                return(0U);
            }
            byte[] array  = new byte[8];
            byte[] array2 = new byte[4];
            MHCardReader.E5557_Select_Page(1);
            int num = MHCardReader.E5557_Read_Free(2, array);

            if (num != 0)
            {
                if (!silent)
                {
                    WMMessageBox.Show(this.owner, "无法读取卡片密码!");
                }
                return(0U);
            }
            array2[0] = array[4];
            array2[1] = array[5];
            array2[2] = array[6];
            array2[3] = array[7];
            if (array2 == null)
            {
                return(0U);
            }
            uint[] array3 = base.byte2Uint32(array2);
            if (array3.Length <= 0)
            {
                return(0U);
            }
            return(array3[0]);
        }
Ejemplo n.º 2
0
        // Token: 0x06000165 RID: 357 RVA: 0x00005058 File Offset: 0x00003258
        public override int isValidCard(bool silent)
        {
            if (!this.checkDevice(true))
            {
                return(-2);
            }
            this.pwd = base.getPassword(silent);
            if (this.pwd == null)
            {
                return(-1);
            }
            byte[] array = new byte[28];
            MHCardReader.E5557_Select_Page(0);
            if (MHCardReader.E5557_Read_Free(7, array) == 0)
            {
                return(1);
            }
            int num = MHCardReader.E5557_Direct_Read(0, 0, 1, this.pwd, array);

            if (array[0] == 0 && array[1] == 8 && array[2] == 128 && array[3] == 56 && num == 0)
            {
                return(2);
            }
            return(-1);
        }
Ejemplo n.º 3
0
 // Token: 0x06000164 RID: 356 RVA: 0x00005020 File Offset: 0x00003220
 public override bool isEmptyCard()
 {
     if (!this.checkDevice(true))
     {
         return(false);
     }
     MHCardReader.E5557_Select_Page(0);
     byte[] result = new byte[28];
     return(MHCardReader.E5557_Read_Free(7, result) == 0);
 }
Ejemplo n.º 4
0
        // Token: 0x06000168 RID: 360 RVA: 0x000051E4 File Offset: 0x000033E4
        public override int clearAllData(bool beep, bool initialize)
        {
            if (!this.checkDevice(true))
            {
                return(-2);
            }
            this.pwd = base.getPassword(beep);
            if (this.pwd == null)
            {
                return(-1);
            }
            byte[] array = new byte[28];
            MHCardReader.E5557_Select_Page(0);
            int num = MHCardReader.E5557_Read_Free(7, array);

            if (num != 0)
            {
                num = MHCardReader.E5557_Direct_Read(0, 0, 1, this.pwd, array);
                if (array[0] != 0 || array[1] != 8 || array[2] != 128 || array[3] != 56 || num != 0)
                {
                    return(-1);
                }
                byte[] data = new byte[]
                {
                    0,
                    8,
                    128,
                    232
                };
                num = MHCardReader.E5557_Write_Pwd(0, 0, 0, this.pwd, data);
            }
            if (num == 0)
            {
                num = MHCardReader.E5557_Write_Free(0, 1, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 2, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 3, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 4, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 5, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 6, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 7, 0, new byte[4]);
            }
            MHCardReader.E5557_Select_Page(0);
            if (MHCardReader.E5557_Read_Free(7, array) == 0)
            {
                if (beep)
                {
                    MHCardReader.Beep_Option();
                }
                MHCardReader.Led_Option();
                if (initialize)
                {
                    this.initializeCard();
                }
                return(0);
            }
            WMMessageBox.Show(this.owner, "清除数据失败,请手工清除!");
            return(-1);
        }
Ejemplo n.º 5
0
        // Token: 0x06000166 RID: 358 RVA: 0x000050D8 File Offset: 0x000032D8
        public override int initializeCard()
        {
            if (!this.checkDevice(true))
            {
                return(-1);
            }
            this.pwd = base.getPassword();
            if (this.pwd == null)
            {
                return(-2);
            }
            byte[] result = new byte[28];
            MHCardReader.E5557_Select_Page(0);
            int num = MHCardReader.E5557_Read_Free(7, result);

            if (num != 0)
            {
                return(1);
            }
            num = MHCardReader.E5557_Write_Free(0, 7, 0, this.pwd);
            if (num != 0)
            {
                return(-1);
            }
            if (MHCardReader.E5557_Write_Free(0, 0, 0, new byte[]
            {
                0,
                8,
                128,
                56
            }) == 0)
            {
                return(0);
            }
            return(-1);
        }